annotate mrfast-2.1.0.4/Common.h @ 0:7b3dc85dc7fd

Uploaded mrfast source tarball
author calkan
date Tue, 21 Feb 2012 10:29:47 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
1 /*
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
2 * Copyright (c) <2008 - 2012>, University of Washington, Simon Fraser University
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
3 * All rights reserved.
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
4 *
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
5 * Redistribution and use in source and binary forms, with or without modification,
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
6 * are permitted provided that the following conditions are met:
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
7 *
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
8 * Redistributions of source code must retain the above copyright notice, this list
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
9 * of conditions and the following disclaimer.
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
10 * - Redistributions in binary form must reproduce the above copyright notice, this
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
11 * list of conditions and the following disclaimer in the documentation and/or other
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
12 * materials provided with the distribution.
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
13 * - Neither the names of the University of Washington, Simon Fraser University,
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
14 * nor the names of its contributors may be
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
15 * used to endorse or promote products derived from this software without specific
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
16 * prior written permission.
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
17 *
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
22 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
23 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
24 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
25 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
26 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
27 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
29 */
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
30
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
31 /*
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
32 Authors:
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
33 Farhad Hormozdiari
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
34 Faraz Hach
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
35 Can Alkan
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
36 Emails:
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
37 farhadh AT uw DOT edu
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
38 fhach AT cs DOT sfu DOT ca
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
39 calkan AT uw DOT edu
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
40 */
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
41
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
42
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
43
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
44 #ifndef __COMMON__
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
45 #define __COMMON__
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
46
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
47 #include <zlib.h>
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
48
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
49 #define SEQ_MAX_LENGTH 300 // Seq Max Length
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
50 #define CONTIG_OVERLAP 200 // No. of characters overlapped between contings
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
51 #define CONTIG_NAME_SIZE 200 // Contig name max size
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
52 #define FILE_NAME_LENGTH 400 // Filename Max Length
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
53 #define DISCORDANT_CUT_OFF 800
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
54 #define MAX_OPEN_FILE 600
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
55 #define MAX_TRANS_CHROMOSAL_OUTPUT 50
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
56 #define MAX_OEA_OUT 500
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
57
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
58 extern unsigned int CONTIG_SIZE;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
59 extern unsigned int CONTIG_MAX_SIZE;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
60
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
61
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
62 extern unsigned char WINDOW_SIZE ; // WINDOW SIZE for indexing/searching
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
63 extern unsigned short SEQ_LENGTH; // Sequence(read) length
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
64
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
65 extern char *versionNumber;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
66 extern char *versionNumberF;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
67 extern unsigned char mrFAST;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
68
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
69
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
70 extern int maxOEAOutput;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
71 extern int maxDiscordantOutput;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
72 extern int uniqueMode;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
73 extern int indexingMode;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
74 extern int searchingMode;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
75 extern int pairedEndMode;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
76 extern int pairedEndDiscordantMode;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
77 extern int transChromosal;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
78 extern int pairedEndProfilingMode;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
79 extern int bestMode;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
80 extern int nosamMode;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
81 extern int seqCompressed;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
82 extern int outCompressed;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
83 extern int cropSize;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
84 extern int progressRep;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
85 extern char *seqFile1;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
86 extern char *seqFile2;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
87 extern char *seqUnmapped;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
88 extern char *mappingOutput;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
89 extern char *mappingOutputPath;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
90 extern char *unmappedOutput;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
91 extern unsigned char seqFastq;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
92 extern unsigned char errThreshold;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
93 extern unsigned char maxHits;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
94 extern int minPairEndedDiscordantDistance;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
95 extern int maxPairEndedDiscordantDistance;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
96 extern int minPairEndedDistance;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
97 extern int maxPairEndedDistance;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
98 extern char fileName[1000][2][FILE_NAME_LENGTH];
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
99 extern int fileCnt;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
100 extern long long memUsage;
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
101
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
102 FILE * fileOpen(char *fileName, char *mode);
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
103 gzFile fileOpenGZ(char *fileName, char *mode);
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
104 double getTime(void);
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
105 void reverseComplete (char *seq, char *rcSeq , int length);
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
106 void * getMem(size_t size);
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
107 void freeMem(void * ptr, size_t size);
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
108 double getMemUsage();
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
109 void reverse (char *seq, char *rcSeq , int length);
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
110 void stripPath(char *full, char **path, char **fileName);
7b3dc85dc7fd Uploaded mrfast source tarball
calkan
parents:
diff changeset
111 #endif