Skip to contents

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

Super class

dracarys::File -> TsoFragmentLengthHistFile

Methods

Inherited methods


Method read()

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

Usage

TsoFragmentLengthHistFile$read()

Returns

tibble with the following columns:

  • FragmentLength

  • Count


Method write()

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

Usage

TsoFragmentLengthHistFile$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 fragment length distributions as given in the fragment_length_hist.json.gz file.

Usage

TsoFragmentLengthHistFile$plot(d, min_count = 10)

Arguments

d

Parsed object from self$read().

min_count

Minimum read count to be plotted (def: 10).

Returns

A ggplot2 plot containing fragment lengths on X axis and read counts on Y axis for each sample.


Method clone()

The objects of this class are cloneable with this method.

Usage

TsoFragmentLengthHistFile$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

x <- system.file("extdata/tso/sample705.fragment_length_hist.json.gz", package = "dracarys")
fl <- TsoFragmentLengthHistFile$new(x)
d_parsed <- fl$read() # or read(fl)
fl$plot(d_parsed, 5)

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