[Bioperl-l] counting nucleotides in a sequence

Jason Stajich jason at cgt.mc.duke.edu
Tue Feb 18 20:50:57 EST 2003


Not the fastest way to do it, but this code will get you the sequence
chunks of length 10.
Look at
Bio::Tools::SeqStats for an easy way to calculate the individual nt
frequencies (count_monomers).

my $chunk = 10;
for( my $i = 1; $i < $seq->length; $i+= $chunk) {
 my $subseq = $seq->trunc($i,$i+$chunk-1);
}

-j
On Wed, 19 Feb 2003 parvesh at pacific.net.sg wrote:

> Hello
> I am interested in calculating the nucleotides A,C, G and T
> in my sequence for every 10 nt window.

> So I need to write a code that will scan the sequence for every 10 nts
> like 1-10,11-20. preferably i can then stack the result in arrays and
> write this array to file. Can someone help me to do this using bioperl
> code please ? Thanks in advance for your help!
>
> Best wishes
> Parvesh
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
>

--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu


More information about the Bioperl-l mailing list