writeReference {h5vc} | R Documentation |
Function to fill the Reference dataset of a tally file from a DNAString object
writeReference( tallyFile, group, dnastring, blocksize = 1000000, verbose = TRUE )
tallyFile |
filename of a tally file matching the variant calls |
group |
The group that the |
dnastring |
A |
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 |
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
.
Returns TRUE
on success.
Paul Pyl
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