PredictMissingAnnotation: PredictMissingAnnotation Function (DaLoad)

View source: R/DaLoad.R

PredictMissingAnnotationR Documentation

PredictMissingAnnotation Function (DaLoad)

Description

Complete annotation with features, such as "intergenic", "antisense_strand_of_gene" or "exon"|"intron", using available features in the annotation.

Usage

PredictMissingAnnotation(
  grangesAnnotations,
  grangesGenome,
  cFeaturesColName = "type",
  cGeneCategories = c("gene"),
  lAddIntronRangesUsingExon = FALSE
)

Arguments

grangesAnnotations

A GRanges object with the annotation to be completed.

grangesGenome

A GRanges object with number and width of contigs (both strands).

cFeaturesColName

The name of the column containing feature type annotation ("gene", "exon", "mRNA"...). Defaults to "type".

cGeneCategories

The name of the categories considered as genes in the column containing feature type annotation. Defaults to c("gene").

lAddIntronRangesUsingExon

If TRUE, uses "exon" and "mRNA" categories to add "intron" if "intron" is missing, or uses "intron" and "mRNA" categories to add "exon" if "exon" is missing. This will return an error if 2 categories among "mRNA", "exon" and "intron" are missing. Defaults to FALSE.

Examples

# Loading genome data
myGenome <- Biostrings::readDNAStringSet(system.file(
  package = "DNAModAnnot", "extdata",
  "ptetraurelia_mac_51_sca171819.fa"
))
myGrangesGenome <- GetGenomeGRanges(myGenome)

# Loading annotation data
myAnnotations <-
  rtracklayer::readGFFAsGRanges(system.file(
    package = "DNAModAnnot", "extdata",
    "ptetraurelia_mac_51_annotation_v2.0_sca171819.gff3"
  ))

# Completing annotation data
levels(myAnnotations$type)
myAnnotations <- PredictMissingAnnotation(
  grangesAnnotations = myAnnotations,
  grangesGenome = myGrangesGenome,
  cFeaturesColName = "type",
  cGeneCategories = c("gene"),
  lAddIntronRangesUsingExon = TRUE
)
levels(myAnnotations$type)

AlexisHardy/DNAModAnnot documentation built on Feb. 27, 2023, 12:03 a.m.