Skip to content

Commit

Permalink
minor tweaks. better examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredo committed Oct 2, 2014
1 parent c81f49e commit 485ef52
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 80 deletions.
Binary file added example/MP_R1.fastq.gz
Binary file not shown.
Binary file added example/MP_R2.fastq.gz
Binary file not shown.
Binary file added example/PE_R1.fastq.gz
Binary file not shown.
Binary file added example/PE_R2.fastq.gz
Binary file not shown.
Binary file added example/UNKNOWN_R1.fastq.gz
Binary file not shown.
Binary file added example/UNKNOWN_R2.fastq.gz
Binary file not shown.
Binary file modified example/sample_R1.fastq.gz
Binary file not shown.
Binary file modified example/sample_R2.fastq.gz
Binary file not shown.
87 changes: 8 additions & 79 deletions matepair.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,6 @@ int matePair::build(readPair& readpair,int minovl,float sim,int ml,bool jr,bool
mp=readPair(readpair.r1.mask(),readpair.r2.window(0,a2));
}
else{

pe.r1 = readpair.r1.window(b1,b1+a2);
pe.r2 = readpair.r2.window(0,a2);
}
Expand All @@ -479,11 +478,17 @@ int matePair::build(readPair& readpair,int minovl,float sim,int ml,bool jr,bool
}
else if(b1<L1 && a2==L2) {
resolve_overhang(readpair.r1,readpair.r2,a1,b1);
if(DEBUG>1) cout << "CASE G"<<endl;
if(DEBUG>1) cout << "CASE G"<<endl;
}
else if(b2<L2 && a1==L1) {
resolve_overhang(readpair.r2,readpair.r1,a2,b2);
if(DEBUG>1) cout << "CASE H"<<endl;
fqread swap1 = pe.r1;
pe.r1 = pe.r2;
pe.r2 = swap1;
fqread swap2 = mp.r1;
mp.r1 = mp.r2;
mp.r2 = swap2;
if(DEBUG>1) cout << "CASE H"<<endl;
}
}
return(0);
Expand Down Expand Up @@ -511,79 +516,3 @@ int nxtrimWriter::write(matePair m) {
n_se+=se_out.write(m.se);
}
}

//LEVENSHTEIN DISTANCE CODE - REMOVED THIS
/*
levenshtein lev1(adapter1);
levenshtein lev2(adapter2);
levenshtein::levenshtein(string s1) {
L1 = s1.size();
this->s1 = s1;
column = new unsigned int[L1+1];
}
int levenshtein::distance(string & s2,int offset,int maxdist,int indel_penalty) {
assert(s2.size()>=s1.size());
if(offset<0)
int L1 = s1.size()+offset;
else if(offset>(int)(s2.size()-s1.size()))
int L1 = s2.size()-offset;
else
int L1 = s1.size();
int L2=L1;
assert(L1<=s1.size() && L2<=s2.size());
int offset1 = offset<0 ? -offset : 0;
offset = offset<0 ? 0:offset;
for(int j = 1; j <= L1; j++)
column[j] = j;
for(int i = 1; i <= L2; i++) {
column[0] = i;
// cout << column[0] << " ";
lastdiag=i-1;
for(int j=1; j <= L1; j++) {
// cout << column[j] << " ";
olddiag = column[j];
column[j] = MIN3(column[j] + 1, column[j-1] + 1, lastdiag + (s1[offset1+j-1] == s2[offset+i-1] ? 0 : 1));
lastdiag = olddiag;
}
if(i>maxdist && column[i]>maxdist) {
column[L1]=L1;
break;
}
// cout << endl;
}
return(column[L1]);
}
//allows for indel errors in adapter (slower)
int partial_match(string & s1,levenshtein & lev,int minoverlap,int maxdist) {
assert(lev.s1.size()<s1.size());
int mini=-1,mind=lev.s1.size();
assert((int)s1.size()>=minoverlap);
int start = -(lev.s1.size()-minoverlap);
int stop = s1.size() - minoverlap;
for(int i=start;i<stop;i++) {
int d;
if(i<0 || i>(int)(s1.size()-lev.s1.size())) d = lev.distance(s1,i,maxdist/2);
else d = lev.distance(s1,i,maxdist);
// cout << i << " " << d << endl;
if(d<mind) {
mini=i;
mind=d;
}
}
if(mind<maxdist)
return(mini);
else
return(s1.size());
}
*/
2 changes: 1 addition & 1 deletion nxtrim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int checkParameters(int argc,char **argv,po::variables_map & vm) {
("justmp", "just creates a the mp/unknown libraries (reads with adapter at the start with be completely N masked)")
("similarity", po::value<float>()->default_value(0.85), "The minimum similarity between strings to be considered a match. Where hamming_distance <= ceiling( (1-similarity) * string_length ) ")
("minoverlap", po::value<int>()->default_value(12), "The minimum overlap to be considered for matching")
("minlength", po::value<int>()->default_value(25), "The minimum read length to output (smaller reads will be filtered)");
("minlength", po::value<int>()->default_value(21), "The minimum read length to output (smaller reads will be filtered)");

po::store(po::parse_command_line(argc, argv, desc), vm);
po::notify(vm);
Expand Down

0 comments on commit 485ef52

Please sign in to comment.