readMapper: Mapping reads

View source: R/mapping.R

readMapperR Documentation

Mapping reads

Description

Mapping reads to clusters in an RMS object using VSEARCH.

Usage

readMapper(
  rms.obj,
  fa.dir,
  vsearch.exe = "vsearch",
  identity = 0.99,
  threads = 1,
  min.length = 30,
  verbose = TRUE,
  tmp.dir = "tmp"
)

Arguments

rms.obj

A list with the tables Sample.tbl and Cluster.tbl, see details below.

fa.dir

A path to where the fasta files with reads are located.

vsearch.exe

Text with the VSEARCH executable command.

identity

Identity threshold for mapping (0.0-1.0).

threads

Number of threads to be used by vsearch (integer).

min.length

Minimum fragment length used by vsearch (integer).

verbose

Turn on/off output text during processing (logical).

tmp.dir

Folder for temporary files.

Details

The rms.obj must be a list with the required data structures for mapping reads, i.e. it must contain a Sample.tbl, see addSampleTable. Note that this table must have a column named fasta_file naming the fasta files with the reads to be mapped, one file for each sample. The argument fa.dir is used to specify the path to these files.

The rms.obj must also contain a Cluster.tbl, see RMSobject. The reads from each sample will be mapped to the cluster sequences, using the identity threshold.

This results in a matrix of read counts, with one row for each fragment cluster and one column for each sample. The column names of this matrix are the sample_id texts in the Sample.tbl. The first token in the Header of the Cluster.tbl are used as row names.

The vsearch.exe is the exact command to invoke the VSEARCH software. This is normally just "vsearch", but if you run this as a singularity container (or any other container) it may be something like "singularity exec <container_name> vsearch".

Value

An RMS object with the matrix Readcount.mat added. Also, two new columns, reads_total and reads_mapped, have been added to the Sample.tbl.

Author(s)

Lars Snipen.

See Also

RMSobject, rmscols.


larssnip/microRMS documentation built on July 19, 2023, 1:06 a.m.