GetGRangesWindowSeqandParam: GetGRangesWindowSeqandParam Function (GloModAn)

View source: R/GloModAn.R

GetGRangesWindowSeqandParamR Documentation

GetGRangesWindowSeqandParam Function (GloModAn)

Description

Return the GRanges object provided with the sequence associated to each position (and can also retrieve the sequence around each position).

Usage

GetGRangesWindowSeqandParam(
  grangesData,
  grangesGenome,
  dnastringsetGenome,
  nUpstreamBpToAdd = 0,
  nDownstreamBpToAdd = 0
)

Arguments

grangesData

A GRanges object containing Modifications Positions data to be extracted with the sequence.

grangesGenome

A GRanges object containing the width of each contig.

dnastringsetGenome

A DNAStringSet object containing the sequence for each contig.

nUpstreamBpToAdd

Number of base pairs to add upstream of the range from the GRanges object provided to obtain some sequence upstream of range. If some new ranges do not fit in the ranges of the contigs (provided with grangesGenome), those new ranges will be removed. New windows with gaps are also removed. Defaults to 0.

nDownstreamBpToAdd

Number of base pairs to add downstream of the range from the GRanges object provided to obtain some sequence downstream of range. If some new ranges do not fit in the ranges of the contigs (provided with grangesGenome), those new ranges will be removed. New windows with gaps are also removed. Defaults to 0.

Examples

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

# Preparing a grangesPacBioGFF datasets
myGrangesPacBioGFF <-
  ImportPacBioGFF(
    cPacBioGFFPath = system.file(
      package = "DNAModAnnot", "extdata",
      "ptetraurelia.modifications.sca171819.gff"
    ),
    cNameModToExtract = "m6A",
    cModNameInOutput = "6mA",
    cContigToBeAnalyzed = names(myGenome)
  )

# Retrieve GRanges with sequence
myPositions_Mod_Granges_wSeq <- GetGRangesWindowSeqandParam(
  grangesData = myGrangesPacBioGFF,
  grangesGenome = myGrangesGenome,
  dnastringsetGenome = myGenome,
  nUpstreamBpToAdd = 5,
  nDownstreamBpToAdd = 5
)
myPositions_Mod_Granges_wSeq

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