Skip to content
Snippets Groups Projects
Commit 3090fd6a authored by Brandi Cantarel's avatar Brandi Cantarel
Browse files

options trimgalore

parent ba09efe0
Branches
Tags
No related merge requests found
#!/bin/bash
#trimgalore.sh
pair_id=$1
read1=$2
read2=$3
usage() {
echo "-h Help documentation for hisat.sh"
echo "-a --FastQ R1"
echo "-b --FastQ R2"
echo "-p --Prefix for output file name"
echo "Example: bash trimgalore.sh -p prefix -a SRR1551047_1.fastq.gz -b SRR1551047_2.fastq.gz"
exit 1
}
OPTIND=1 # Reset OPTIND
while getopts :a:b:p:h opt
do
case $opt in
a) fq1=$OPTARG;;
b) fq2=$OPTARG;;
p) pair_id=$OPTARG;;
h) usage;;
esac
done
shift $(($OPTIND -1))
# Check for mandatory options
if [[ -z $pair_id ]] || [[ -z $fq1 ]]; then
usage
fi
r1base="${r1%.fastq*}"
r2base="${r2%.fastq*}"
module load trimgalore/0.4.1 cutadapt/1.9.1
if [ $R1 == $R2 ]
then
trim_galore -q 25 --illumina --gzip --length 35 ${read1}
trim_galore -q 25 --illumina --gzip --length 35 ${fq1}
mv ${r1base}_trimmed.fq.gz ${pair_id}.trim.R1.fastq.gz
cp ${pair_id}.trim.R1.fastq.gz ${pair_id}.trim.R2.fastq.gz
else
trim_galore --paired -q 25 --illumina --gzip --length 35 ${read1} ${read2}
trim_galore --paired -q 25 --illumina --gzip --length 35 ${fq1} ${fq2}
mv ${r1base}_val_1.fq.gz ${pair_id}.trim.R1.fastq.gz
mv ${r2base}_val_2.fq.gz ${pair_id}.trim.R2.fastq.gz
fi
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment