reneshbedre / bioinfokit

Bioinformatics data analysis and visualization toolkit
MIT License
333 stars 77 forks source link

genenames='deg' don't work in volcano plot script #30

Closed arturomarin closed 3 years ago

arturomarin commented 3 years ago

Hi, very interesting project. I am trying to do the tutorial of the webpage, but when I try to do a volcano plot with labeling all DEGs it give me several errors. My code is:

visuz.gene_exp.volcano(df=df, lfc='log2FC', pv='p-value', lfc_thr=(1, 2), pv_thr=(0.05, 0.01), genenames='deg')

and the errors are

Traceback (most recent call last):
  File "/Users/arturo/miniconda3/envs/rnaseq/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2898, in get_loc
    return self._engine.get_loc(casted_key)
  File "pandas/_libs/index.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 101, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 1675, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 1683, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: None

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/arturo/miniconda3/envs/rnaseq/lib/python3.6/site-packages/bioinfokit/visuz.py", line 422, in volcano
    gene_exp.geneplot(df, geneid, lfc, lfc_thr, pv_thr, genenames, gfont, pv, gstyle)
  File "/Users/arturo/miniconda3/envs/rnaseq/lib/python3.6/site-packages/bioinfokit/visuz.py", line 337, in geneplot
    for i in d[geneid].unique():
  File "/Users/arturo/miniconda3/envs/rnaseq/lib/python3.6/site-packages/pandas/core/frame.py", line 2906, in __getitem__
    indexer = self.columns.get_loc(key)
  File "/Users/arturo/miniconda3/envs/rnaseq/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2900, in get_loc
    raise KeyError(key) from err
KeyError: None

Can you help me?

Thanks

reneshbedre commented 3 years ago

You are missing geneid parameter. use command as below

visuz.gene_exp.volcano(df=df, lfc='log2FC', pv='p-value', lfc_thr=(1, 2), pv_thr=(0.05, 0.01), genenames='deg', geneid="GeneNames")