dpeerlab / scKINETICS

Code for scKINETICS (ISMB 2023)
20 stars 3 forks source link

Indexing into list of genes with a covariance matrix #3

Open ekernf01 opened 6 months ago

ekernf01 commented 6 months ago

Hi! I'm a causal inference and transcriptional data enthusiast, and I'm excited to try out scKINETICS because I think the backronym is really cool and it has a really neat way of getting around the steady state assumption that Dictys and CellOracle make. I ran into an error on this line.

prior_genes[celltype] = np.array([columns.index(gene) for gene in list(celltype_priors[celltype])])

It seems to:

Should gene not be a string containing a gene name, or an int? Why is it not the following?

prior_genes[celltype] = np.array([adata.var_names.index(gene) for gene in adata.var_names])

Thank you!

ekernf01 commented 6 months ago

There's a similar issue in line 310.

prior_pred = prior.dot(data.iloc[cellrand][list(prior)])

It seems like this could be fixed as follows:

prior_pred = prior.dot(data.iloc[cellrand][prior_genes[celltypes[cellrand]]])