Skip to contents

Contains methods for reading and displaying contents of the TargetRegionCoverage.json.gz file output from TSO.

Super class

dracarys::File -> TsoTargetRegionCoverageFile

Methods

Inherited methods


Method read()

Reads the TargetRegionCoverage.json.gz file output from TSO.

Usage

TsoTargetRegionCoverageFile$read()

Returns

tibble with the following columns:

  • ConsensusReadDepth

  • BasePair

  • Percentage


Method write()

Writes a tidy version of the TargetRegionCoverage.json.gz file output from TSO.

Usage

TsoTargetRegionCoverageFile$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 TargetRegionCoverage.json.gz file.

Usage

TsoTargetRegionCoverageFile$plot(d, min_pct = 2)

Arguments

d

Parsed object from self$read().

min_pct

Minimum percentage to be plotted (def: 2).

Returns

A ggplot2 plot containing read depth on X axis and percentage covered on Y axis.


Method clone()

The objects of this class are cloneable with this method.

Usage

TsoTargetRegionCoverageFile$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

x <- system.file("extdata/tso/sample705.TargetRegionCoverage.json.gz", package = "dracarys")
trc <- TsoTargetRegionCoverageFile$new(x)
d_parsed <- trc$read() # or read(trc)
trc$plot(d_parsed, 0) # or plot(trc, d_parsed, 90)

trc$write(d_parsed, out_dir = tempdir(), prefix = "sample705", out_format = "tsv")