constantAmateur / SoupX

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

Manually setting contamination fraction #156

Open yesitsjess opened 2 months ago

yesitsjess commented 2 months ago

sc <- load10X(paste0(dir_10x, study_samps[i,1], "_CompleteNewExp/outs/"))

This works fine (thanks!):

soupAuto <- autoEstCont(sc)
soupAuto <- adjustCounts(soupAuto)

But when I try to manually set the contamination fraction I get errors:

soup10 <- setContaminationFraction(sc, 0.1)
soup10 <- adjustCounts(soup10)

Expanding counts from 18 clusters to 27584 cells. Warning message: In sparseMatrix(i = out@i[w] + 1, j = out@j[w] + 1, x = out@x[w], : 'giveCsparse' is deprecated; setting repr="T" for you

and downstream at:

soup10 <- NormalizeData(soup10)
soup10 <- ScaleData(soup10, features=rownames(soup10))
soup10 <- FindVariableFeatures(soup10)

Warning messages: 1: In eval(predvars, data, env) : NaNs produced 2: In hvf.info$variance.expected[not.const] <- 10^fit$fitted : number of items to replace is not a multiple of replacement length

soup10 <- RunPCA(soup10)

Error in RowVar.function(x = object) : could not find function "RowVar.function"