R/fix_bad_mgi_symbols.r
fix_bad_mgi_symbols.Rd
Also checks whether any gene names contain "Sep", "Mar" or "Feb". These should be checked for any suggestion that excel has corrupted the gene names.
fix_bad_mgi_symbols(
exp,
mrk_file_path = NULL,
printAllBadSymbols = FALSE,
as_sparse = TRUE,
verbose = TRUE,
localHub = FALSE
)
An expression matrix where the rows are MGI symbols, or a SingleCellExperiment (SCE) or other Ranged Summarized Experiment (SE) type object.
Path to the MRK_List2 file which can be downloaded from www.informatics.jax.org/downloads/reports/index.html
Output to console all the bad gene symbols
Convert exp
to sparse matrix.
Print messages.
If working offline, add argument localHub=TRUE to work with a local, non-updated hub; It will only have resources available that have previously been downloaded. If offline, Please also see BiocManager vignette section on offline use to ensure proper functionality.
Returns the expression matrix with the rownames corrected and rows representing the same gene merged. If no corrections are necessary, input expression matrix is returned. If a SingleCellExperiment (SCE) or other Ranged Summarized Experiment (SE) type object was inputted this will be returned with the corrected expression matrix under counts.
# Load the single cell data
cortex_mrna <- ewceData::cortex_mrna()
#> see ?ewceData and browseVignettes('ewceData') for documentation
#> loading from cache
# take a subset for speed
cortex_mrna$exp <- cortex_mrna$exp[1:50, 1:5]
cortex_mrna$exp <- fix_bad_mgi_symbols(cortex_mrna$exp)
#> see ?ewceData and browseVignettes('ewceData') for documentation
#> loading from cache
#> 5 rows do not have proper MGI symbols
#> 2310042E22Rik, BC005764, C130030K03Rik, Stmn1-rs1, Gm9846
#> see ?ewceData and browseVignettes('ewceData') for documentation
#> loading from cache
#> 0 poorly annotated genes are replicates of existing genes. These are:
#>
#> Converting to sparse matrix.
#> 3 rows should have been corrected by checking synonyms.
#> 2 rows STILL do not have proper MGI symbols.