| 1 | #cxx . . $ `<file>/src/scythe.h`/ifndef SCYTHE_H |
| 2 | #define SCYTHE_Hcxx . . $ `src/scythe.h:2:9`! |
| 3 | |
| 4 | #include <zlib.h> |
| 5 | #include "kseq.h"cxx . . $ `<file>/src/kseq.h`/ |
| 6 | |
| 7 | /* KSEQ_INIT() cannot be called here, because we only need the types |
| 8 | defined. Calling KSEQ_INIT() would also define functions, leading |
| 9 | to an unused function warning with GCC. So, the basic typedefs |
| 10 | kseq.h has are included here, and each file that reads needs: |
| 11 | |
| 12 | This was a fix also used in Nik Joshi's Sickle (which I also helped |
| 13 | with) and is the only way I know of dealing with this. |
| 14 | |
| 15 | __KS_GETC(gzread, BUFFER_SIZE) |
| 16 | __KS_GETUNTIL(gzread, BUFFER_SIZE) |
| 17 | __KSEQ_READ |
| 18 | */ |
| 19 | |
| 20 | #define BUFFER_SIZEcxx . . $ `src/scythe.h:20:9`! 4096 |
| 21 | __KS_TYPEcxx . . $ __kstream_t#buf.(gzFile) |
| 22 | __KS_BASICcxx . . $ kstream_t#(gzFile, BUFFER_SIZEcxx . . $ `src/scythe.h:20:9`!) |
| 23 | __KSEQ_TYPEcxx . . $ $anonymous_type_bd94a7007b005cc0_0#comment.(gzFile) |
| 24 | |
| 25 | #define MAX_ADAPTERScxx . . $ `src/scythe.h:25:9`! 1000 |
| 26 | #define MATCH_SCOREcxx . . $ `src/scythe.h:26:9`! 1 |
| 27 | #define MISMATCH_SCOREcxx . . $ `src/scythe.h:27:9`! -1 |
| 28 | |
| 29 | #define IS_FASTQcxx . . $ `src/scythe.h:29:9`!(quality_type) INTEGER(quality_type)[0] >= 0 |
| 30 | #define mincxx . . $ `src/scythe.h:30:9`!(a,b) ((a)>(b)?(b):(a)) |
| 31 | |
| 32 | typedef enumcxx . . $ $anonymous_type_bd94a7007b005cc0_1# { |
| 33 | PHREDcxx . . $ PHRED., |
| 34 | SANGERcxx . . $ SANGER., |
| 35 | SOLEXAcxx . . $ SOLEXA., |
| 36 | ILLUMINAcxx . . $ ILLUMINA. |
| 37 | } quality_typecxx . . $ quality_type#; |
| 38 | |
| 39 | #define Q_OFFSETcxx . . $ `src/scythe.h:39:9`! 0 |
| 40 | #define Q_MINcxx . . $ `src/scythe.h:40:9`! 1 |
| 41 | #define Q_MAXcxx . . $ `src/scythe.h:41:9`! 2 |
| 42 | |
| 43 | /* The quality constants come from: |
| 44 | http://www.biopython.org/DIST/docs/api/Bio.SeqIO.QualityIO-module.html*/ |
| 45 | |
| 46 | static const int quality_contantscxx . . $ quality_contants.[4][3] = { |
| 47 | /* offset, min, max */ |
| 48 | {0, 4, 60}, /* PHRED */ |
| 49 | {33, 0, 93}, /* SANGER */ |
| 50 | {64, -5, 62}, /* SOLEXA, early Illumina (pre-pipeline 1.3) */ |
| 51 | {64, 0, 62} /* ILLUMINA (post-pipeline 1.3) */ |
| 52 | }; |
| 53 | |
| 54 | typedef struct adaptercxx . . $ adapter# { |
| 55 | char *namecxx . . $ adapter#name.; |
| 56 | char *seqcxx . . $ adapter#seq.; |
| 57 | int lengthcxx . . $ adapter#length.; |
| 58 | unsigned int *occurrencescxx . . $ adapter#occurrences.; |
| 59 | } adaptercxx . . $ adapter#; |
| 60 | |
| 61 | typedef struct adapter_arraycxx . . $ adapter_array# { |
| 62 | adaptercxx . . $ adapter# *adapterscxx . . $ adapter_array#adapters.; |
| 63 | int ncxx . . $ adapter_array#n.; |
| 64 | } adapter_arraycxx . . $ adapter_array#; |
| 65 | |
| 66 | typedef struct likelihood_setcxx . . $ likelihood_set# { |
| 67 | double randomcxx . . $ likelihood_set#random.; |
| 68 | double contamcxx . . $ likelihood_set#contam.; |
| 69 | } likelihood_setcxx . . $ likelihood_set#; |
| 70 | |
| 71 | typedef struct posterior_setcxx . . $ posterior_set# { |
| 72 | int is_contamcxx . . $ posterior_set#is_contam.; |
| 73 | double randomcxx . . $ posterior_set#random.; |
| 74 | double contamcxx . . $ posterior_set#contam.; |
| 75 | } posterior_setcxx . . $ posterior_set#; |
| 76 | |
| 77 | typedef struct matchcxx . . $ match# { |
| 78 | int *matchcxx . . $ match#match., *match_poscxx . . $ match#match_pos.; // match positions; TODO simplify |
| 79 | int shiftcxx . . $ match#shift.; // position adapter found, -1 if is_contam is 0 |
| 80 | int lengthcxx . . $ match#length.; // length of adapter contamination, -1 if is_contam is 0 |
| 81 | int scorecxx . . $ match#score.; // match score |
| 82 | int adapter_indexcxx . . $ match#adapter_index.; // index of which adapter was found |
| 83 | float *p_qualscxx . . $ match#p_quals.; // array of qualities convered to probs |
| 84 | posterior_setcxx . . $ posterior_set# *pscxx . . $ match#ps.; // posterior set |
| 85 | } matchcxx . . $ match#; |
| 86 | |
| 87 | /* prob.c prototypes */ |
| 88 | float *qual_to_probscxx . . $ qual_to_probs(a661829a82ca3f60).(const char *, quality_typecxx . . $ quality_type#); |
| 89 | double p_datacxx . . $ p_data(9649a79eb69ac649).(const int *, float *, float, float, int); |
| 90 | posterior_setcxx . . $ posterior_set# *posteriorcxx . . $ posterior(eda8e32dde0ec8a5).(const int *, float *, float, float, int); |
| 91 | likelihood_setcxx . . $ likelihood_set# *likelihoodcxx . . $ likelihood(e837e324fda52277).(const int *, float *, float, int); |
| 92 | |
| 93 | /* util.c prototypes */ |
| 94 | void *xmalloccxx . . $ xmalloc(bfcfa4d6b7f7ef64).(size_t); |
| 95 | adapter_arraycxx . . $ adapter_array# *load_adapterscxx . . $ load_adapters(fb009b0c85c22345).(gzFilecxx . . $ gzFile#); |
| 96 | void destroy_adapterscxx . . $ destroy_adapters(d23ed8633a24bbab).(adapter_arraycxx . . $ adapter_array# *, int); |
| 97 | char *fmt_matchescxx . . $ fmt_matches(fe5a9a6a86af7536).(const char *, const char *, const int *, const int); |
| 98 | void print_float_arraycxx . . $ print_float_array(d97132c3eefc9c07).(const float *, int); |
| 99 | void fprint_float_arraycxx . . $ fprint_float_array(3389e3ecfa0c73b5).(FILEcxx . . $ FILE# *, const float *, int); |
| 100 | void print_int_arraycxx . . $ print_int_array(cfb464fe78c8a83b).(const int *, int); |
| 101 | void print_uint_arraycxx . . $ print_uint_array(23865addb5019587).(const unsigned int *, int); |
| 102 | void fprint_uint_arraycxx . . $ fprint_uint_array(2d8583fd46d1aa71).(FILEcxx . . $ FILE# *, const unsigned int *, int); |
| 103 | extern int sumcxx . . $ sum(1ec4c99060f826b5).(const int *, size_t); |
| 104 | void write_fastqcxx . . $ write_fastq(c1ff00be624d6f38).(FILEcxx . . $ FILE# *, kseq_tcxx . . $ kseq_t# *, int, int, int); |
| 105 | void print_summarycxx . . $ print_summary(a6616d7498bbe84d).(adapter_arraycxx . . $ adapter_array# *, float, int, int, int); |
| 106 | |
| 107 | /* match.c prototypes */ |
| 108 | int *score_sequencecxx . . $ score_sequence(573e900797376e94).(int *, const char *, const char *, size_t); |
| 109 | matchcxx . . $ match# *find_best_matchcxx . . $ find_best_match(745595b130767423).(const adapter_arraycxx . . $ adapter_array# *, const char *, float *, float, float, int); |
| 110 | void print_matchcxx . . $ print_match(a58bc8ea36e4852f).(kseq_tcxx . . $ kseq_t# *, matchcxx . . $ match# *, FILEcxx . . $ FILE# *, const adapter_arraycxx . . $ adapter_array# *, quality_typecxx . . $ quality_type#); |
| 111 | void destroy_matchcxx . . $ destroy_match(972520b2cfa848f0).(matchcxx . . $ match# *); |
| 112 | |
| 113 | |
| 114 | #endif /* SCYTHE_H */ |