Description Usage Arguments Details Value Examples
Add predicted novel exons to the correct transcripts in a GTF annotation.
1 | extend_gtf(gtf, pred, cores = 1)
|
gtf |
GTF annotations, either the path to the GTF file as a character string or a GRanges object. |
pred |
data.frame with predicted novel exons as returned by
|
cores |
Integer scalar. Number of cores to use. Default 1. |
For each novel exon in pred
(as returned by find_novel_exons()
), the list
of transcripts that contain its up- and/or downstream exons is determined. A
random exon from each transcript is copied and the start and end coordinates
are exchanged with those of the novel exon. The exon_number
and
exon_version
are set to NA. The new exon_id
, transcript_id
and
transcript_name
are the original values with a suffix that identifies the
novel exon by its ID: e.g. exon_id
_ID or transcript_name
_ID.
GRanges object with annotations from the GTF file and extended with the novel xons.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | gtf <- system.file("extdata", "selected.gtf", package = "DISCERNS",
mustWork = TRUE)
## Here we artificially create a data.frame with predicted exons.
## In general, the novel exons will be predicted with the function
## find_novel_exons()
novel_exons <- data.frame(seqnames = c("19", "22"),
start = c(47228064,41737092),
end = c(47228185, 41737150), strand = c("-", "+"),
lend = c(47226541, 41736141),
rstart = c(47228589, 41738533), ID = c(1, 2))
## add the predicted exons to the GTF file
new_gtf <- extend_gtf(gtf, novel_exons)
## save the new GTF to file with the export() function from rtracklayer
library(rtracklayer)
export(object = new_gtf, con = "extended_annotation.gtf")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.