Mercurial > repos > portiahollyoak > fastuniq
annotate source/fastq_pair.h @ 0:816cb55b5a2d draft default tip
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
| author | portiahollyoak | 
|---|---|
| date | Thu, 02 Jun 2016 11:34:51 -0400 | 
| parents | |
| children | 
| rev | line source | 
|---|---|
| 
0
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
1 /**************************************************************************** | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
2 * The 'FASTQ_PAIR' structure group was used to store paired reads and | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
3 * qualities, including basic operation function as well. | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
4 * | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
5 * This file was written by Haibin Xu, December 2011. | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
6 ****************************************************************************/ | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
7 | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
8 #include "fastq.h" | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
9 | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
10 #ifndef _FASTQ_PAIR | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
11 typedef struct fastq_pair | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
12 { | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
13 FASTQ_ALL *seq_left; /* the left read */ | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
14 FASTQ_ALL *seq_right; /* the right read */ | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
15 } FASTQ_PAIR; | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
16 #define _FASTQ_PAIR | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
17 #endif | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
18 | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
19 /* create a FASTQ pair. If successful, return the point to it, | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
20 * otherwise, return NULL. */ | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
21 FASTQ_PAIR *fastq_pair_create(); | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
22 | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
23 /* free the FASTQ pair. If successful, return 0, otherwise return 1. */ | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
24 int fastq_pair_remove(FASTQ_PAIR *fq_pair); | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
25 | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
26 /* clear the FASTQ pair. If successful, return 0, otherwise return 1. */ | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
27 int fastq_pair_clear(FASTQ_PAIR *fq_pair); | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
28 | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
29 /* load the left and right reads and qualities for FASTQ pair from file, including description | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
30 * (whether_append_description=1) or not (whether_append_description=0), including quality | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
31 * (whether_append_quality=1) or not (whether_append_quality=0). If successful, return 0, | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
32 * otherwise, clear FASTQ pair and return 1. */ | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
33 int fastq_pair_scanf(FASTQ_PAIR *fq_pair, FILE *fp_left_in, FILE *fp_right_in, | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
34 int whether_append_description, int whether_append_quality); | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
35 | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
36 /* write the pair-end reads in FASTA or FASTQ format into two output files(format='fa' or 'fq') | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
37 * or in FASTA format into a single output file(format="fa" and fp_out2==NULL) using the original | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
38 * description (serial=-1) or the new serial. If successful, return 0, otherwise, return 1. */ | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
39 int fastq_pair_printf(FASTQ_PAIR *fq_pair, FILE *fp_out1, FILE *fp_out2, | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
40 char *format, long serial); | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
41 | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
42 /* compare the two FASTQ pairs tightly, if identical, return 0, else if a>b, | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
43 * return 1, else if a<b, return -1. */ | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
44 int fastq_pair_compare_tight(FASTQ_PAIR *fq_pair_a, FASTQ_PAIR *fq_pair_b); | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
45 | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
46 /* compare the two FASTQ pairs loosely, if identical, return 0, else if a>b, | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
47 * return 1, else if a<b, return -1. */ | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
48 int fastq_pair_compare_loose(FASTQ_PAIR *fq_pair_a, FASTQ_PAIR *fq_pair_b); | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
49 | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
50 /* return the length of left FASTQ sequence in pair, if any error, return -1. */ | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
51 long fastq_pair_get_left_length(FASTQ_PAIR *fq_pair); | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
52 | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
53 /* return the length of right FASTQ sequence in pair, if any error, return -1. */ | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
54 long fastq_pair_get_right_length(FASTQ_PAIR *fq_pair); | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
55 | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
56 /* return the length of both left and right FASTQ sequence in pair, | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
57 * if any error, return -1. */ | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
58 long fastq_pair_get_total_length(FASTQ_PAIR *fq_pair); | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
59 | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
60 | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
61 | 
