getzlab / SignatureAnalyzer

Updated SignatureAnalyzer-GPU with mutational spectra & RNA expression compatibility.
MIT License
71 stars 21 forks source link

KeyError when using cosmic3_SBS #38

Closed YingYa closed 2 years ago

YingYa commented 2 years ago

I'm getting an error when running signatureanalyzer with the cosmic3_SBS reference. The full command I run is signatureanalyzer -t maf -n 100 -o ./cosmic3_SBS --reference cosmic3 --hg_build /path/to/Homo_sapiens_assembly38.2bit --objective poisson --max_iter 300000 --prior_on_H L1 --prior_on_W L1 --random_seed 12345 ./test.maf.gz

The error message is: Traceback (most recent call last): File "//share/app/python/3.9.4/lib/python3.9/site-packages/signatureanalyzer/spectra.py", line 107, in get_spectra_from_maf maf[context_num] = contig.apply(context_use.getitem) File "/share/app/python/3.9.4/lib/python3.9/site-packages/pandas/core/series.py", line 4356, in apply return SeriesApply(self, func, convert_dtype, args, kwargs).apply() File "/share/app/python/3.9.4/lib/python3.9/site-packages/pandas/core/apply.py", line 1036, in apply return self.apply_standard() File "/share/app/python/3.9.4/lib/python3.9/site-packages/pandas/core/apply.py", line 1092, in apply_standard mapped = lib.map_infer( File "pandas/_libs/lib.pyx", line 2859, in pandas._libs.lib.map_infer KeyError: 'ATNA'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/share/app/python/3.9.4/bin/signatureanalyzer", line 33, in sys.exit(load_entry_point('signatureanalyzer', 'console_scripts', 'signatureanalyzer')()) File "/share/app/python/3.9.4/lib/python3.9/site-packages/signatureanalyzer/main.py", line 195, in main run_maf( File "/share/app/python/3.9.4/lib/python3.9/site-packages/signatureanalyzer/signatureanalyzer.py", line 86, in run_maf maf, spectra = get_spectra_from_maf( File "/share/app/python/3.9.4/lib/python3.9/site-packages/signatureanalyzer/spectra.py", line 109, in get_spectra_from_maf raise KeyError('Unusual context: ' + str(e)) KeyError: "Unusual context: 'ATNA'"

yoakiyama commented 2 years ago

Sorry for the late response. Thank you for bringing this to our attention! We should ignore any mutations that include "N" as a flanking site. I will add this feature. Thanks again

YingYa commented 2 years ago

Thanks @yoakiyama. I have been filter all mutations that include "N" as a flanking site, the SignatureAnalyzer then could be run successfully.