buenrostrolab / FigR

Functional Inference of Gene Regulation
https://buenrostrolab.github.io/FigR/
MIT License
31 stars 10 forks source link

runGenePeakcorr error: the condition has length > 1 #16

Open lizakulaeva opened 1 year ago

lizakulaeva commented 1 year ago

Hi, I'm trying to run the function runGenePeakcorr with the sparse matrix for scRNAseq and SummarizedExperiment object of scATACseq and get this error:

Error in if (!class(obj) %in% c("SummarizedExperiment", "RangedSummarizedExperiment", : the condition has length > 1

How I can solve it?

Thank you in advance!

vkartha commented 1 year ago

Hi there!

A bit odd because that exact condition check doesn't exist in the current codebase (i.e. it was changed from the check above to stopifnot(inherits(ATAC.se,"RangedSummarizedExperiment")), for this very reason). How recently did you pull/install/update this FigR repo?

Can you tell me what is returned when you run the following on your input SummarizedExperiment object, which I denote as SE below (for the scATAC data):

class(SE)

vkartha commented 1 year ago

@lizakulaeva The code that was throwing this error was from an internal function centerCounts, that takes either a SummarizedExperiement or Matrix-like object and normalizes the ATAC-seq peak counts for each cell. The check is to make sure your input is in the right format, as per my comment above. I've changed the check such that it won't throw that conditional error (the check is still performed, but differently). It would still be good for you to make sure your input is in the accepted format. Happy to provide more assistance if you can confirm the input class, as per above (perhaps after first updating FigR on your end to include the latest update). Thanks so much!

vkartha commented 1 year ago

@lizakulaeva were you able to get this working? Thanks, appreciate the feedback. Otherwise I'll close this issue