ialbert / bio

Making bioinformatics fun again

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to run bio gff command

lcdorman opened this issue · comments

Whenever I run the following command (tried with multiple different genomes including NC_001474.2, MN996532 NC_045512, NC_048217.1), I get the following error: AttributeError: 'SeqFeature' object has no attribute 'strand'
Command:

bio fetch NC_048217.1 > MHV_genomes.gb
bio gff MHV_genomes.gb | head -5

I installed bio using pip inside a new conda environment, and it installed versions: bio-1.6.0 biopython-1.82 biothings-client-0.3.1

Error:
Traceback (most recent call last):
File "/home/leah.dorman/.conda/envs/gff/bin/bio", line 8, in
sys.exit(run())
^^^^^
File "/home/leah.dorman/.conda/envs/gff/lib/python3.11/site-packages/biorun/main.py", line 14, in run
router()
File "/home/leah.dorman/.conda/envs/gff/lib/python3.11/site-packages/biorun/main.py", line 130, in wrapper
func(args, **kwargs)
File "/home/leah.dorman/.conda/envs/gff/lib/python3.11/site-packages/biorun/main.py", line 202, in router
plac.call(func)
File "/home/leah.dorman/.conda/envs/gff/lib/python3.11/site-packages/biorun/libs/placlib.py", line 440, in call
cmd, result = parser.consume(arglist)
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/leah.dorman/.conda/envs/gff/lib/python3.11/site-packages/biorun/libs/placlib.py", line 291, in consume
return cmd, self.func(
(args + varargs + extraopts), **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/leah.dorman/.conda/envs/gff/lib/python3.11/site-packages/biorun/gff.py", line 17, in run
convert.run(start=start, end=end, type_=type_, match=match, id_=id_, gene=gene, rename=rename, olap=olap, fasta=False, fnames=fnames)
File "/home/leah.dorman/.conda/envs/gff/lib/python3.11/site-packages/biorun/convert.py", line 406, in run
recs = parser.get_records(fnames)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/leah.dorman/.conda/envs/gff/lib/python3.11/site-packages/biorun/parser.py", line 426, in get_records
recs = flatten(recs)
^^^^^^^^^^^^^
File "/home/leah.dorman/.conda/envs/gff/lib/python3.11/site-packages/biorun/parser.py", line 215, in flatten
return functools.reduce(operator.iconcat, nested, [])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/leah.dorman/.conda/envs/gff/lib/python3.11/site-packages/biorun/parser.py", line 396, in record_generator
brec.strand = feat.strand
^^^^^^^^^^^
AttributeError: 'SeqFeature' object has no attribute 'strand'

Looks like biopython broke its internal API, I will make a new release of bio pinned to an earlier version of biopython

in the meantime

pip install biopython==1.81

should roll back bio to a compatible version of biopython

Thank you! biopython 1.81 fixed the problem.