Skip to contents

Contains methods for reading and displaying contents of the mapping_metrics.csv file output from DRAGEN. This file contains mapping and aligning metrics, like the metrics computed by the Samtools Flagstat command. These metrics are available on an aggregate level (over all input data), and on a per read group level. NOTE: we are keeping only the read group level metrics (i.e. removing the aggregate data). Unless explicitly stated, the metrics units are in reads (i.e., not in terms of pairs or alignments).

Super class

dracarys::File -> MappingMetricsFile

Methods

Inherited methods


Method read()

Reads the mapping_metrics.csv file output from DRAGEN.

Usage

MappingMetricsFile$read()

Returns

tibble with one row of X metrics per read group.


Method write()

Writes a tidy version of the mapping_metrics.csv file output from DRAGEN.

Usage

MappingMetricsFile$write(
  d,
  out_dir = NULL,
  prefix,
  out_format = "tsv",
  drid = NULL
)

Arguments

d

Parsed object from self$read().

out_dir

Output directory.

prefix

Prefix of output file(s).

out_format

Format of output file(s).

drid

dracarys ID to use for the dataset (e.g. wfrid.123, prid.456).


Method clone()

The objects of this class are cloneable with this method.

Usage

MappingMetricsFile$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

x <- system.file("extdata/wgs/SEQC-II.mapping_metrics.csv.gz", package = "dracarys")
mm <- MappingMetricsFile$new(x)
d <- mm$read() # or read(mm)
mm$write(d, out_dir = tempdir(), prefix = "seqc_mm", out_format = "tsv")