hisat2_build {Rhisat2} | R Documentation

## Generate HISAT2 index

### Description

This function can be used to call the `hisat2-build` binary.

### Usage

    hisat2_build(
      references,
      outdir,
      ...,
      prefix = "index",
      force = FALSE,
      strict = TRUE,
      execute = TRUE
    )

### Arguments

`references` | Character vector. The path to the files containing the reference sequences from which to build the HISAT2 index.
`outdir` | Character scalar. The path to the output directory in which to store the HISAT2 index. If the directory already exists, the function will throw an error, unless `force=TRUE`.
`...` | Additional arguments passed to the binaries.
`prefix` | Character scalar. The prefix to use for the HISAT2 index files.
`force` | Logical scalar. Whether to force overwriting of `outdir`.
`strict` | Logical scalar. Whether strict checking of input arguments should be enforced.
`execute` | Logical scalar. Whether to execute the assembled shell command. If FALSE, return a string with the command.

### Details

All additional arguments in `...` are interpreted as additional arguments to the HISAT2 binaries. Any flags are supposed to be represented as logical values (e.g., `quiet=TRUE` will be translated into `--quiet`). Parameters with additional input are supposed to be character or numeric vectors, and the individual elements are collapsed into a single comma-separated string (e.g., `k=2` is translated into `-k 2`, `bmax=100` into `--bmax 100`). Some arguments to the HISAT2 binaries will be ignored if they are already handled as explicit function arguments. See the output of `hisat2_build_usage()` for details about available parameters.

### Value

If `execute` is TRUE, the output generated by calling the `hisat2-build` binary. If `execute` is FALSE, the `hisat2-build` command.

### Author(s)

Charlotte Soneson, based on code from Florian Hahne.

### References

Kim D, Langmead B and Salzberg SL. HISAT: a fast spliced aligner with low memory requirements. Nature Methods 12:357-360 (2015).

### Examples

    tmp <- tempdir()
    refs <- list.files(system.file(package="Rhisat2", "extdata/refs"),
                       full.names=TRUE, pattern="\\.fa$")
    x <- hisat2_build(references=refs, outdir=file.path(tmp, "index"),
                      force=TRUE)
    head(x)
    list.files(file.path(tmp, "index"))

[Package Rhisat2 version 1.6.0 Index]