# HG changeset patch # User mcharles # Date 1410942008 14400 # Node ID 9074a5104cdd1af5d62e6f4aba0109fe5602b157 # Parent 9332b9da749136e5383715387f6c2fc0044342db Uploaded diff -r 9332b9da7491 -r 9074a5104cdd rapsodyn/PrepareFastqLight.pl --- a/rapsodyn/PrepareFastqLight.pl Thu Sep 11 07:31:20 2014 -0400 +++ b/rapsodyn/PrepareFastqLight.pl Wed Sep 17 04:20:08 2014 -0400 @@ -279,7 +279,8 @@ my $startnoN = 0; my $stopnoN = length($quality)-1; - #print "SEQ :\n$seq\n"; +#print "HEAD:\t$header"; +#print "SEQ:\t$seq\n"; my $chercheN = $seq; my @bad_position; @@ -306,14 +307,18 @@ } my $lengthnoN = $stopnoN - $startnoN + 1; my $seqnoN = substr($seq,$startnoN,$lengthnoN); - #print "$seqnoN\n"; +# print "SEQnoN\t:$seqnoN\n"; +# for (my $i=0;$i<=$#bad_position;$i++){ +# print $bad_position[$i]."\t"; +# } +# print "\n"; if ($lengthnoN >= $MIN_LENGTH){ my $startTrim = $startnoN; my $stopTrim = $stopnoN; my $quality_converted=""; - my @bad_position; + #my @bad_position; my @q = split(//,$quality); #print "QUALITY\n"; @@ -336,10 +341,11 @@ if ($#bad_position>=0){ - # for (my $i=0;$i<=$#bad_position;$i++){ - # print $bad_position[$i]."\t"; - # } - # print "\n"; + @bad_position = sort {$a <=> $b} @bad_position; +# for (my $i=0;$i<=$#bad_position;$i++){ +# print $bad_position[$i]."\t"; +# } +# print "\n"; my %coord=%{&extract_longer_string_coordinates_from_bad_position($startnoN,$stopnoN,\@bad_position)}; $startTrim = $coord{"start"}; $stopTrim = $coord{"stop"}; @@ -356,7 +362,9 @@ $fastq_lines .= substr($seq,$startTrim,$lengthTrim)."\n"; $fastq_lines .= "+\n"; $fastq_lines .= substr($quality,$startTrim,$lengthTrim)."\n"; +# print $fastq_lines; return $fastq_lines; + } else { return "";