Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Mumps accession parsing throwing an error #16

Open
trvrb opened this issue Apr 10, 2018 · 1 comment
Open

Mumps accession parsing throwing an error #16

trvrb opened this issue Apr 10, 2018 · 1 comment
Assignees

Comments

@trvrb
Copy link
Member

trvrb commented Apr 10, 2018

Trying to parse the mumps accession list throws an error. Reproduce by running:

python src/run.py --files input/accessions_mumps.txt --outfile output/mumps.json --pathogen mumps

This produces the following error:

Traceback (most recent call last):
  File "src/run.py", line 95, in <module>
    main(args, logger)
  File "src/run.py", line 75, in main
    dataset.clean_clusters()
  File "/Users/trvrb/Documents/src/sacra/src/dataset.py", line 435, in clean_clusters
    [c.clean() for c in self.clusters]
  File "/Users/trvrb/Documents/src/sacra/src/cluster.py", line 82, in clean
    [unit.fix() for unit in self.get_all_units()]
  File "/Users/trvrb/Documents/src/sacra/src/unit.py", line 27, in fix
    self.fix_single(name)
  File "/Users/trvrb/Documents/src/sacra/src/unit.py", line 22, in fix_single
    setattr(self, name, self.CONFIG["fix_functions"][name](self, None, logger))
  File "src/utils/fix_functions.py", line 29, in sample_name
    obj.fix_single("collection_date")
  File "/Users/trvrb/Documents/src/sacra/src/unit.py", line 22, in fix_single
    setattr(self, name, self.CONFIG["fix_functions"][name](self, None, logger))
  File "src/utils/fix_functions.py", line 67, in collection_date
    if lookups["strain_name_to_date"] is not None and sample.parent.strain_name in lookups["strain_name_to_date"]:
AttributeError: 'Strain' object has no attribute 'strain_name'

I believe we found this before and it relates to Genbank entries that lack strain because the field is called isolate.

accessions_mumps.txt

@barneypotter24
Copy link
Contributor

I believe this issue has the same root as #17, in that there is some variance in the field names provided by genbank that we do not currently account for.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants