forked from sequencing/NxTrim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
matepair.h
executable file
·60 lines (53 loc) · 1.93 KB
/
matepair.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#pragma once
#include "fastqlib.h"
#include "math.h"
#include "stdint.h"
int hamming(string & s1,string & s2,int offset1,int offset2,int L,int maxd);
int overlap(string & s1,string & s2,int minoverlap,float similarity);
int partial_match(string & s1,string & a,int minoverlap,int maxdist);
int findAdapter(string & s,int minoverlap,float similarity,bool hamming);
class levenshtein {
public:
levenshtein(string s1);
~levenshtein() {delete column;}
unsigned int *column;
unsigned int i, j, lastdiag, olddiag;
unsigned int L1,L2;
string s1;
int distance(string & s2,int offset,int maxdist,int indel_penalty=2);
};
class matePair {
public:
matePair(readPair & readpair,int minoverlap,float similarity,int minlen,bool joinreads,bool use_hamming,bool preserve_mp,bool jjmp);
matePair();
int build(readPair & readpair,int minoverlap,float similarity,int minlen,bool joinreads,bool use_hamming,bool preserve_mp,bool jjmp);
int clear();
int trimUnknown();
bool trimExternal(readPair & rp);
int joinReads(fqread & r1,fqread & r2,fqread & output);
bool joinreads,use_hamming,preserve_mp,_justmp;
fqread se;
readPair mp,pe,unknown;
int resolve_overhang(fqread & r1, fqread & r2,int a,int b);
unsigned int ham_align(string & s1,string & s2);
int minoverlap, minlen;
float similarity;
};
//handles the output for nxtrim (which reads go to which file etc)
class nxtrimWriter {
public:
nxtrimWriter();
nxtrimWriter(string prefix,bool jmp,bool separate_read_files=false);
int open(string prefix,bool jmp,bool separate_read_files);
int open();
bool setMP(bool val) {_write_mp=val;return(_write_mp);}
bool setUN(bool val) {_write_un=val;return(_write_un);}
int write(matePair m);
int weird,n_mp,n_unk,n_se,n_pe;//counts for each virtual library
bool _justmp,_write_mp,_write_se,_write_pe,_write_un;
bool print_to_stdout;
pairWriter mp_out;
pairWriter pe_out;
pairWriter unknown_out;
fastqWriter se_out;
};