biomap-research / scFoundation

Apache License 2.0
224 stars 34 forks source link

Something wrong in genemodule/plot_geneemb.ipynb #42

Closed Peg-Wu closed 1 month ago

Peg-Wu commented 1 month ago

Hello, developer!

I found an error while running the genemodule/plot_geneemb.ipynb code:

coexplist=[]
for tf in tqdm(fltTF):
    tmpsim = cosine_similarity(fltgeneembdf.loc[fltTF[0],:].values.reshape(1,-1),fltgeneembdf)
    tmpsim[tmpsim>0.9999]=0
    tmpsimdf = pd.DataFrame(tmpsim,columns=sgene,index=['simi']).T
    tmpsimdf = tmpsimdf.sort_values('simi',ascending=False)
    for idx in range(1000):
        coexplist.append([tf,tmpsimdf.index[idx],tmpsimdf.iloc[idx,0]*100])

There is a problem with the following code:

tmpsim = cosine_similarity(fltgeneembdf.loc[fltTF[0],:].values.reshape(1,-1),fltgeneembdf)

fltgeneembdf.loc[fltTF[0],:].values.reshape(1,-1) should be modified as fltgeneembdf.loc[tf,:].values.reshape(1,-1)

WhirlFirst commented 1 month ago

Hi,

Thank you for checking this! It seems that the rest parts of pySCENIC have done some corrections by AUCell mode to get the final results. We will take a look and fix this. Thanks