Skip to content

Changes to use of constant namedb and seq files#7

Open
RamRS wants to merge 3 commits intoctb:masterfrom
RamRS:master
Open

Changes to use of constant namedb and seq files#7
RamRS wants to merge 3 commits intoctb:masterfrom
RamRS:master

Conversation

@RamRS
Copy link

@RamRS RamRS commented Aug 25, 2013

These are changes that override the changes from the previous commit/pull-request. Changes have been made in the way objects are pickled and unpickled, and also in the use of CMD line args.

Ram

RamRS added 2 commits August 23, 2013 14:35
…ia command line to annotate-seqs.py

mouse.namedb, mouse.namedb.fullname and mouse.protein.faa were hardcoded into namedb.py.
Now, it picks up from sys.argv[4] and sys.argv[5], where sys.argv is supplied to
annotate-seqs.py

Possible regression bugs if namedb.py is used by scripts other than annotate-seqs.py
that use a different command line argument pattern
file and constant namedb files

make-namedb changed to pickle into constant names.db and fullnames.db
files, and pickle sequence filename into names.db. namedb.py modified to
unpickle correspondingly. Lines expecting extra CMD line args in
annotate-seqs removed.
make-namedb.py Outdated
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two comments --

since sys.argv[1] is now used twice in the script (and in any case I wrote it badly in the first place), please set a variable to the value at the top, and then reuse the variable down here. I guess something like 'seqfile = sys.argv[1]'.

second, you don't need to create a dict and then populate it and then dump it. Just do

dump(seqfile, fp)
dump(names, fp)

following which you can do

seqfile = load(fp)
names = load(fp)

This also eliminates the use of 'get' below...

dict() used in previous commit has been removed, sequential calls to
dump() and load() are used instead. A variable 'seqFile' id used to
store sequence file name from CMD line args.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants