1002 |
|
int wlen=rlen; |
1003 |
|
GXSeqData seqdata; |
1004 |
|
int numruns=revCompl ? 2 : 1; |
1005 |
+ |
GList<GXAlnInfo> bestalns(true, true, false); |
1006 |
|
for (int ai=0;ai<adaptors5.Count();ai++) { |
1007 |
|
for (int r=0;r<numruns;r++) { |
1008 |
|
if (r) { |
1015 |
|
} |
1016 |
|
GXAlnInfo* aln=match_adaptor(seqdata, adaptors5[ai].trim_type, gxmem_l, 90); |
1017 |
|
if (aln) { |
1018 |
< |
trimmed=true; |
1018 |
> |
if (aln->strong) { |
1019 |
> |
trimmed=true; |
1020 |
> |
bestalns.Add(aln); |
1021 |
> |
break; //will check the rest next time |
1022 |
> |
} |
1023 |
> |
else bestalns.Add(aln); |
1024 |
> |
} |
1025 |
> |
} //forward and reverse? |
1026 |
> |
if (trimmed) break; //will check the rest in the next cycle |
1027 |
> |
}//for each 5' adaptor |
1028 |
> |
if (bestalns.Count()>0) { |
1029 |
> |
GXAlnInfo* aln=bestalns[0]; |
1030 |
|
if (aln->sl-1 > wlen-aln->sr) { |
1031 |
|
//keep left side |
1032 |
|
l3-=(wlen-aln->sl+1); |
1036 |
|
l5+=aln->sr; |
1037 |
|
if (l5>=rlen) l5=rlen-1; |
1038 |
|
} |
1039 |
< |
delete aln; |
1040 |
< |
if (l3-l5+1<min_read_len) return true; |
1039 |
> |
//delete aln; |
1040 |
> |
//if (l3-l5+1<min_read_len) return true; |
1041 |
|
wseq=seq.substr(l5,l3-l5+1); |
1042 |
|
wlen=wseq.length(); |
1043 |
< |
} |
1044 |
< |
} //forward and reverse? |
1045 |
< |
}//for each 5' adaptor |
1034 |
< |
return trimmed; |
1043 |
> |
return true; //break the loops here to report a good find |
1044 |
> |
} |
1045 |
> |
return false; |
1046 |
|
} |
1047 |
|
|
1048 |
|
//convert qvs to/from phred64 from/to phread33 |