mk_subread_index: Make a Subread index

View source: R/mk_subread_index.R

mk_subread_indexR Documentation

Make a Subread index

Description

This function is a wrapper for the Rsubread::buildindex function. It will generate one or more Subread indexes from a .fasta file. If the library is too large (default >4GB) it will automatically be split into multiple indexes, with _1, _2, etc at the end of the ref_lib basename.

Usage

mk_subread_index(ref_lib, split = 4, mem = 8000, quiet = TRUE)

Arguments

ref_lib

The name/location of the reference library file, in (uncompressed) .fasta format.

split

The maximum allowed size of the genome file (in GB). If the ref_lib file is larger than this, the function will split the library into multiple parts.

mem

The maximum amount of memory (in MB) that can be used by the index generation process (used by the Rsubread::buildindex function).

quiet

Turns off most messages. Default is TRUE.

Value

Creates one or more Subread indexes for the supplied reference .fasta file. If multiple indexes are created, the libraries will be named the ref_lib basename + "_1", "_2", etc. The function returns the names of the folders holding these files.

Examples

#### Create a subread index from the example reference library

## Create a temporary directory to store the reference library
ref_temp <- tempfile()
dir.create(ref_temp)

## Download reference genome
out_fasta <- download_refseq('Orthoebolavirus zairense', reference = FALSE,
                             representative = FALSE, out_dir = ref_temp,
                             compress = TRUE, patho_out = FALSE,
                             caching = TRUE)

## Make subread index of reference library
mk_subread_index(out_fasta)
unlink(ref_temp)


compbiomed/MetaScope documentation built on Nov. 20, 2024, 8 p.m.