[Biopython-dev] Status of SearchIO

Wibowo Arindrarto w.arindrarto at gmail.com
Sat Oct 27 05:55:27 UTC 2012


>> If the namespace nesting bothers you, then you might not like
>> my thoughts for how to combine Bio.Align and Bio.AlignIO
>> (since we can't use Bio.align due to the folder name clash on
>> case incentive platforms): I was wondering about using
>> Bio.seq.align for this, which again is a bit nested but would
>> make it a system module to Bio.seq.search (aka SearchIO)
>> and Bio.seq.record (which could include the former SeqIO
>> code as well as the SeqRecord class).
>>
> Does that mean we'd have read, write, convert, etc. under Bio.seq.record?
> This is how that API would look:
>
> from Bio.seq import record
> for rec in record.parse("example.fa", "fasta"): ...
>
> As opposed to:
>
> # Minor change
> from Bio import seqio
> for record in seqio.parse(...)
>
> # Make sure we get those relative imports right!
> from Bio.seq import io
> for record in io.parse(...)
>
> # Slight cognitive distance, but maybe worth it
> from Bio import seq
> for record in seq.parse(...)
>
>
> Also: Technically, Bio.Motif operates on multiple sequence alignments, so it
> could be moved to Bio.seq.align.motif. (Not entirely trolling here, just
> pointing out possible consequences.)
>
> -Eric

What bothers me other than it being hidden is also the inconsistency
(comparing it to the current namespace). However, if there is also a
plan to merge sequence-related submodules under Bio.seq, it feels
better and I'm ok with it. Still hidden, but we'll have more
consistency and the root namespace will have less clutter.

So it would look like this (with previously mentioned examples):

Bio.SearchIO -> Bio.seq.search
Bio.AlignIO -> Bio.seq.align
Bio.Motif -> Bio.seq.motif
Bio.SeqIO -> Bio.seq (or merge with Bio.SeqRecord into Bio.seq.record)
Bio.SeqRecord -> Bio.seq.record
Bio.SeqUtils -> Bio.seq.utils
Bio.SeqFeature -> Bio.seq.feature

Also maybe:
Bio.Alphabet -> Bio.seq.alphabet
Bio.Restriction  -> Bio.seq.restriction or Bio.seq.utils.restriction

And Eric is right, we may go further with Bio.seq.align.motif, but I
think nesting sequence-related modules under Bio.seq is the furthest
we should go. I personally find it the most intuitive.

regards,
Bow



More information about the Biopython-dev mailing list