* more robust to truncated soap output
#!/usr/bin/perl -w
# Contact: lh3
#!/usr/bin/perl -w
# Contact: lh3
use strict;
use warnings;
use strict;
use warnings;
my @s2 = ();
my ($s_last, $s_curr) = (\@s1, \@s2);
while (<>) {
my @s2 = ();
my ($s_last, $s_curr) = (\@s1, \@s2);
while (<>) {
- &soap2sam_aux($_, $s_curr, $is_paired);
+ next if (&soap2sam_aux($_, $s_curr, $is_paired) < 0);
if (@$s_last != 0 && $s_last->[0] eq $s_curr->[0]) {
&mating($s_last, $s_curr);
print join("\t", @$s_last), "\n";
if (@$s_last != 0 && $s_last->[0] eq $s_curr->[0]) {
&mating($s_last, $s_curr);
print join("\t", @$s_last), "\n";
my ($line, $s, $is_paired) = @_;
chomp($line);
my @t = split("\t", $line);
my ($line, $s, $is_paired) = @_;
chomp($line);
my @t = split("\t", $line);
@$s = ();
# read name
$s->[0] = $t[0];
@$s = ();
# read name
$s->[0] = $t[0];
$md = length($t[1]);
}
push(@$s, "MD:Z:$md");
$md = length($t[1]);
}
push(@$s, "MD:Z:$md");