GetMeanParamByContig: GetMeanParamByContig Function (GloModAn)

View source: R/GloModAn.R

GetMeanParamByContigR Documentation

GetMeanParamByContig Function (GloModAn)

Description

Return a list with the mean by strand of the parameter provided for all scaffolds of genome assembly provided.

Usage

GetMeanParamByContig(grangesData, dnastringsetGenome, cParamName)

Arguments

grangesData

A GRanges-like object containing, in the extra columns, the parameter to be analysed.

dnastringsetGenome

A DNAStringSet object containing the sequence for each contig.

cParamName

The name of the column containing the parameter to be analysed.

Value

A list composed of 3 dataframes: 1 dataframe for each strand and 1 dataframe with both strands. In each dataframe:

  • refName: The names of each contig.

  • strand: The strand of each contig.

  • width: The width of each contig.

  • nb_sequenced: The number of bases sequenced by strand for each contig.

  • seqPct: The percentage of bases sequenced by strand for each contig (percentage of sequencing).

Examples

myGenome <- Biostrings::readDNAStringSet(system.file(
  package = "DNAModAnnot", "extdata",
  "ptetraurelia_mac_51_sca171819.fa"
))

# Preparing a gposPacBioCSV dataset
myGposPacBioCSV <-
  ImportPacBioCSV(
    cPacBioCSVPath = system.file(
      package = "DNAModAnnot", "extdata",
      "ptetraurelia.bases.sca171819.csv"
    ),
    cSelectColumnsToExtract = c(
      "refName", "tpl", "strand", "base",
      "score", "ipdRatio", "coverage"
    ),
    lKeepExtraColumnsInGPos = TRUE, lSortGPos = TRUE,
    cContigToBeAnalyzed = names(myGenome)
  )

myMean_cov_list <- GetMeanParamByContig(
  grangesData = myGposPacBioCSV,
  dnastringsetGenome = myGenome,
  cParamName = "coverage"
)
myMean_cov_list

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