NCBI C Toolkit Cross Reference

C/tools/actutils.h


  1 /* $Id: actutils.h,v 6.17 2008/05/02 18:02:39 bollin Exp $
  2  *===========================================================================
  3 *
  4 *                            PUBLIC DOMAIN NOTICE
  5 *            National Center for Biotechnology Information (NCBI)
  6 *
  7 *  This software/database is a "United States Government Work" under the
  8 *  terms of the United States Copyright Act.  It was written as part of
  9 *  the author's official duties as a United States Government employee and
 10 *  thus cannot be copyrighted.  This software/database is freely available
 11 *  to the public for use. The National Library of Medicine and the U.S.
 12 *  Government do not place any restriction on its use or reproduction.
 13 *  We would, however, appreciate having the NCBI and the author cited in
 14 *  any work or product based on this material.
 15 *
 16 *  Although all reasonable efforts have been taken to ensure the accuracy
 17 *  and reliability of the software and data, the NLM and the U.S.
 18 *  Government do not and cannot warrant the performance or results that
 19 *  may be obtained by using this software or data. The NLM and the U.S.
 20 *  Government disclaim all warranties, express or implied, including
 21 *  warranties of performance, merchantability or fitness for any particular
 22 *  purpose.
 23 *
 24 * ===========================================================================
 25 *
 26 * File Name:  actutils.h
 27 *
 28 * Author:  Sarah Wheelan
 29 *
 30 * Version Creation Date:   2/00
 31 *
 32 * $Revision: 6.17 $
 33 *
 34 * File Description: utility functions for alignments
 35 *
 36 * Modifications:
 37 * --------------------------------------------------------------------------
 38 * $Log: actutils.h,v $
 39 * Revision 6.17  2008/05/02 18:02:39  bollin
 40 * Fixed bug in ACT_CleanUpAlignments - if an alignment span is completely
 41 * contained in another alignment, remove the contained alignment.
 42 * Also added a flag to Sqn_GlobalAlign2SeqEx for whether or not the alignment
 43 * should be expanded to the ends of the sequence.
 44 *
 45 * Revision 6.16  2006/01/03 15:47:25  bollin
 46 * allow alignment callback for ACT_FindPiece so that it can use the new BLAST
 47 * library
 48 *
 49 * Revision 6.15  2004/11/22 16:45:24  bollin
 50 * created global alignment function with callback method to allow use of new
 51 * BLAST library
 52 *
 53 * Revision 6.14  2004/11/02 18:53:39  bollin
 54 * made act_get_eval available to other libraries
 55 *
 56 * Revision 6.13  2004/07/30 13:36:47  bollin
 57 * created separate function for reversing features on a sequence, changed code
 58 * to swap plus to minus and minus to plus instead of moving all features to
 59 * minus strand
 60 *
 61 * Revision 6.12  2002/03/27 17:35:39  todorov
 62 * recreated ACT_MakeProfileFromSA
 63 *
 64 * Revision 6.11  2002/03/26 19:56:21  todorov
 65 * alignmgr to alignmgr2 transition
 66 *
 67 * Revision 6.10  2001/09/04 13:47:13  wheelan
 68 * made several functions extern
 69 *
 70 * Revision 6.9  2001/07/13 14:17:54  wheelan
 71 * moved Sqn_GlobalAlign2Seq and associated functions here
 72 *
 73 * Revision 6.8  2000/09/06 18:06:04  sicotte
 74 * Add End gaps for sequin updates
 75 *
 76 * Revision 6.7  2000/08/28 16:19:14  sicotte
 77 * moved AlnMgrSeqAlignMergeTwoPairwiseEx AlnMgrSeqAlignMergeTwoPairwise AlnMgrSeqAlignMergePairwiseSet to actutils.c from alignmgr.c
 78 *
 79 * Revision 6.6  2000/07/08 20:44:11  vakatov
 80 * Get all "#include" out of the 'extern "C" { }' scope;  other cleanup...
 81 *
 82 * Revision 6.5  2000/05/04 16:45:20  wheelan
 83 * changes to profile builder to accomodate IBMed BLAST results
 84 *
 85 * Revision 6.4  2000/04/18 13:57:14  wheelan
 86 * added AlnMgrForcePairwiseContinuousEx
 87 *
 88 * Revision 6.3  2000/03/14 11:25:48  wheelan
 89 * added ACT_ProfileFree functions
 90 *
 91 * Revision 6.2  2000/03/02 21:11:06  lewisg
 92 * use bandalign for import sequence, make standalone ddv use viewmgr, make dialogs modal, send color update
 93 *
 94 * Revision 6.1  2000/02/11 17:31:45  kans
 95 * initial checkin of functions depending upon blast/bandalign (SW)
 96 *
 97 * ==========================================================================
 98 */
 99 
100 #ifndef __ACTUTILS__
101 #define __ACTUTILS__
102 
103 #include <ncbi.h>
104 #include <objalign.h>
105 #include <alignmgr2.h>
106 #include <sqnutils.h>
107 #include <bandalgn.h>
108 #include <needleman.h>
109 #include <dotseq.h>
110 #include <edutil.h>
111 
112 #undef NLM_EXTERN
113 #ifdef NLM_IMPORT
114 #define NLM_EXTERN NLM_IMPORT
115 #else
116 #define NLM_EXTERN extern
117 #endif
118 
119 #ifdef __cplusplus
120 extern "C" {
121 #endif
122 
123 #define CG_WINDOWSIZE 200
124 
125 #define MAX_LEN 12000
126 
127 
128 /* defines for profile builder -- how many options are allowed for
129 *  protein or nucleotide sequences */
130 #define ACT_NUCLEN 5
131 #define ACT_PROTLEN 27
132 
133 typedef struct act_sitelist {
134    Int4     start;
135    CharPtr  name;
136    struct act_sitelist PNTR next;
137 } ACT_sitelist, PNTR ACT_sitelistPtr;
138 
139 typedef struct act_topscore {
140    FloatHi  score;
141    Int4     pos;
142    struct act_topscore PNTR next;
143 } ACT_TopScore, PNTR ACT_TopScorePtr;
144 
145 typedef struct act_position {
146    Int4Ptr  posarray;
147    FloatHi  score;
148 } ACT_Position, PNTR ACT_PositionPtr;
149 
150 typedef struct act_profile
151 {
152    FloatHiPtr PNTR freq;
153    Boolean    nuc;
154    Int4       len;
155    Int4       numseq;
156    FloatHi    confidence;
157    struct act_profile PNTR next;
158 } ACTProfile, PNTR ACTProfilePtr;
159 
160 typedef struct act_placebounds {
161    ACT_TopScorePtr PNTR ats;
162    Int4            len;
163    ACTProfilePtr   app;
164    ACT_PositionPtr  apos;
165    Int4Ptr         currpos;
166    Int4            currprof;
167    Int4            nprof;
168    Int4Ptr         boundarray;
169    Int4Ptr         numats;
170    ACT_TopScorePtr PNTR currats;
171 } ACT_PlaceBounds, PNTR ACT_PlaceBoundsPtr;
172 
173 
174 typedef struct act_cginfo {
175    Int4             from;
176    Int4             to;
177    Int4             length;
178    Int4             cg;
179    Int4             a;
180    Int4             c;
181    Int4             t;
182    Int4             g;
183    Int4             n;
184    ACT_sitelistPtr  asp;
185    CharPtr          sequence;
186    struct act_cginfo PNTR next;
187 } ACT_CGInfo, PNTR ACT_CGInfoPtr;
188 
189 typedef struct act_statetable
190 {
191    Int4Ptr PNTR  state;
192 } ACT_Statetab, PNTR ACT_StatetabPtr;
193 
194 NLM_EXTERN ACT_CGInfoPtr ACT_FindCpG(BioseqPtr bsp);
195 NLM_EXTERN Uint1 ACT_GetResidue(Int4 pos, Uint1Ptr buf, Int4Ptr offset, BioseqPtr bsp);
196 NLM_EXTERN ACTProfilePtr ACT_ProfileNew(Boolean nuc);
197 
198 /***************************************************************************
199 *
200 *  ACT_ProfileFree frees a single profile; ACT_ProfileSetFree frees an
201 *  entire linked list of profiles.
202 *
203 ***************************************************************************/
204 NLM_EXTERN ACTProfilePtr ACT_ProfileFree(ACTProfilePtr app);
205 NLM_EXTERN ACTProfilePtr ACT_ProfileSetFree(ACTProfilePtr app);
206 
207 NLM_EXTERN void ACT_BuildProfile(SeqLocPtr slp, ACTProfilePtr PNTR app, Int4Ptr count, Int4 length);
208 NLM_EXTERN FloatHi ACT_ScoreProfile(BioseqPtr bsp, Int4 pos, Uint1 strand, ACTProfilePtr app);
209 NLM_EXTERN void ACT_EstimateConfidence(ACTProfilePtr app);
210 NLM_EXTERN ACTProfilePtr ACT_SortProfilesByConfidence(ACTProfilePtr app);
211 NLM_EXTERN int LIBCALLBACK ACT_CompareProfileConfidence(VoidPtr base, VoidPtr large_son);
212 NLM_EXTERN ACTProfilePtr ACT_MakeProfileFromSA(SeqAlignPtr sap);
213 NLM_EXTERN ACT_TopScorePtr PNTR ACT_SortAndTruncate(ACT_TopScorePtr PNTR ats);
214 NLM_EXTERN ACT_TopScorePtr ACT_FindPeakScores(FloatHiPtr scorearray, Int4 len);
215 NLM_EXTERN FloatHi act_get_eval(Int4 exp);
216 NLM_EXTERN ACT_PositionPtr ACT_PlaceByScore(ACT_PlaceBoundsPtr abp);
217 NLM_EXTERN FloatHi ACT_CalcScore(ACT_PlaceBoundsPtr abp);
218 NLM_EXTERN SeqAlignPtr Sqn_GlobalAlign2Seq (BioseqPtr bsp1, BioseqPtr bsp2, BoolPtr revcomp);
219 NLM_EXTERN void ReverseBioseqFeatureStrands (BioseqPtr bsp);
220 NLM_EXTERN void ACT_GetNthSeqRangeInSASet(SeqAlignPtr sap, Int4 n, Int4Ptr start, Int4Ptr stop);
221 NLM_EXTERN void SQN_ExtendAlnAlg(SeqAlignPtr sap, Int4 ovl, Int4 which_side, Uint1 strand);
222 NLM_EXTERN SeqAlignPtr ACT_CleanUpAlignments(SeqAlignPtr sap, Int4 len1, Int4 len2);
223 extern void ACT_RemoveInconsistentAlnsFromSet (SeqAlignPtr sap, Int4 fuzz, Int4 n);
224 
225 typedef SeqAlignPtr (LIBCALLBACK *GetAlignmentFunc) (BioseqPtr bsp1, BioseqPtr bsp2);
226 typedef SeqAlignPtr (LIBCALLBACK *GetAlignmentPieceFunc) (SeqLocPtr bsp1, SeqLocPtr bsp2);
227 
228 NLM_EXTERN SeqAlignPtr ACT_FindPiece(BioseqPtr bsp1, BioseqPtr bsp2, Int4 start1, Int4 stop1, Int4 start2, Int4 stop2, Uint1 strand, Int4 which_side, GetAlignmentPieceFunc aln_piece_func);
229 NLM_EXTERN SeqAlignPtr 
230 Sqn_GlobalAlign2SeqEx 
231 (BioseqPtr bsp1,
232  BioseqPtr bsp2,
233  BoolPtr revcomp,
234  GetAlignmentFunc aln_func,
235  GetAlignmentPieceFunc aln_piece_func,
236  Boolean extend_ends);
237 
238 
239 
240 /***************************************************************************
241 *
242 *   AlnMgr2TruncateSAP truncates a given seqalign to contain only the
243 *   bioseq coordinates from start to stop on the indicated row.  Anything
244 *   before those coordinates is discarded; anything remaining afterwards
245 *   is made into another seqalign and put in sap->next (the original next,
246 *   if any, is now at sap->next->next). Doesn't work on parent seqaligns.
247 *   The function returns TRUE if the orignal alignment extended past stop.
248 *
249 ***************************************************************************/
250 NLM_EXTERN Boolean AlnMgr2TruncateSAP(SeqAlignPtr sap, Int4 start, Int4 stop, Int4 row);
251 
252 
253 #ifdef __cplusplus
254 }
255 #endif
256 
257 #undef NLM_EXTERN
258 #ifdef NLM_EXPORT
259 #define NLM_EXTERN NLM_EXPORT
260 #else
261 #define NLM_EXTERN
262 #endif
263 
264 #endif
265 

source navigation ]   [ diff markup ]   [ identifier search ]   [ freetext search ]   [ file search ]  

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.