Learn R Programming

h5vc (version 2.6.3)

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

Description

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

Usage

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

Value

  • Returns TRUE on success.

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.

Examples

Run this code
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

Run the code above in your browser using DataLab