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