[pygr-notify] Issue 34 in pygr: Refactor BLAST support as a mapping

codesite-noreply at google.com codesite-noreply at google.com
Mon Dec 15 13:41:42 PST 2008


Comment #1 on issue 34 by cjlee112: Refactor BLAST support as a mapping
http://code.google.com/p/pygr/issues/detail?id=34

proposal: treat BLAST functionality as a mapping, just like any other Pygr  
mapping.
That means a graph-like interface, i.e.

for target in blastmap[myquery]:
     do something...

or

for src,target,edge in blastmap[myquery].edges():
     do something...

Seems like this would be adequate for most uses...
This usage implies the blastdb.__getitem__() returns not an
NLMSA but instead an NLMSASlice.  If we go this route, we could
easily add a property to the NLMSASlice that gets the original
NLMSA, allowing the user to requery with subintervals of the original
query sequence.  Seems like a reasonable idea.

If you want to use BlastDB in the usual way, e.g. to store many
different blast results in one NLMSA, just use the blast() method
in the old way.  That preserves flexibility.

The major change to the BlastDB class is that it becomes a wrapper
instead of a subclass of SequenceFileDB.  Its __getitem__() stops
acting as a database id lookup, and turns into a mapping of a query
sequence to its homologs as outlined above.

This raises an interesting schema representation issue: this doesn't
conform to a strict sourceDB -> targetDB schema.  Instead it maps
<any sequence> -> targetDB.  How will we represent that in pygr.Data
schema?

Interface change: if you have a sequence DB you create a mapping
object by constructing the appropriate mapping, e.g.

blastmap = BlastMapping(seqDB)

Now you use it either in the mapping style:

for src,target,edge in blastmap[myquery].edges():
     do something...

or you use it as a callable...

for myquery in lotsaQueries:
     blastmap(myquery, al=myNLMSA)
myNLMSA.build()

Seems pretty straightforward.


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings



More information about the pygr-notify mailing list