Description Usage Arguments Value Author(s) References Examples
This function extract gene count/expression from isoform count/expression by for each condition summing the expression of all isoforms belonging to a specific gene. It can automatically extract the isoform:gene relationship from multiple file-types including GTF/GFF files and isoformSwitchAnalyzeRlists
1 2 3 4 5 | isoformToGeneExp(
isoformRepExpression,
isoformGeneAnnotation=NULL,
quiet = FALSE
)
|
isoformRepExpression |
A replicate isoform abundance matrix (not log-transformed) with genes as rows and samples as columns. The isoform:gene relationship can be provided by either:
Importantly |
isoformGeneAnnotation |
Can be either of:
|
quiet |
A logic indicating whether to avoid printing progress messages. Default is FALSE |
This function returns a data.frame with gene expression from all samples. The gene_ids will be given in the same way they were presented in the isoformRepExpression
input (as row.names or as a separate column (gene_id))
Kristoffer Vitting-Seerup
Vitting-Seerup et al. The Landscape of Isoform Switches in Human Cancers. Mol. Cancer Res. (2017).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | ### Please note
# 1) The way of importing files in the following example with
# "system.file('pathToFile', package="IsoformSwitchAnalyzeR") is
# specialiced to access the sample data in the IsoformSwitchAnalyzeR package
# and not somhting you need to do - just supply the string e.g.
# "myAnnotation/isoformsQuantified.gtf" to the functions
# 2) importRdata directly supports import of a GTF file - just supply the
# path (e.g. "myAnnotation/isoformsQuantified.gtf") to the isoformExonAnnoation argument
### Import quantifications
salmonQuant <- importIsoformExpression(system.file("extdata/", package="IsoformSwitchAnalyzeR"))
### Summarize to gene level via GTF file
geneRepCount <- isoformToGeneExp(
isoformRepExpression = salmonQuant$counts,
isoformGeneAnnotation = system.file("extdata/example.gtf.gz", package="IsoformSwitchAnalyzeR")
)
### Summarize to gene level via data.frame file
# get data.frame
localAnnotaion <- as.data.frame(
mcols(
rtracklayer::import(
system.file("extdata/example.gtf.gz", package="IsoformSwitchAnalyzeR")
)
)[,c('transcript_id','gene_id')]
)
colnames(localAnnotaion)[1] <- 'isoform_id'
geneRepCount <- isoformToGeneExp(
isoformRepExpression = salmonQuant$counts,
isoformGeneAnnotation = localAnnotaion
)
### From switchAnalyzeRlist
# create design
myDesign <- data.frame(
sampleID = colnames(salmonQuant$abundance)[-1],
condition = gsub('_.*', '', colnames(salmonQuant$abundance)[-1])
)
# Create switchAnalyzeRlist
aSwitchList <- importRdata(
isoformCountMatrix = salmonQuant$counts,
isoformRepExpression = salmonQuant$abundance,
designMatrix = myDesign,
isoformExonAnnoation = system.file("extdata/example.gtf.gz", package="IsoformSwitchAnalyzeR"),
isoformNtFasta = system.file("extdata/example_isoform_nt.fasta.gz", package="IsoformSwitchAnalyzeR")
)
geneRepCount <- isoformToGeneExp(
isoformRepExpression = salmonQuant$counts,
isoformGeneAnnotation = aSwitchList
)
# alternatively use
geneRepCount <- extractGeneExpression(
aSwitchList,
extractCounts = TRUE
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.