writeReference: Filling the Reference dataset in a tally file from a...

Description Usage Arguments Details Value Author(s) Examples

View source: R/write.reference.R

Description

Function to fill the Reference dataset of a tally file from a DNAString object

Usage

1
writeReference( tallyFile, group, dnastring, blocksize = 1000000, verbose = TRUE )

Arguments

tallyFile

filename of a tally file matching the variant calls

group

The group that the Reference dataset is located in

dnastring

A DNAString object containing the new reference sequence

blocksize

The size of blocks in which to process the reference (higher values imply higher memory consumption)

verbose

Boolean flag to specify if diagnostic messages should be printed

Details

This function takes a tally file, a location within it (the group argument) and a reference sequence as a DNAString object, encodes the reference in the appropriate way and writes it to the location in the tally file in blocks of size specified in blocksize. The reference will be written to a dataset with the path paste(group, "Reference", sep = "/") within the tally file. The dataset itself must exists and have the correct dimensions to hold the sequence specified in dnastring.

Value

Returns TRUE on success.

Author(s)

Paul Pyl

Examples

1
2
3
4
5
6
7
library(h5vc)
library(rhdf5)
library(Biostrings)
filename = file.path(tempdir(), "write.ref.test.hfs5")
prepareTallyFile(filename=filename,study="SomeStudy",chrom="Foo",chromlength=8,nsamples=1)
writeReference(filename, group = "/SomeStudy/Foo", dnastring = DNAString("GATTACCA"))
h5dump(filename)$SomeStudy$Foo$Reference

h5vc documentation built on Nov. 8, 2020, 4:56 p.m.