importGTF {IsoformSwitchAnalyzeR} | R Documentation |
Function for importing a GTF (can be either gziped or unpacked) into R as a switchAnalyzeRlist
. This approach is well suited if you just want to annotate a transcriptome and are not interested in expression. If you are interested in expression estimates it is easier to use importRdata.
importGTF( pathToGTF, isoformNtFasta = NULL, extractAaSeq = FALSE, addAnnotatedORFs=TRUE, onlyConsiderFullORF=FALSE, removeNonConvensionalChr=FALSE, ignoreAfterBar = TRUE, ignoreAfterSpace = TRUE, ignoreAfterPeriod=FALSE, removeTECgenes = TRUE, PTCDistance=50, quiet=FALSE )
pathToGTF |
A string indicating the full path to the (gziped or unpacked) GTF that should be imported. |
isoformNtFasta |
A (vector of) text string(s) providing the path(s) to the a fasta file containing the nucloetide (genomic) sequence of all isoforms quantified. This is usefull for: 1) people working with non-model organisms where extracting the sequnce from a BSgenome might require extra work. 2) workflow speed-up for people who already have the fasta file (which most people running Salmon, Kallisto or RSEM for the quantification have as that is used to build the index). |
extractAaSeq |
A logic indicating whether the nucleotide sequence imported via |
addAnnotatedORFs |
A logic indicating whether the ORF from the GTF should be added to the |
onlyConsiderFullORF |
A logic indicating whether the ORFs added should only be added if they are fully annotated. Here fully annoated is defined as those that both have a annotated 'start_codon' and 'stop_codon' in the 'type' column (column 3). This argument is only considered if onlyConsiderFullORF=TRUE. Default is FALSE. |
removeNonConvensionalChr |
A logic indicating whether non-conventional chromosomes, here defined as chromosome names containing either a '_' or a period ('.'). These regions are typically used to annotate regions that cannot be assocaiated to a specific region (such as the human 'chr1_gl000191_random') or regions quite different due to different haplotypes (e.g. the 'chr6_cox_hap2'). Default is FALSE. |
ignoreAfterBar |
A logic indicating whether to subset the isoform ids by ignoring everything after the first bar ("|"). Usefull for analysis of GENCODE files. Default is TRUE. |
ignoreAfterSpace |
A logic indicating whether to subset the isoform ids by ignoring everything after the first space (" "). Usefull for analysis of gffutils generated GTF files. Default is TRUE. |
ignoreAfterPeriod |
A logic indicating whether to subset the gene/isoform is by ignoring everything after the first periot ("."). Should be used with care. Default is FALSE. |
removeTECgenes |
A logic indicating whether to remove genes marked as "To be Experimentally Confirmed" (if annotation is available). The default is TRUE aka to remove them which is in line with Gencode recomendations (TEC are not in gencode annotations). For more info about TEC see https://www.gencodegenes.org/pages/biotypes.html. |
PTCDistance |
Only considered if |
quiet |
A logic indicating whether to avoid printing progress messages. Default is FALSE |
The GTF file must have the following 3 annotation in column 9: 'transcript_id', 'gene_id', and 'gene_name'. Furthermore if addAnnotatedORFs is to be used the 'type' column (column 3) must contain the features marked as 'CDS'. If the onlyConsiderFullORF argument should work the GTF must also have 'start_codon' and 'stop_codon' annoated in the 'type' column (column 3).
A switchAnalyzeRlist
containing a all the gene and transcript information as well as the transcipt models. See ?switchAnalyzeRlist for more details.
If addAnnotatedORFs=TRUE
a data.frame
containing the details of the ORF analysis have been added to the switchAnalyzeRlist under the name 'orfAnalysis'.
The data.frame added have one row pr isoform and contains 11 columns:
isoform_id
: The name of the isoform analyzed. Mathces the 'isoform_id' entry in the 'isoformFeatures' entry of the switchAnalyzeRlist
orfTransciptStart
: The start position of the ORF in transcript cooridnats, here defined as the position of the 'A' in the 'AUG' start motif.
orfTransciptEnd
: The end position of the ORF in transcript coordinats, here defined as the last nucleotide before the STOP codon (meaning the stop codon is not included in these coordinates).
orfTransciptLength
: The length of the ORF
orfStarExon
: The exon in which the start codon is
orfEndExon
: The exon in which the stop codon is
orfStartGenomic
: The start position of the ORF in genomic cooridnats, here defined as the the position of the 'A' in the 'AUG' start motif.
orfEndGenomic
: The end position of the ORF in genomic coordinats, here defined as the last nucleotide before the STOP codon (meaning the stop codon is not included in these coordinates).
stopDistanceToLastJunction
: Distance from stop codon to the last exon-exon junction
stopIndex
: The index, counting from the last exon (which is 0), of which exon is the stop codon is in.
PTC
: A logic indicating whether the isoform is classified as having a Premature Termination Codon. This is defined as having a stop codon more than PTCDistance
(default is 50) nt upstream of the last exon exon junciton.
NA means no information was advailable aka no ORF (passing the minORFlength
filter) was found.
Kristoffer Vitting-Seerup
Vitting-Seerup et al. The Landscape of Isoform Switches in Human Cancers. Mol. Cancer Res. (2017).
createSwitchAnalyzeRlist
preFilter
# Note the way of importing files in the following example with # "system.file('pathToFile', package="IsoformSwitchAnalyzeR") is # specialized way of accessing the example data in the IsoformSwitchAnalyzeR package # and not something you need to do - just supply the string e.g. # "myAnnotation/isoformsQuantified.gtf" to the functions aSwitchList <- importGTF(pathToGTF=system.file("extdata/example.gtf.gz", package="IsoformSwitchAnalyzeR")) aSwitchList