1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| #!/usr/bin/perl -w -- -*-Perl-*-
my $infile = $ARGV[0];
my $align_fh = new IO::File "<$infile"
or die "Cannot ead aligned file '$infile': $!\n";
my $res = {};
while (my $line = <$align_fh>) {
my ( undef, undef, undef, undef, undef, undef, undef, undef, $seq ) = split( /\t/, $line );
for ( 0 .. 35 ) {
last if ( length($seq) < $_ );
my ($aa) = substr($seq, $_, 1);
$res->{"$_,$aa"}++;
}
}
printf( "%-6s\t%-6s\t%-6s\t%-6s\t%-6s\t%-6s\t%-6s\n", 'Tile', 'Cycle', 'A', 'C', 'G', 'T', 'N' );
for (0..35) {
printf( "%-6s\t%-6s\t%-6s\t%-6s\t%-6s\t%-6s\t%-6s\n", 1, $_, $res->{"$_,A"} || 0, $res->{"$_,C"} || 0, $res->{"$_,G"} || 0 , $res->{"$_,T"} || 0 , $res->{"$_,N"} || 0 );
} |
Partager