FiltFdrBased: FiltFdrBased Function (Filter)

View source: R/Filter.R

FiltFdrBasedR Documentation

FiltFdrBased Function (Filter)

Description

Filter out modifications which have a parameter (tested with FDR estimations) that do not reach criterias of selection.

Usage

FiltFdrBased(
  grangesModPosWithSeq,
  listFdrEstByThrIpdRatio = NULL,
  listFdrEstByThrScore = NULL
)

Arguments

grangesModPosWithSeq

A List of GRanges object, with the sequence for each motif associated to the modification, and containing PacBio GFF data to be filtered. Can be obtained using the ExtractListModPosByModMotif function.

listFdrEstByThrIpdRatio

A list of thresholds on ipdRatio for each motif associated to the modification. Defaults to NULL.

listFdrEstByThrScore

A list of thresholds on score for each motif associated to the modification. Defaults to NULL.

Value

A filtered grangesModPosWithSeq.

Examples

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

# Preparing a grangesPacBioGFF dataset
myGrangesPacBioGFF <-
  ImportPacBioGFF(
    cPacBioGFFPath = system.file(
      package = "DNAModAnnot", "extdata",
      "ptetraurelia.modifications.sca171819.gff"
    ),
    cNameModToExtract = "m6A",
    cModNameInOutput = "6mA",
    cContigToBeAnalyzed = c("scaffold51_17", "scaffold51_18", "scaffold51_19")
  )

myMotif_pct_and_GRangesList <- ExtractListModPosByModMotif(
  grangesModPos = myGrangesPacBioGFF,
  grangesGenome = myGrangesGenome,
  dnastringsetGenome = myGenome,
  nUpstreamBpToAdd = 0,
  nDownstreamBpToAdd = 1,
  nModMotifMinProp = 0.05,
  cBaseLetterForMod = "A",
  cModNameInOutput = "6mA"
)
# Filtering
myPosMod_GRangesbyMotif_filt <-
  FiltFdrBased(
    grangesModPosWithSeq = myMotif_pct_and_GRangesList$GRangesbyMotif,
    listFdrEstByThrIpdRatio = list(2.1, 2.1, 2.1),
    listFdrEstByThrScore = list(42, 42, 42)
  )
myPosMod_GRangesbyMotif_filt

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