hi, when I use fq_all2std.pl in MAQ to convert prb and seq files into a fastq file, i do not understand this line " if (($_&0x3) == 3)" in the follow script.
since the prb file is just like this " -40 -40 40 -40 40 -40 -40 -40 40 -40 -40 -40 -40 -40 40 -40 40 -40 -40 -40 -40 -40 40 -40 -40 -40 40 -40 40 -40 -40 -40 -40 -40 40 -40 40 -40 -40 -40 -40 -40 -40 40 40 -40 -40 -40 40 -40 -40 -40 40 -40 -40 -40 -40 -40 -40 40 40 -40 -40 -40 40 -40 -40 -40 40 -40 -40 -40 40 -40 -40 -40 -40 40 -40 -40 -40 -40 -40 40 -40 40 -40 -40 40 -40 -40 -40 40 -40 -40 -40 40 -40 -40 -40 40 -40 -40 -40 -40 -40 -40 40 40 -40 -40 -40 -40 40 -40 -40 40 -40 -40 -40 -40 -40 40 -40 -40 40 -40 -40 -40 -40 -40 40 -40 -40 40 -40 40 -40 -40 -40 12 -12 -40 -40
" and each four number is parted by tab
####################################
sub seqprb2std {
die("Usage: fq_all2std.pl seqprb2std <in.seq.txt> <in.prb.txt>\n") if (@ARGV != 2);
my ($fhs, $fhq);
open($fhs, $ARGV[0]) || die;
open($fhq, $ARGV[1]) || die;
while (<$fhs>) {
my @t = split;
my $name = join(":", @t[0..3]);
$t[4] =~ tr/./N/;
print "\@$name\n$t[4]\n+\n";
$_ = <$fhq>;
@t = split;
my $q = '';
my $max = -100;
for (0 .. $#t) {
$max = $t[$_] if ($t[$_] > $max);
if (($_&0x3) == 3) {
$q .= $conv_table[$max+64];
$max = -100;
}
}
print "$q\n";
}
close($fhs); close($fhq);
}
since the prb file is just like this " -40 -40 40 -40 40 -40 -40 -40 40 -40 -40 -40 -40 -40 40 -40 40 -40 -40 -40 -40 -40 40 -40 -40 -40 40 -40 40 -40 -40 -40 -40 -40 40 -40 40 -40 -40 -40 -40 -40 -40 40 40 -40 -40 -40 40 -40 -40 -40 40 -40 -40 -40 -40 -40 -40 40 40 -40 -40 -40 40 -40 -40 -40 40 -40 -40 -40 40 -40 -40 -40 -40 40 -40 -40 -40 -40 -40 40 -40 40 -40 -40 40 -40 -40 -40 40 -40 -40 -40 40 -40 -40 -40 40 -40 -40 -40 -40 -40 -40 40 40 -40 -40 -40 -40 40 -40 -40 40 -40 -40 -40 -40 -40 40 -40 -40 40 -40 -40 -40 -40 -40 40 -40 -40 40 -40 40 -40 -40 -40 12 -12 -40 -40
" and each four number is parted by tab
####################################
sub seqprb2std {
die("Usage: fq_all2std.pl seqprb2std <in.seq.txt> <in.prb.txt>\n") if (@ARGV != 2);
my ($fhs, $fhq);
open($fhs, $ARGV[0]) || die;
open($fhq, $ARGV[1]) || die;
while (<$fhs>) {
my @t = split;
my $name = join(":", @t[0..3]);
$t[4] =~ tr/./N/;
print "\@$name\n$t[4]\n+\n";
$_ = <$fhq>;
@t = split;
my $q = '';
my $max = -100;
for (0 .. $#t) {
$max = $t[$_] if ($t[$_] > $max);
if (($_&0x3) == 3) {
$q .= $conv_table[$max+64];
$max = -100;
}
}
print "$q\n";
}
close($fhs); close($fhq);
}