Durenlab / LINGER

75 stars 14 forks source link

Error of cell_type_specific_TF_RE_binding_chr() function #38

Open xiaoxiao6630 opened 3 months ago

xiaoxiao6630 commented 3 months ago

Hello,

I used LINGER 1.67 version. I had errors showing "raise KeyError(f"{not_found} not in index")" when I run LL_net.cell_type_specific_TF_RE_binding(GRNdir,adata_RNA,adata_ATAC,genome,celltype,outdir,method) using example data and pipeline.

Then I checked the source code and tested code by line, I think there are errors of function **cell_type_specific_TF_RE_binding_chr()**.

  1. First error is RE=RE.loc[N_overlap], I changed it into set_N_overlap = set(N_overlap) overlap_index = RE.index.isin(set_N_overlap) RE = RE[overlap_index]; but then I have new error of S = np.log(RE_cluster+0.1) + np.log(mat+TFbinding+0.1) + np.log(TF_cluster+0.1).

Could you help to check this function?

Thanks!

xiaoxiao6630 commented 3 months ago

I found how to fix this problem, I changed the lines RE=pd.DataFrame(adata_ATAC.X.T,index=adata_ATAC.var['gene_ids'].values,columns=adata_ATAC.obs['barcode'].values) into RE=pd.DataFrame(adata_ATAC.raw.X.toarray().T,index=adata_ATAC.raw.var['gene_ids'].values,columns=adata_ATAC.obs['barcode'].values). Then it works.

Thanks!