[Biopython-dev] Sequences and simple plots

Jared Flatow jflatow at northwestern.edu
Fri Sep 26 16:23:14 UTC 2008


On Sep 26, 2008, at 11:11 AM, Peter wrote:

> I see what you mean - and maybe that is more realistic.
>
> One change I'd make is avoiding using seq or seqs are variable names
> for SeqRecord objects.  I've generally tried to use record and  
> records in
> the documentation.

Yeah, I agree I was just being lazy.

> i.e. maybe like this:
>
> import pylab
> from Bio import SeqIO
> records = list(SeqIO.parse(open("ls_orchid.fasta"), "fasta")
>
> #Histogram of lengths
> pylab.hist([len(record) for records in records], bins=20)
> pylab.title("%i orchid sequences\nLengths %i to %i" \
>      % (len(sizes),min(sizes),max(sizes)))
> pylab.xlabel("Sequence length (bp)")
> pylab.ylabel("Count")
> pylab.show()

Except the title no longer works the same...maybe just:

pylab.title("Distribution of lengths of %i orchid sequences" %  
len(records))

?

jared





More information about the Biopython-dev mailing list