trimPrimersITS: Trim Primers from ITS Sequences (with metadata)

View source: R/dada_wrappers.R

trimPrimersITSR Documentation

Trim Primers from ITS Sequences (with metadata)

Description

Trims primers from ITS sequences using cutadapt. Cutadapt must be installed in order for this to work. Currently only supports forward-read (R1) sequences. If reverse reads are included, they will be ignored.

Usage

trimPrimersITS(
  fn,
  in_subdir,
  out_subdir,
  meta,
  cutadapt_path,
  in_explicitdir = NULL,
  out_explicitdir = NULL,
  primer_ITS_fwd = "CTTGGTCATTTAGAGGAAGTAA",
  primer_ITS_rev = "GCTGCGTTCTTCATCGATGC",
  very_verbose = FALSE,
  discard_untrimmed = FALSE
)

Arguments

fn

Base names of input fastq files. If inputs are not base names (i.e. if they include directory paths), the directory paths will be removed. Files that do not exist will be ignored; however, if all files do not exist, this function will issue a warning.

in_subdir

Subdirectory name from which to retrieve input fastq files. Enter "raw" for raw sequence files, or any other character string to specify a subdirectory within NEONMICROBE_DIR_MIDPROCESS/ITS. To specify a directory outside NEONMICROBE_DIR_MIDPROCESS/ITS, use the 'in_explicitdir' argument.

out_subdir

Subdirectory name where output fastq files will be written. Enter any character string to specify a subdirectory within NEONMICROBE_DIR_MIDPROCESS/ITS. If the directory does not exist, it will be created. To specify a directory outside NEONMICROBE_DIR_MIDPROCESS/ITS, use the 'out_explicitdir' argument.

meta

The output of downloadSequenceMetadata. Must be provided as either the data.frame returned by downloadSequenceMetadata or as a filepath to the csv file produced by downloadSequenceMetadata.

cutadapt_path

Default CUTADAPT_PATH in params.R. Path to cutadapt on your file system.

in_explicitdir, out_explicitdir

Directory names to use instead of 'in_subdir' and 'out_subdir', if static directory names or directories outside of NEONMICROBE_DIR_MIDPROCESS/ITS are desired. Not recommended for use within processing batches.

primer_ITS_fwd, primer_ITS_rev

DNA sequence of the ITS forward and reverse primer, respectively.

very_verbose

Default FALSE. Whether to print output from cutadapt.

discard_untrimmed

Default FALSE. Whether to discard reads where a primer could not be found, leaving only those reads in which a primer has been trimmed.

Value

No value is returned (unlike its 16S counterpart).

Examples

 {
fl_nm <- c("BMI_Plate37WellB2_ITS_BNM6G_R1.fastq.gz", "BMI_Plate37WellB2_ITS_BNM6G_R2.fastq.gz")
trimPrimersITS(
  fl_nm, in_subdir = "1_filtN", out_subdir = "2_trimmed", meta = seqmeta_greatplains_its,
  cutadapt_path = "your/path/here"
)

claraqin/neonMicrobe documentation built on April 11, 2024, 11:47 a.m.