writeStates: Write states to h5 or csv file

Description Usage Arguments

View source: R/inference.R

Description

writeStatesToH5 Removes layers (optional) from pretrained model and calculates states of fasta file, writes states to h5/csv file. Function combines fasta entries in file to one sequence. This means predictor sequences can contain elements from more than one fasta entry. h5 file also contains sequence and positions of targets corresponding to states.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
writeStates(
  model.path = NULL,
  layer.depth = NULL,
  sequence = NULL,
  fasta.path,
  round_digits = 2,
  filename = "states.h5",
  step = 1,
  vocabulary = c("a", "c", "g", "t"),
  batch.size = 256,
  verbose = TRUE,
  returnStates = FALSE,
  padding = FALSE,
  file_type = "h5",
  model = NULL,
  mode = "lm"
)

Arguments

model.path

Path to a pretrained model.

layer.depth

Depth of layer to evaluate. If NULL last layer is used.

sequence

Character string, ignores fasta.path if argument given.

fasta.path

Path to fasta file.

round_digits

Number of decimal places.

filename

Filename to store states in.

step

Frequency of sampling steps.

vocabulary

Vector of allowed characters, character outside vocabulary get encoded as 0-vector.

batch.size

Number of samples to evaluate at once. Does not change output, only relevant for speed and memory.

verbose

Whether to print model before and after removing layers.

returnStates

Logical scalar, return states matrix.

padding

Logical scalar, generate states for first maxlen nucleotides by padding beginning of sequence with 0-vectors.

file_type

Either "h5" or "csv".

model

A keras model. If model and model.path are not NULL, model will be used for inference.

mode

Either "lm" for language model or "label" for label classification.


hiddengenome/altum documentation built on April 22, 2020, 9:33 p.m.