Add gene annotations to features

feature_annotation_scExp(scExp, ref = "hg38", reference_annotation = NULL)

Arguments

scExp

A SingleCellExperiment object.

ref

Reference genome. Either 'hg38' or 'mm10'. ('hg38')

reference_annotation

A data.frame containing gene (or else) annotation with genomic coordinates.

Value

A SingleCellExperiment object with annotated rowData.

Examples

#> ChromSCape::create_scExp - the matrix has 300 cells and 600 features.
scExp = feature_annotation_scExp(scExp)
#> ChromSCape::feature_annotation_scExp - Selecting hg38 genes from Gencode.
head(SummarizedExperiment::rowRanges(scExp))
#> GRanges object with 6 ranges and 3 metadata columns: #> seqnames ranges strand | #> <Rle> <IRanges> <Rle> | #> chr1_1_5147117 chr1 1-5147117 * | #> chr1_5147118_10294233 chr1 5147118-10294233 * | #> chr1_10294234_15441350 chr1 10294234-15441350 * | #> chr1_15441351_20588466 chr1 15441351-20588466 * | #> chr1_20588467_25735583 chr1 20588467-25735583 * | #> chr1_25735584_30882699 chr1 25735584-30882699 * | #> ID Gene #> <character> <character> #> chr1_1_5147117 chr1_1_5147117 MIR1302-2, FAM138A, .. #> chr1_5147118_10294233 chr1_5147118_10294233 RP1-58B11.1, RP11-15.. #> chr1_10294234_15441350 chr1_10294234_15441350 PGD, APITD1-CORT, AP.. #> chr1_15441351_20588466 chr1_15441351_20588466 CELA2A, CELA2B, CASP.. #> chr1_20588467_25735583 chr1_20588467_25735583 CDA, PINK1, PINK1-AS.. #> chr1_25735584_30882699 chr1_25735584_30882699 SEPN1, RP1-317E23.6,.. #> distanceToTSS #> <integer> #> chr1_1_5147117 0 #> chr1_5147118_10294233 0 #> chr1_10294234_15441350 0 #> chr1_15441351_20588466 0 #> chr1_20588467_25735583 0 #> chr1_25735584_30882699 0 #> ------- #> seqinfo: 23 sequences from an unspecified genome; no seqlengths
# Mouse scExp = create_scExp(create_scDataset_raw(ref="mm10")$mat, create_scDataset_raw(ref="mm10")$annot)
#> ChromSCape::create_scExp - the matrix has 300 cells and 600 features.
scExp = feature_annotation_scExp(scExp,ref="mm10")
#> ChromSCape::feature_annotation_scExp - Selecting mm10 genes from Gencode.
head(SummarizedExperiment::rowRanges(scExp))
#> GRanges object with 6 ranges and 3 metadata columns: #> seqnames ranges strand | #> <Rle> <IRanges> <Rle> | #> chr1_1_4542536 chr1 1-4542536 * | #> chr1_4542537_9085072 chr1 4542537-9085072 * | #> chr1_9085073_13627607 chr1 9085073-13627607 * | #> chr1_13627608_18170143 chr1 13627608-18170143 * | #> chr1_18170144_22712679 chr1 18170144-22712679 * | #> chr1_22712680_27255214 chr1 22712680-27255214 * | #> ID Gene #> <character> <character> #> chr1_1_4542536 chr1_1_4542536 Gm1992, Xkr4, Gm3738.. #> chr1_4542537_9085072 chr1_4542537_9085072 Gm37323, Mrpl15, Lyp.. #> chr1_9085073_13627607 chr1_9085073_13627607 Sntg1, Rrs1, Adhfe1,.. #> chr1_13627608_18170143 chr1_13627608_18170143 Lactb2, Xkr9, Eya1, .. #> chr1_18170144_22712679 chr1_18170144_22712679 Defb18, Defb41, Gm29.. #> chr1_22712680_27255214 chr1_22712680_27255214 Rims1, 4933415F23Rik.. #> distanceToTSS #> <integer> #> chr1_1_4542536 0 #> chr1_4542537_9085072 0 #> chr1_9085073_13627607 0 #> chr1_13627608_18170143 0 #> chr1_18170144_22712679 0 #> chr1_22712680_27255214 0 #> ------- #> seqinfo: 21 sequences from an unspecified genome; no seqlengths