Skip to contents

Contains methods for reading and plotting contents of the fragment_length_hist.csv file output from DRAGEN.

Super class

dracarys::File -> FragmentLengthHistFile

Methods

Inherited methods


Method read()

Reads the fragment_length_hist.csv file, which contains the fragment length distribution for each sample.

Usage

FragmentLengthHistFile$read()

Returns

A tibble with the following columns:

  • sample: name of sample

  • fragmentLength: estimated fragment length

  • count: number of reads with estimated fragment length


Method write()

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

Usage

FragmentLengthHistFile$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.csv file.

Usage

FragmentLengthHistFile$plot(d, min_count = 10)

Arguments

d

Parsed object from self$read().

min_count

Minimum read count to be plotted (Default: 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

FragmentLengthHistFile$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

x <- system.file("extdata/wgs/SEQC-II.fragment_length_hist.csv.gz", package = "dracarys")
fl <- FragmentLengthHistFile$new(x)
d <- fl$read() # or read(fl)
fl$plot(d) # or plot(fl)

fl$write(d |> dplyr::filter(count > 10), out_dir = tempdir(), prefix = "seqc_fl")