rezakj / iCellR

Single (i) Cell R package (iCellR) is an interactive R package to work with high-throughput single cell sequencing technologies (i.e scRNA-seq, scVDJ-seq, scATAC-seq, CITE-Seq and Spatial Transcriptomics (ST)).
120 stars 19 forks source link

iCellR object fails to function when using multiple samples with same condition #3

Closed IkjotSidhu closed 5 years ago

IkjotSidhu commented 5 years ago

I tried aggregating two different datasets into one object as they have the same conditions/groups. The data aggregation step and iCellR object creation step were successful but the iCellR fails to run any other function (for this instance, QC stats does not work).

ag.data <- data.aggregation(samples=c("h1.data","h1.data_2","h2.data","h2.data_2","h3.data","h3.data_2","h5.data","h5.data_2","h7.data","h7.data_2"),condition.names = c("H1","H1","H2","H2","H3","H3","H5","H5","H7","H7"))

my.data <- make.obj(ag.data)
qc.obj <- qc.stats(my.data)

Error in if (mito.genes[1] != "default.genes") { : missing value where TRUE/FALSE needed


Here is the iCellR object description

################################### ,--. ,-----. ,--.,--.,------. --'' .--./ ,---. | || || .--. ' ,--.| | | .-. :| || || '--'.' | |' '--'\ --. | || || | --' -----'----'--'--'`--' '--' ################################### An object of class iCellR version: 1.1.4 Raw/original data dimentions (rows,columns): 11966,11900 Data conditions in raw data: H1,H2,H3,H5,H7 (2459,2561,3018,2527,1335) Row names: A1CF,A2ML1,A2ML1.AS1 ... Columns names: H7_Hashtag7,H7_Hashtag7.1,H7_Hashtag7.2 ... ################################### QC stats performed:FALSE, PCA performed:FALSE, CCA performed:FALSE Clustering performed:FALSE, Number of clusters:0 tSNE performed:FALSE, UMAP performed:FALSE, DiffMap performed:FALSE Main data dimentions (rows,columns):0,0 Normalization factors:,... Imputed data dimentions (rows,columns):0,0 ############## scVDJ-Seq ########### VDJ data dimentions (rows,columns):0,0 ############## CITE-Seq ############ ADT raw data dimentions (rows,columns):0,0 ADT main data dimentions (rows,columns):0,0 ADT columns names:... ADT row names:... ########### iCellR object ##########


rezakj commented 5 years ago

Check to see if you have any mitochondrial genes after merging.

Run this to check: grep(pattern = "^mt\\.", x = rownames(ag.data),value = TRUE, ignore.case = TRUE)

Also, it's best to have the object name the same as you go down the pipeline, this way you only save one object that has all the data.

Example:

my.iCellR.obj <- make.obj(ag.data)
my.iCellR.obj <- qc.stats(my.iCellR.obj) 

You can put your own list of mito genes using "mito.genes" option as below.

my.iCellR.obj <- qc.stats(my.iCellR.obj, mito.genes = c("gene1","gene2"))

If you needed to skip this step and not filter use this:

my.iCellR.obj @main.data <- my.iCellR.obj @raw.data

I hope this helps!!!

rezakj commented 5 years ago

If your issue is solved, let's close it :)

By the way, I added more info for HTO demultiplexing. Read the section "Filtering HTOs and merging the samples"!

Let me know how it went!

IkjotSidhu commented 5 years ago

I found the source of error, it was occurring because of the duplicate cell ids and gene names.