[Bioperl-l] Bio::Tools::SeqStats to count bases

Slym whereverroadgoes at gmail.com
Mon Feb 4 15:39:19 UTC 2013


The result I get is:

Number of bases of type A = 
Number of bases of type C = 
Number of bases of type G = 
Number of bases of type T = 

i.e. There's no expected values. 
Please help!

#! /usr/bin/perl

use Bio::Tools::SeqStats;
use Bio::Seq;

open (FILE, "seq.fasta");
@array = <FILE>;

# Removing first line of fasta

shift (@array);
$array = join('', at array);
open (FILE2, ">>seq2.fasta");
print FILE2 "$array";

$seqobj = Bio::PrimarySeq->new( -file => "sekw2.fasta",
- alphabet => 'dna',);


my $seq_stats = Bio::Tools::SeqStats->new(-seq=>$seqobj);

my $monomer_ref = $seq_stats->count_monomers();

foreach $base (sort keys %$monomer_ref) {
print "Liczba zasad typu ", $base," = ", $monomer_ref{$base},"\n";
}





More information about the Bioperl-l mailing list