yyoshiaki / VIRTUS2

A bioinformatics pipeline for viral transcriptome detection and quantification considering splicing.
Other
16 stars 6 forks source link

AttributeError: '_LocIndexer' object has no attribute 'columns' #22

Open patrick-douglas opened 1 year ago

patrick-douglas commented 1 year ago

Dear @yyoshiaki I'm trying to run VIRTUS_wrapper.py, but I'm getting the following error, how can I fix it?

.....
    }
}INFO Final process status is success
Traceback (most recent call last):
  File "/home/me/VIRTUS2/bin//VIRTUS_wrapper.py", line 198, in <module>
    df_cov = df_cov.loc[list_index]
  File "/usr/local/lib/python3.10/dist-packages/pandas/core/indexing.py", line 1091, in __getitem__
    check_dict_or_set_indexers(key)
  File "/usr/local/lib/python3.10/dist-packages/pandas/core/indexing.py", line 2611, in check_dict_or_set_indexers
    raise TypeError(
TypeError: Passing a set as an indexer is not supported. Use a list instead.

All best Patrick~

patrick-douglas commented 1 year ago

After downgrade pandas to version 1.4 I've replaced the Error for a Warning, however I can see another error

illa/STAR_index_virus --outFileNamePrefix_human human --nthreads 12 --filename_output VIRTUS.output.txt 

/home/me/VIRTUS2/bin//VIRTUS_wrapper.py:198: FutureWarning: Passing a set as an indexer is deprecated and will raise in a future version. Use a list instead.
  df_cov = df_cov.loc[list_index]
Traceback (most recent call last):
  File "/home/me/VIRTUS2/bin//VIRTUS_wrapper.py", line 201, in <module>
    df_cov = df_cov[df_rate.columns]
AttributeError: '_LocIndexer' object has no attribute 'columns'

How can I fix this one?

All Best Patrick~

yyoshiaki commented 1 year ago

Hi patrick,

I'm testing VIRTUS_wrapper.py using pandas==1.3.5. To check whether the problem is caused by your input or environment, could you test VIRTUS_wrapper.py using the same input.csv as in https://github.com/yyoshiaki/VIRTUS2#wrapper-for-multiple-analysis ?

patrick-douglas commented 1 year ago

Hi @yyoshiaki, After a long wait the error was the same for the dataset you suggested, take a look below, seems like to fail only in the final process (heatmap generations):

...
        "path": "/media/me/Volume1/final/virtus2/teste/Ctrl_2/virusAligned.filtered.sortedByCoord.out.bam"
    },
    "output_coverage": {
        "location": "file:///media/me/Volume1/final/virtus2/teste/Ctrl_2/virus.coverage.txt",
        "basename": "virus.coverage.txt",
        "class": "File",
        "checksum": "sha1$2f5da5e7be0bcd825f04b0c7454fd417fdfab11a",
        "size": 518830,
        "path": "/media/me/Volume1/final/virtus2/teste/Ctrl_2/virus.coverage.txt"
    },
    "output": {
        "location": "file:///media/me/Volume1/final/virtus2/teste/Ctrl_2/VIRTUS.output.txt",
        "basename": "VIRTUS.output.txt",
        "class": "File",
        "checksum": "sha1$bfb7bea5de5796249cb45e1bd2f07f6d07dbbad9",
        "size": 10675,
        "path": "/media/me/Volume1/final/virtus2/teste/Ctrl_2/VIRTUS.output.txt"
    }
}INFO Final process status is success
Traceback (most recent call last):
  File "/home/me/VIRTUS2/bin//VIRTUS_wrapper.py", line 201, in <module>
    df_cov = df_cov[df_rate.columns]
AttributeError: '_LocIndexer' object has no attribute 'columns' 

My input.scv

Name,SRR,Layout,Group
Flu_1,SRR9856912,PE,H3N2
Flu_2,SRR9856913,PE,H3N2
Ctrl_1,SRR9856914,PE,Mock
Ctrl_2,SRR9856915,PE,Mock

All Best Patrick~

yyoshiaki commented 1 year ago

Sorry for not getting back to you sooner. I had a conference last week. It looks like a version incompatibility for some packages. I will try to reproduce the issue. You tried the wrapper with python3.10 and pandas 1.40, right? I tested it with python 3.8.10 and pandas 1.3.5 and no error occurred.

yyoshiaki commented 1 year ago

Maybe I solved the problem. I pushed the updated VIRTUS_wrapper.py in branch 2.0.2.

Can you git clone the latest repository and change the branch to v2.0.2 or just download https://github.com/yyoshiaki/VIRTUS2/blob/v2.0.2/wrapper/VIRTUS_wrapper.py ?

patrick-douglas commented 1 year ago

Dear @yyoshiaki It worked very well, thank you very much. Could you take a look at this issue?

All best Patrick~