getzlab / SignatureAnalyzer

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

KeyError: 'Tumor_Sample_Barcode' #18

Closed likelet closed 4 years ago

likelet commented 4 years ago

CMD: signatureanalyzer processed_latest_1015.maf -n 10 --cosmic cosmic2 --objective poisson

/home/zhaoqi/.conda/envs/py3.7/lib/python3.7/site-packages/sklearn/utils/deprecation.py:143: FutureWarning: The sklearn.neighbors.base module is  deprecated in version 0.22 and will be removed in version 0.24. The corresponding classes / functions should instead be imported from sklearn.neighbors. Anything that cannot be imported from sklearn.neighbors is now part of the private API.
  warnings.warn(message, FutureWarning)
---------------------------------------------------------
---------- S I G N A T U R E  A N A L Y Z E R  ----------
---------------------------------------------------------
   * Using cosmic2 signatures
   * Loading spectra from processed_latest_1015.maf
Traceback (most recent call last):
  File "/home/zhaoqi/.conda/envs/py3.7/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 2646, in get_loc
    return self._engine.get_loc(key)
  File "pandas/_libs/index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'Tumor_Sample_Barcode'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/zhaoqi/.conda/envs/py3.7/bin/signatureanalyzer", line 8, in <module>
    sys.exit(main())
  File "/home/zhaoqi/.conda/envs/py3.7/lib/python3.7/site-packages/signatureanalyzer/__main__.py", line 181, in main
    **vars(args)
  File "/home/zhaoqi/.conda/envs/py3.7/lib/python3.7/site-packages/signatureanalyzer/signatureanalyzer.py", line 87, in run_maf
    cosmic=cosmic
  File "/home/zhaoqi/.conda/envs/py3.7/lib/python3.7/site-packages/signatureanalyzer/spectra.py", line 59, in get_spectra_from_maf
    maf['sample'] = maf['Tumor_Sample_Barcode']
  File "/home/zhaoqi/.conda/envs/py3.7/lib/python3.7/site-packages/pandas/core/frame.py", line 2800, in __getitem__
    indexer = self.columns.get_loc(key)
  File "/home/zhaoqi/.conda/envs/py3.7/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 2648, in get_loc
    return self._engine.get_loc(self._maybe_cast_indexer(key))
  File "pandas/_libs/index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'Tumor_Sample_Barcode'

Hi, I have a header named Tumor_Sample_Barcode in my maf file and it returns an error like this, how to fix it ? Is there an example maf file provided to test the command and help me to format the input maf file ? thanks

shankara-a commented 4 years ago

Here is the docs on the required columns, please check this: https://github.com/broadinstitute/getzlab-SignatureAnalyzer/blob/master/docs/generating_mutational_spectra.md

And here is an example maf: https://github.com/broadinstitute/getzlab-SignatureAnalyzer/blob/master/examples/example_luad_maf.tsv

Best,

Shankara

likelet commented 4 years ago

Okay, thanks for your reply.