Starlitnightly / omicverse

A python library for multi omics included bulk, single cell and spatial RNA-seq analysis.
https://starlitnightly.github.io/omicverse/
GNU General Public License v3.0
277 stars 32 forks source link

TCGA module survial_init error #20

Closed libmelo closed 3 days ago

libmelo commented 10 months ago

Describe the bug When I followed the tutorial of TCGA module with TCGA-BRCA data, an error emerged in the step of aml_tcga.survial_init().

To Reproduce Steps to reproduce the behavior:

  1. Follow the tutorial
  2. Run aml_tcga.survial_init()
  3. See error

Screenshots `--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[12], line 1 ----> 1 aml_tcga.survial_init()

File ~/.conda/envs/omicverse/lib/python3.11/site-packages/omicverse/bulk/_tcga.py:99, in pyTCGA.survial_init(self) 97 pd_c=self.clinical_sheet 98 for i in pd_c.index: ---> 99 if pd_c.loc[i,'vital_status'].iloc[0]=='Alive': 100 day_li.append(pd_c.loc[i,'days_to_last_follow_up'].iloc[0]) 101 elif pd_c.loc[i,'vital_status'].iloc[0]=='Dead':

AttributeError: 'str' object has no attribute 'iloc'`

Starlitnightly commented 10 months ago

Hi,

This erroe look like pd_c.loc[i,'vital_status'] is not a pd.Series. It seems that need a strict judgements when value is ''.

Sincerely