Bug in scorpio
Closed this issue · 9 comments
Got the following error today after updating pangolin and all its dependencies
Parsing constellation JSON file /home/insacog/Installed_Package/anaconda3/envs/python_3.9/lib/python3.9/site-packages/constellations/definitions/cB.1.526.json
Found file /home/insacog/Installed_Package/anaconda3/envs/python_3.9/lib/python3.9/site-packages/constellations/definitions/cB.1.526.json for constellation Iota (B.1.526-like) containing 19 variants
Rules {'min_alt': 11, 'max_ref': 3}
Traceback (most recent call last):
File "/home/insacog/Installed_Package/anaconda3/envs/python_3.9/bin/scorpio", line 8, in <module>
sys.exit(main())
File "/home/insacog/Installed_Package/anaconda3/envs/python_3.9/lib/python3.9/site-packages/scorpio/__main__.py", line 227, in main
args.func(args)
File "/home/insacog/Installed_Package/anaconda3/envs/python_3.9/lib/python3.9/site-packages/scorpio/subcommands/classify.py", line 7, in run
classify_constellations(options.input,
File "/home/insacog/Installed_Package/anaconda3/envs/python_3.9/lib/python3.9/site-packages/scorpio/scripts/type_constellations.py", line 657, in classify_constellations
counts, call = count_and_classify(record.seq,
File "/home/insacog/Installed_Package/anaconda3/envs/python_3.9/lib/python3.9/site-packages/scorpio/scripts/type_constellations.py", line 516, in count_and_classify
call, query_allele = call_variant_from_fasta(record_seq, var)
File "/home/insacog/Installed_Package/anaconda3/envs/python_3.9/lib/python3.9/site-packages/scorpio/scripts/type_constellations.py", line 425, in call_variant_from_fasta
query = query_allele.replace("-","")
AttributeError: 'Seq' object has no attribute 'replace'
Had the same issue.
Quick workaround:
If you update pangolin from github and use conda, you might be stuck with an usable pangolin, unless you downgrade scorpio:
in the pangolin source directory edit the line in environment.yml
that specifies scorpio like this:
- git+https://github.com/cov-lineages/scorpio.git@v0.3.1
update the conda environment like this:
conda env update -f environment.yml
Bother - I'd tested it on all the pango-designations sequences, but must not have triggered this clause. I'll put in a fix
Given how bad broken pangolin is, I've created a new release that should theoretically fix this. If either of you is able to check that would be awesome as I've not been able to replicate the issue here - or provide an example which should definitely break it?
Hi Rachel, here is a file that breaks it:
sequences.fa.zip
@rmcolq still broken
pangolin already latest release (v3.1.4)
pangolearn already latest release (2021-06-15)
constellations already latest release (v0.0.9)
scorpio already latest release (v0.3.3)
pango-designation already latest release (v1.2.22)
I've tried again - I think this must be OS/biopython version specific as the example worked fine for me - any better?
(pangolin) rsultana@biocomp1:/opt/apps/pangolin$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic
(base) rsultana@biocomp1:~$ conda activate pangolin
(pangolin) rsultana@biocomp1:~$ conda list|grep biopython
biopython 1.74 py37h516909a_0 conda-forge
I'm on biopython v1.79 and macOS. But I think the fixes I made in v0.3.4 worked
Confirming the changes to scorpio (v0.3.4) have eliminated the bug.
The sequences file provided above was for triggering the error with scorpio v0.3.2