[Biopython-dev] Sequences and simple plots

Peter biopython at maubp.freeserve.co.uk
Fri Sep 26 12:28:30 EDT 2008


>> 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))
>
> ?

I spotted that after posting.  Whoops.  Your suggestion would work,
but I'd rather keep the old full title (partly so I don't have to redo
the PNG file in CVS and on the website).

Did you try the dot-plot example?

Did you have any other ideas for things to plot?

Peter


More information about the Biopython-dev mailing list