R/preprocessing_filtering_reduction.R
exclude_features_scExp.RdRemove specific features (CNA, repeats)
exclude_features_scExp( scExp, features_to_exclude, by = "region", verbose = TRUE )
| scExp | A SingleCellExperiment object. |
|---|---|
| features_to_exclude | A GenomicRanges object or data.frame containing genomic regions or features to exclude or path towards a BED file containing the features to exclude. |
| by | Type of features. Either 'region' or 'feature_name'. If 'region', will look for genomic coordinates in columns 1-3 (chr,start,stop). If 'feature_name', will look for a genes in first column. ('region') |
| verbose | (TRUE) |
A SingleCellExperiment object without features to exclude.
#>features_to_exclude = data.frame(chr=c("chr4","chr7","chr17"), start=c(50000,8000000,2000000), end=c(100000,16000000,2500000)) features_to_exclude = as(features_to_exclude,"GRanges") scExp = exclude_features_scExp(scExp,features_to_exclude)#>scExp#> class: SingleCellExperiment #> dim: 596 300 #> metadata(0): #> assays(1): counts #> rownames(596): chr1_1_5147117 chr1_5147118_10294233 ... #> chrX_89737519_94884635 chrX_94884636_100031751 #> rowData names(1): ID #> colnames(300): sample_1_c1 sample_1_c2 ... sample_4_c77 sample_4_c78 #> colData names(5): barcode cell_id sample_id batch_id total_counts #> reducedDimNames(0): #> mainExpName: main #> altExpNames(0):