constantAmateur / SoupX

R package to quantify and remove cell free mRNAs from droplet based scRNA-seq data
255 stars 34 forks source link

NaNs in soupMatrix with custom count matrix #14

Closed SNRNS closed 4 years ago

SNRNS commented 5 years ago

I am using gene x cell count matrices as input in the following way:

tod <- read.delim(
  "../0.Data/SoupX_input/V_1/raw_gene_bc_matrices/GRCh38/matrix.csv",
  row.names = 1, sep="\t")  

toc <- read.delim(
  "../0.Data/SoupX_input/V_1/filtered_gene_bc_matrices/GRCh38/matrix.csv",
  row.names = 1, sep="\t", header=TRUE)

tod <- as.matrix(tod)
toc <- as.matrix(toc)

channel1 = SoupChannel(tod, toc, channelName="Channel1", keepDroplets = TRUE)

scl = SoupChannelList(list(channel1))

There are no errors or warnings, however in the scl object, the scl$soupMatrix matrix constains only NaN, whereas the scl$soupMatrix matrix of the demo has numbers.

As an alternative, I created a barcodes.tsv, genes.tsv, and matrix.mtx files, and loaded them using:

scl = load10X(dataDirs)

The files get loaded, however the soupMatrix object in scl is also full of NaN.

@constantAmateur do you have any insights on how to solve this?

Thank you A

Jemkon commented 5 years ago

Hi @alejandro-jimenezsanchez,

I am running into the same error. soupMatrix object in scl is full of NaN. I was wondering if you have managed to fix this.

Could you please share if you have workaround?

Many thanks,

SNRNS commented 5 years ago

Hi @Jemkon,

No, I have not looked further into this issue.

I will post here the solution and/or unsuccessful workarounds when I get to look into it again.

jpcartailler commented 5 years ago

Ditto. Issue still exists.

joshpeters commented 4 years ago

Ditto, am getting these errors when running downstream commands –

inferNonExpressedGenes(scl) Error in intI(i, n = x@Dim[1], dn[[1]], give.dn = FALSE) : 'NA' indices are not (yet?) supported for sparse Matrices

calculateContaminationFraction(scl, "c1", list(IG = igGenes), useToEst = toUse) Error in intI(i, n = x@Dim[1], dn[[1]], give.dn = FALSE) : invalid character indexing

SNRNS commented 4 years ago

I haven't used it myself but I was told by a colleague that souporcell is running smoothly with custom cell ranger files.

constantAmateur commented 4 years ago

Hi everyone,

Sorry for the delay in responding, personal issues have prevented me working on this for the last 6 months. I have just released a major rewrite of SoupX and would be grateful if someone with this issue could run it and see if they still have the same issue.

I will leave the issue open for now. If someone does try and finds the problem still persists, I would be grateful if you could send me a data-set on which this issue occurs and I will debug the problem.

constantAmateur commented 4 years ago

I'm closing this for now, but if anyone tries this on the new version and has issues please re-open.