5 die "Usage: $0 <in sam.gz> <out sam.gz>\n" if @ARGV<2;
10 open I
, '-|', "/bin/gzip -dc $in" or die "Error opening $in: $!\n";
11 open O
, '|-', "/bin/gzip -9c >$out" or die "Error opening $out: $!\n";
12 open LOG
, '>>', 'pickR1orR2XTUreads.log';
20 my @r1 = split /\t/, $r1;
22 my @r2 = split /\t/, $r2;
23 if (($r1[1] & 0x40) and ($r2[1] & 0x80) and ($r1[0] eq $r2[0])) {
24 print O
$r1,$r2 if ((grep /XT:A:U/, @r1) or (grep /XT:A:U/, @r2));
26 print LOG
"Error!\t$in\t$r1[0]\t$r1[1]\t$r2[0]\t$r2[1]\n";
31 print LOG
"Complete!\t$in\t$out\n";