griffithlab / civicpy

A python interface for the CIViC db application
MIT License
8 stars 5 forks source link

run erro #64

Closed fanyucai1 closed 4 years ago

fanyucai1 commented 4 years ago

hi doctor, my script as follows: ################################## from civicpy import civic, exports with open('civic_variants.vcf', 'w', newline='') as file: w = exports.VCFWriter(file) all_variants = civic.get_all_variants() w.addrecords(all_variants) w.writerecords() ###########################the erro: Traceback (most recent call last): File "VEP.py", line 1, in from civicpy import civic, exports ImportError: cannot import name 'exports'

what should I do?

ahwagner commented 4 years ago

Hi @fanyucai1. Would you kindly provide us with the version of CIViCpy you are using that produced this error?

fanyucai1 commented 4 years ago

hi doctor, I change my python from 3.6 to 3.7. The erro changed as follows: WARNING:root:Getting all genes. This may take a couple of minutes... Traceback (most recent call last): File "test.py", line 6, in w.addrecords(all_variants) File "/usr/local/lib/python3.7/site-packages/civicpy/exports.py", line 122, in addrecords self.addrecord(record) File "/usr/local/lib/python3.7/site-packages/civicpy/exports.py", line 112, in addrecord self.addrecord(evidence) File "/usr/local/lib/python3.7/site-packages/civicpy/exports.py", line 114, in addrecord valid = self._validate_evidence_record(civic_record) File "/usr/local/lib/python3.7/site-packages/civicpy/exports.py", line 235, in _validate_evidence_record valid = self._validate_sequence_variant(variant) File "/usr/local/lib/python3.7/site-packages/civicpy/exports.py", line 272, in _validate_sequence_variant valid = self._validate_coordinates(variant, types) File "/usr/local/lib/python3.7/site-packages/civicpy/exports.py", line 332, in _validate_coordinates raise NotImplementedError(f'No logic to handle {variant_type.name} {variant}') NotImplementedError: No logic to handle transcript_fusion <CIViC variant 2663> ##################### what should I do?

ahwagner commented 4 years ago

To help you troubleshoot this problem, please provide the version of CIViCpy that you are using. You may find this by using pip freeze | grep civicpy in your shell.

fanyucai1 commented 4 years ago

civicpy==0.0.3.post1

susannasiebert commented 4 years ago

Please upgrade to version 1.0.0rc2 by running pip install civicpy==1.0.0rc2.

fanyucai1 commented 4 years ago

the erro as follows: Traceback (most recent call last): File "get_civicpy.py", line 5, in all_variants = civic.get_all_variants() File "/usr/local/lib/python3.7/site-packages/civicpy/civic.py", line 820, in get_all_variants variants = _get_elements_by_ids('variant', allow_cached=allow_cached, get_all=True) File "/usr/local/lib/python3.7/site-packages/civicpy/civic.py", line 661, in _get_elements_by_ids load_cache() File "/usr/local/lib/python3.7/site-packages/civicpy/civic.py", line 168, in load_cache old_cache = pickle.load(pf) _pickle.UnpicklingError: pickle data was truncated

fanyucai1 commented 4 years ago

I find one file called: cache.pkl,where can I download this file?

ahwagner commented 4 years ago

Closing this issue; stale. For reference, a fresh cache.pkl file should be automatically grabbed from live CIViC in civicpy v1.0 and above.