Skip to contents

Contains methods for reading and displaying contents of the wgs_contig_mean_cov_<phenotype>.csv file output from DRAGEN. This file contains the estimated coverage for all contigs, and an autosomal estimated coverage.

Super class

dracarys::File -> WgsContigMeanCovFile

Methods

Inherited methods


Method read()

Reads the wgs_contig_mean_cov_<phenotype>.csv file output from DRAGEN.

Usage

WgsContigMeanCovFile$read(keep_alt = TRUE)

Arguments

keep_alt

Keep the ALT + Mito chromosomes?

Returns

tibble with the following columns:

  • label: file label.

  • chrom: contig name.

  • n_bases: number of bases aligned to contig (excludes bases from duplicate marked reads, reads with MAPQ=0, and clipped bases).

  • coverage: col2 / contig length


Method write()

Writes a tidy version of the wgs_contig_mean_cov_<phenotype>.csv file output from DRAGEN.

Usage

WgsContigMeanCovFile$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 plot()

Plots the wgs_contig_mean_cov_<phenotype>.csv files.

Usage

WgsContigMeanCovFile$plot(d, top_alt_n = 15)

Arguments

d

Parsed object from self$read().

top_alt_n

Number of top covered alt contigs to plot per phenotype.

Returns

A ggplot2 object with chromosomes on X axis, and coverage on Y axis.


Method clone()

The objects of this class are cloneable with this method.

Usage

WgsContigMeanCovFile$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

x1 <- system.file("extdata/wgs/SEQC-II.wgs_contig_mean_cov_normal.csv.gz", package = "dracarys")
x2 <- system.file("extdata/wgs/SEQC-II.wgs_contig_mean_cov_tumor.csv.gz", package = "dracarys")
cc1 <- WgsContigMeanCovFile$new(x1)
cc2 <- WgsContigMeanCovFile$new(x2)
d1 <- cc1$read()
d2 <- cc2$read()
cc1$write(d1, out_dir = tempdir(), prefix = "seqc_n", out_format = "tsv")
cc2$write(d2, out_dir = tempdir(), prefix = "seqc_t", out_format = "tsv")

cc1$plot(d1)

cc2$plot(d2)