#!/bin/bash ## PEAR is used only for Paired-End sequencing files and will merge the "Read 1" file with the corresponding "Read 2" file. ## If using Paired-End sequencing files, it is best to merge the R1 and R2 files at the beginning of the analysis pipeline. Only programs that can be run in a "paired-end" mode are able to be used before merging. If a program does not have a "paired-end" mode, use PEAR to merge the R1 and R2 files BEFORE running the program! ## Requires installation of the PEAR program, found here: https://cme.h-its.org/exelixis/web/software/pear/doc.html ## PEAR Publication: https://doi.org/10.1093/bioinformatics/btt593 ## PEAR Variables threads=1 ## Number of threads/cores to use. min_length=16 ## Minimum length of sequences to keep. R1_pear_file=/full/path/to/file.r1.fastq ## Input File for Read 1 R2_pear_file=/full/path/to/file.r2.fasq ## Input File for Read 2 pear_output_file=/full/path/to/file ## Output File for PEAR ## Note: The PEAR program automatically adds .assembled.fastq to the end of the output file, so don't include a file extension in $pear_output_file_path! pear -j $threads -n $min_length -f $R1_pear_file -r $R2_pear_file -o $pear_output_file