Hi Paul,
by default, the blast() method creates for you an in-memory version of
NLMSA alignment storage (instead of the on-disk version, which
supports persistence). If you want to store the results persistently,
instead create an NLMSA in mode 'w' (i.e. write to disk file) with a
filename of your choosing, and pass that to the blast() method as
follows:
# create NLMSA object like this:
msa = cnestedlist.NLMSA('myfile', mode='w', bidirectional=False) #
create new NLMSA on disk
# save blast results to NLMSA like this, assuming blastdb is a BlastDB
object:
blastdb.blast(s, msa, expmax=1e-10) # GET STRONG HOMOLOGS OF s, SAVE
ALIGNMENT IN msa
# save as many individual blast searches to msa as you want...
# finally, you must manually make the NLMSA build its indexes
msa.build()
You can reload the alignment in subsequent Python sessions either
manually (by simply opening the same NLMSA file in mode 'r'), or by
pickling / upickling the msa object (which is what pygr.Data does).
See the docs (e.g. tutorial) for a full description of this:
http://bioinfo.mbi.ucla.edu/pygr_0_7_b3/seq-align.html#SECTION000132000000000000000
I can see that we need to make a real error message for attempting to
pickle a memory-mode NLMSA. It would be great if you could add that
as a bug report to the issue tracker...
Yours,
Chris
On Dec 21, 2008, at 1:04 PM, Paul Rigor wrote:
>
> Hi,
>
> What is the best strategy for pickling pygr blast results? I receive
> the following error when pickling a python dictionary containing the
> result objects.
>
> File "pygr.cnestedlist.pyx", line 1660, in
> pygr.cnestedlist.NLMSA.__iadd__
> File "/home/dock/shared_libraries/lx64/pkgs/python/2.5.1/lib/
> python2.5/site-packages/pygr/nlmsa_utils.py", line 97, in saveSeq
> File "pygr.cnestedlist.pyx", line 1423, in
> pygr.cnestedlist.NLMSASequence.__iadd__
> AttributeError: 'int' object has no attribute 'pathForward'
>
>
> Thanks,
> Paul
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pygr-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pygr-dev?hl=en
-~----------~----~----~----~------~----~------~--~---