Durenlab / LINGER

73 stars 13 forks source link

there isn't get_adata and barcode_use #19

Open gaotai8 opened 4 months ago

gaotai8 commented 4 months ago

i am run GRN_infer.md. when i run adata_RNA,adata_ATAC=get_adata(matrix,features,barcodes,label)

adata_RNA,adata_ATAC=get_adata(matrix,features,barcodes,label) Traceback (most recent call last): File "/home/gaotai/conda/ENTER/envs/LINGER/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 3653, in get_loc return self._engine.get_loc(casted_key) File "pandas/_libs/index.pyx", line 147, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/index.pyx", line 176, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/hashtable_class_helper.pxi", line 7080, in pandas._libs.hashtable.PyObjectHashTable.get_item File "pandas/_libs/hashtable_class_helper.pxi", line 7088, in pandas._libs.hashtable.PyObjectHashTable.get_item KeyError: 'barcode_use'

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

Traceback (most recent call last): File "", line 1, in File "/home/gaotai/conda/ENTER/envs/LINGER/lib/python3.10/site-packages/LingerGRN/preprocess.py", line 281, in get_adata adata_RNA=adata_RNA[adata_RNA.obs['barcode'].isin(label['barcode_use'].values)] File "/home/gaotai/conda/ENTER/envs/LINGER/lib/python3.10/site-packages/pandas/core/frame.py", line 3761, in getitem indexer = self.columns.get_loc(key) File "/home/gaotai/conda/ENTER/envs/LINGER/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 3655, in get_loc raise KeyError(key) from err KeyError: 'barcode_use' can you tell me how can i solve it? Thank you!!!

gaotai8 commented 4 months ago

i want see get_adata, but i can't find it

amssyqy commented 4 months ago

Thanks for your question~ The column name of label is ['barcode_use','label'] label You could set it by label.columns=['barcode_use','label']

LinLi-0909 commented 4 months ago

I can not find get_adata function in preproposs.py