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