Hello,

As I mentioned recently, I was about to reduce the amount of output
which the megatests have begun producing as a side effect of having
been migrated to the new testing framework. Originally there were two
types of redundant warnings:

 - complaints about the ambiguity of opening Collection objects in mode
'c', which could be fixed easily by changing the mode to 'cr';

 - the following, produced when cnestedlist.NLMSA objects are created
(see e.g. tests/pairwise_hg18_megatest.py:103):

"
Note: the NLMSA.seqDict was not saved to a file.
This is not necessary if you intend to save the NLMSA to worldbase.
But if you wish to open this NLMSA independently of worldbase,
you should call NLMSA.save_seq_dict() to save the seqDict info to a
file, or in the future pass the saveSeqDict=True option to
NLMSA.build().

To turn off this message, use the verbose=False option
"

It is the latter that has been giving me trouble - maybe I'm just very
stupid today but I cannot figure out how to pass verbose=False or
saveSeqDict=True to the function that triggers this warning, without
modifying cnestedlist.pyx... The problem as I see it is as follows:

 - the warning is produced by NLMSA.buildFiles(), which recognises both
saveSeqDict and verbose and sets them by default to False and True,
respectively. This method in turn is called by NLMSA.build(), which
doesn't recognise these options but both takes **kwargs and passes it
to buildFiles();

 - depending on the constructor's parameters, there are
three ways NLMSA.build() can be called:
        NLMSA.__init__() -> NLMSA.readMAFfiles() -> NLMSA.build()
        NLMSA.__init__() -> NLMSA.readAxtNet() -> NLMSA.build()
        NLMSA.__init__() -> NLMSA.build()

Then again, regardless of the scenario build() is *always* called with
no parameters whatsoever! Therefore, unless I've missed something here,
NLMSA.buildFiles() will always be called with its default values of
saveSeqDict and verbose.

My first thought here was that it is necessary to pass **kwargs to
NLMSA.build() wherever it is called; the commit

http://github.com/mkszuba/pygr/commit/f3bbb0cb7d751885f34b1604ac155ab74a514e08

in my "megatests" branch does just that. Unfortunately, this is not the
end of the story: NLMSA.__init__() already passes its **kwargs to the
nlmsa_utils.NLMSASeqDict constructor, which accepts only a specific
list of keywords and in effect bombs out on either saveSeqDict or
verbose. Does this mean we need to have that one accept **kwargs too?
Yet another patch:

http://github.com/mkszuba/pygr/commit/19e734fe9b5fe13f7bb0e44a416bf0b248e8bcfa

in the "megatests" branch implements this change, then again frankly
speaking it feels rather inelegant to me. I mean, one huge list of
keywords passed to different functions? Isn't this highly wasteful? Or
does Python somehow optimise the process? Please let me know whether
this is indeed the way to go, and if it is not what alternatives we
should employ.

Cheers,
-- 
MS

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to