myillu_01.trimpe.sh
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| myillu_01.trimpe.sh [2016/12/06 09:56] – hyjeong | myillu_01.trimpe.sh [2021/03/17 13:09] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Script < | ||
| + | #!/bin/bash | ||
| + | # | ||
| + | # takes two paired files, run trimmomatic (PE mode), and makes one interleaved file | ||
| + | # Trimmomatic v0.32 manual: | ||
| + | # | ||
| + | # | ||
| + | # Latest version of ngopt (a5_miseq): 20150522 | ||
| + | | ||
| + | TRIMMOMATIC=/ | ||
| + | ADAPTER=/ | ||
| + | INTERLEAVE=/ | ||
| + | THREADS=24 | ||
| + | MINLEN=75 | ||
| + | # default MINLENG is 75 (for NGOPT, 36 bp) | ||
| + | | ||
| + | if [ $# -ne 2 ] | ||
| + | then | ||
| + | echo " | ||
| + | exit 1 | ||
| + | fi | ||
| + | | ||
| + | # Check the files are found (code from SGA example script) | ||
| + | file_list=" | ||
| + | for input in $file_list; do | ||
| + | if [ ! -f $input ]; then | ||
| + | echo "Error input file $input not found"; | ||
| + | fi | ||
| + | done | ||
| + | | ||
| + | # Using `basename` command is a good idea. Because the stripped BASE | ||
| + | # can be used as a output file prefix in " | ||
| + | BASE=$(basename " | ||
| + | BASE=${BASE%_*} | ||
| + | # BASE=${1%%_*} makes difference. What is it? (longest match) | ||
| + | # BASE=${1/ | ||
| + | echo "File name base: $BASE" | ||
| + | BASE=${BASE}-trim | ||
| + | echo "File name base will be changed into ${BASE}" | ||
| + | | ||
| + | java -jar $TRIMMOMATIC PE -threads ${THREADS} -phred33 -baseout ${BASE}.fq.gz $1 $2 ILLUMINACLIP: | ||
| + | | ||
| + | # compare to a5-miseq pipeline (my $trim_cmd): | ||
| + | # | ||
| + | | ||
| + | echo " | ||
| + | $INTERLEAVE -o ${BASE}.pe.fq ${BASE}_1P.fq.gz ${BASE}_2P.fq.gz | ||
| + | | ||
| + | echo " | ||
| + | rm ${BASE}_1U.fq.gz ${BASE}_2U.fq.gz ${BASE}_1P.fq.gz ${BASE}_2P.fq.gz | ||
