cov-lineages / scorpio

serious constellations of reoccurring phylogenetically-independent origin
GNU General Public License v3.0
38 stars 4 forks source link

Bug in scorpio #15

Closed animesh-workplace closed 3 years ago

animesh-workplace commented 3 years ago

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'
razsultana commented 3 years ago

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
rmcolq commented 3 years ago

Bother - I'd tested it on all the pango-designations sequences, but must not have triggered this clause. I'll put in a fix

rmcolq commented 3 years ago

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?

razsultana commented 3 years ago

Hi Rachel, here is a file that breaks it: sequences.fa.zip

mcroxen commented 3 years ago

@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)
rmcolq commented 3 years ago

I've tried again - I think this must be OS/biopython version specific as the example worked fine for me - any better?

razsultana commented 3 years ago
(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
rmcolq commented 3 years ago

I'm on biopython v1.79 and macOS. But I think the fixes I made in v0.3.4 worked

razsultana commented 3 years ago

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