From 566f578a6503c095a1bb7dd3d9f8e29ef1179aee Mon Sep 17 00:00:00 2001 From: Nicolas Dierckxsens Date: Thu, 4 May 2017 18:23:25 +0200 Subject: [PATCH] Update and rename NOVOPlasty2.5.8.pl to NOVOPlasty2.5.9.pl --- NOVOPlasty2.5.8.pl => NOVOPlasty2.5.9.pl | 96 ++++++++++++++++++++++-- 1 file changed, 91 insertions(+), 5 deletions(-) rename NOVOPlasty2.5.8.pl => NOVOPlasty2.5.9.pl (99%) diff --git a/NOVOPlasty2.5.8.pl b/NOVOPlasty2.5.9.pl similarity index 99% rename from NOVOPlasty2.5.8.pl rename to NOVOPlasty2.5.9.pl index 313ce01..566add8 100644 --- a/NOVOPlasty2.5.8.pl +++ b/NOVOPlasty2.5.9.pl @@ -341,12 +341,12 @@ print "\n\n-----------------------------------------------"; print "\nNOVOPlasty: The Organelle Assembler\n"; -print "Version 2.5.8\n"; +print "Version 2.5.9\n"; print "Author: Nicolas Dierckxsens, (c) 2015-2016\n"; print "-----------------------------------------------\n\n"; print OUTPUT4 "\n\n-----------------------------------------------"; print OUTPUT4 "\nNOVOPlasty: The Organelle Assembler\n"; -print OUTPUT4 "Version 2.5.8\n"; +print OUTPUT4 "Version 2.5.9\n"; print OUTPUT4 "Author: Nicolas Dierckxsens, (c) 2015-2016\n"; print OUTPUT4 "-----------------------------------------------\n\n"; @@ -1531,6 +1531,7 @@ sub correct my $no_quality_score = substr $thirdLine, 0, 1; my $type_of_file; my $code_before_end = substr $firstLine, -2,1; +my $SRA = ""; if ($code_before_end eq "/" && $firstLine_reverse ne $firstLine) { $type_of_file = '-1'; @@ -1551,9 +1552,23 @@ sub correct { $type_of_file = -length($2)-1; } -elsif($firstLine =~ m/.*\.(1)(\s(\d+)\s.*)$/ && $firstLine_reverse ne $firstLine) +elsif($firstLine =~ m/\S*\.(1)(\s(\d+)\s.*)$/ && $firstLine_reverse ne $firstLine) { - $type_of_file = -length($2)-1; + my $test1 = $3; + if($fifthLine =~ m/\S*\.(1)(\s(\d+)(\s.*))$/ && $firstLine_reverse ne $firstLine) + { + my $test2 = $3; + if ($test2 eq $test1) + { + $type_of_file = -length($2)-1; + } + else + { + $type_of_file = -length($4); + $SRA = "yes"; + } + } + print "TEST\n"; } elsif($fifthLine =~ m/.*\.(1)(\s(.+)\s.+)$/ && $firstLine_reverse ne $firstLine) { @@ -1607,7 +1622,7 @@ sub correct print OUTPUT4 "\n\n-----------------------------------------------"; print OUTPUT4 "\nNOVOPlasty: The Organelle Assembler\n"; -print OUTPUT4 "Version 2.5.8\n"; +print OUTPUT4 "Version 2.5.9\n"; print OUTPUT4 "Author: Nicolas Dierckxsens, (c) 2015-2016\n"; print OUTPUT4 "-----------------------------------------------\n\n"; @@ -1755,6 +1770,15 @@ sub correct } my $code2 = $code; my $code_end = substr $code2, $type_of_file,1; + my $code0_SRA; + + if ($SRA eq "yes") + { + my $code_SRA = substr $code2, 0, $type_of_file; + my @code_SRA = split / /, $code_SRA; + $code0_SRA = $code_SRA[0]; + $code_end = substr $code0_SRA, -1, 1, ""; + } if ($type_of_file eq "identical") { @@ -1778,6 +1802,10 @@ sub correct if ($code_end eq "1" && $out_of_memory ne "yes") { my $code0 = substr $code2, 0, $type_of_file; + if ($SRA eq "yes") + { + $code0 = $code0_SRA; + } if ($type_of_file eq "identical") { @@ -1804,6 +1832,10 @@ sub correct if ($code_end eq "2" ) { my $code1 = substr $code2, 0, $type_of_file; + if ($SRA eq "yes") + { + $code1 = $code0_SRA; + } if ($type_of_file eq "identical") { @@ -7197,6 +7229,19 @@ sub correct $filter_before4_pair{$search} = $found_tmp; $before4B{$search} = $found_tmp; } + if ($save_reads eq "yes") + { + my $add_read = $search_tmp; + print OUTPUT10 ">".$add_read."\/1\n"; + print OUTPUT11 ">".$add_read."\/2\n"; + if (exists($hash{$add_read})) + { + my @add_read = split /,/,$hash{$add_read}; + print OUTPUT10 $add_read[0]."\n"; + print OUTPUT11 $add_read[1]."\n"; + } + } + } } } @@ -7337,6 +7382,19 @@ sub correct my $found_rev2 = reverse($found_rev); $repetitive_pair{$found_rev2} = $search_rev; } + if ($save_reads eq "yes") + { + my $add_read = $search_tmp; + print OUTPUT10 ">".$add_read."\/1\n"; + print OUTPUT11 ">".$add_read."\/2\n"; + if (exists($hash{$add_read})) + { + my @add_read = split /,/,$hash{$add_read}; + print OUTPUT10 $add_read[0]."\n"; + print OUTPUT11 $add_read[1]."\n"; + } + } + } } } @@ -8952,6 +9010,7 @@ sub correct $best_extension = ""; goto BACK; } + $noforward{$id} = "stop"; } } @@ -9773,6 +9832,7 @@ sub correct delete $yuyu_option{$id.'C'}; delete $yuyu_option{$id.'T'}; delete $yuyu_option{$id.'G'}; + delete $before_shorter_skip{$id}; } $use_regex = ""; if ($SNR_read ne "" && $last_chance eq "yes") @@ -12084,6 +12144,18 @@ sub correct } $before4B{$search} = $found_reverse; } + if ($save_reads eq "yes") + { + my $add_read = $search_tmp; + print OUTPUT10 ">".$add_read."\/1\n"; + print OUTPUT11 ">".$add_read."\/2\n"; + if (exists($hash{$add_read})) + { + my @add_read = split /,/,$hash{$add_read}; + print OUTPUT10 $add_read[0]."\n"; + print OUTPUT11 $add_read[1]."\n"; + } + } } } } @@ -12207,6 +12279,19 @@ sub correct $filter_before4_pair{$search} = $found_new; $before4F{$search} = $found_new; } + if ($save_reads eq "yes") + { + my $add_read = $search_tmp; + print OUTPUT10 ">".$add_read."\/1\n"; + print OUTPUT11 ">".$add_read."\/2\n"; + if (exists($hash{$add_read})) + { + my @add_read = split /,/,$hash{$add_read}; + print OUTPUT10 $add_read[0]."\n"; + print OUTPUT11 $add_read[1]."\n"; + } + } + } } } @@ -13739,6 +13824,7 @@ sub correct delete $yuyu_option_back{$id.'C'}; delete $yuyu_option_back{$id.'T'}; delete $yuyu_option_back{$id.'G'}; + delete $before_shorter_skip_back{$id}; } if ($split eq "") {