writeReference {h5vc} | R Documentation

## 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

### 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

    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

[Package h5vc version 2.28.0 Index]