kaizhang / SnapATAC2

Single-cell epigenomics analysis tools
https://kzhang.org/SnapATAC2/
197 stars 20 forks source link

add_cor_scores #286

Open TingTingShao opened 3 months ago

TingTingShao commented 3 months ago

Hi,

I ran into error when running

net = snap.tl.init_network_from_annotation(regions, 
    anno_file =snap.genome.hg38,  
    upstream = 250000,  
    downstream= 250000,  
    id_type = 'gene_name',  
    coding_gene_only = True)
net = snap.tl.add_cor_scores(net, gene_mat=gene_mat, peak_mat=peak_mat, select=None, overwrite=False)

error shows:

net = snap.tl.add_cor_scores(net, gene_mat=gene_mat, peak_mat=peak_mat, select=None, overwrite=False)
if sp.issparse(y):
    y = y.todense()
scores = np.ravel(spearman(X.T, y.reshape((1, -1))))
for nd, sc in zip(nd_X, scores):
    setattr(network.get_edge_data(nd, nd_y), key, sc)

Looking forward to your reply!

Thanks tingting

kaizhang commented 3 months ago

what was the error message?

TingTingShao commented 3 months ago

Sorry, miss the error line, this is the error:

PanicException: Cannot compute correlation for type uint32