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)

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).

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 plus _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 object with path to example reference library
refPath <- system.file("extdata","target.fasta", package = "MetaScope")

## Copy the example reference library to the current directory
file.copy(from = refPath, to = file.path(".", "target.fasta"))

## Make subread index of reference library
mk_subread_index('target.fasta')

#### Create multiple subread indexes from the example reference library

## Create object with path to example reference library
refPath <- system.file("extdata","target.fasta", package = "MetaScope")

## Copy the example reference library to the current directory
file.copy(from = refPath, to = file.path(".", "target.fasta"))

## Make multiple subread indexes of reference library
mk_subread_index('target.fasta', split = .02)


compbiomed/MetaScope documentation built on Aug. 9, 2022, 10:41 a.m.