problems with pyfasta extract #5

Closed
ialbert opened this Issue Oct 12, 2011 · 1 comment

Comments

Projects
None yet
2 participants

ialbert commented Oct 12, 2011

I am unable to make pyfasta extract work, it used to work for version 0.3.9. See error below.

Moreover there is a different error if the flat and gdx files are not present to begin with.

Error after running pyfasta info on the sequence:

$ head -1 mini.fasta

chr01

ialbert@airy ~/refs/tmp
$ pyfasta extract --fasta mini.fasta chr01
Traceback (most recent call last):
File "/usr/local/bin/pyfasta", line 8, in
load_entry_point('pyfasta==0.4.3', 'console_scripts', 'pyfasta')()
File "/Library/Python/2.6/site-packages/pyfasta/init.py", line 37, in main
globals()action
File "/Library/Python/2.6/site-packages/pyfasta/init.py", line 133, in extract
seq = f[seqname]
File "/Library/Python/2.6/site-packages/pyfasta/fasta.py", line 112, in getitem
c = self.index[i]
KeyError: None

Second type of error if no flat and gdx files are present when running the pyfasta extract:

$ pyfasta extract --fasta mini.fasta chr01
Traceback (most recent call last):
File "/usr/local/bin/pyfasta", line 8, in
load_entry_point('pyfasta==0.4.3', 'console_scripts', 'pyfasta')()
File "/Library/Python/2.6/site-packages/pyfasta/init.py", line 37, in main
globals()action
File "/Library/Python/2.6/site-packages/pyfasta/init.py", line 126, in extract
f = Fasta(options.fasta, key_fn=key_fn)
File "/Library/Python/2.6/site-packages/pyfasta/fasta.py", line 47, in init
flatten_inplace)
File "/Library/Python/2.6/site-packages/pyfasta/records.py", line 59, in prepare
for i, (seqid, seq) in enumerate(seqinfo_generator):
File "/Library/Python/2.6/site-packages/pyfasta/fasta.py", line 75, in gen_seqs_with_headers
raise DuplicateHeaderException(header)
pyfasta.fasta.DuplicateHeaderException: headers must be unique: None is duplicated

Owner

brentp commented Oct 12, 2011

thanks for reporting. don't know when that happened even.
also uploaded to pypi.

brentp closed this Oct 12, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment