User Tools

Site Tools


myillu_01.trimpe.sh

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
myillu_01.trimpe.sh [2016/05/07 12:49] – created hyjeongmyillu_01.trimpe.sh [2021/03/17 13:09] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== Script myIllu_trimPE.sh ======+====== Script <myIllu_trimPE.sh======
  
   #!/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:  
-#   http://www.usadellab.org/cms/uploads/supplementary/Trimmomatic/TrimmomaticManual_V0.32.pdf +  #   http://www.usadellab.org/cms/uploads/supplementary/Trimmomatic/TrimmomaticManual_V0.32.pdf 
- +  # 
-TRIMMOMATIC=/usr/local/apps/a5_miseq_linux_20140604/bin/trimmomatic.jar +  # Latest version of ngopt (a5_miseq): 20150522 
-ADAPTER=/usr/local/apps/a5_miseq_linux_20140604/adapter.fasta +   
-INTERLEAVE=/usr/local/apps/khmer/khmerEnv/bin/interleave-reads.py +  TRIMMOMATIC=/usr/local/apps/a5_miseq_linux_20140604/bin/trimmomatic.jar 
-THREADS=24 +  ADAPTER=/usr/local/apps/a5_miseq_linux_20140604/adapter.fasta 
-MINLEN=75 +  INTERLEAVE=/usr/local/apps/khmer/khmerEnv/bin/interleave-reads.py 
- +  THREADS=24 
-if [ $# -ne 2 ] +  MINLEN=75 
-    then +  # default MINLENG is 75 (for NGOPT, 36 bp) 
-        echo "Please specifiy two file names!" +   
-        exit 1 +  if [ $# -ne 2 ] 
-fi +      then 
- +          echo "Please specifiy two file names!" 
-# Check the files are found (code from SGA example script) +          exit 1 
-file_list="$1 $2" +  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"; exit 1; +  file_list="$1 $2" 
-    fi +  for input in $file_list; do 
-done +      if [ ! -f $input ]; then 
- +          echo "Error input file $input not found"; exit 1; 
- +      fi 
-BASE=$(basename "$1" # delete any leading path +  done 
-BASE=${BASE%_*}           # delete string from '_' to the end (shortest match) +   
-# 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 "current" directory. 
-echo "File name base: $BASE" +  BASE=$(basename "$1" # delete any leading path 
- +  BASE=${BASE%_*}           # delete string from '_' to the end (shortest match) 
-java -jar $TRIMMOMATIC PE -threads ${THREADS} -phred33 -baseout ${BASE}.fq.gz $1 $2 ILLUMINACLIP:$ADAPTER:2:30:10 LEADING:3 TRAILING:3 SLIDINGWINDOW:4:20 MINLEN:${MINLEN} +  # BASE=${1%%_*} makes difference. What is it? (longest match) 
- +  # BASE=${1/_*/(longest match) 
-# compare to a5-miseq pipeline (my $trim_cmd):  +  echo "File name base: $BASE" 
-#   ILLUMINACLIP:$adapter:2:30:10 LEADING:3 TRAILING:3 SLIDINGWINDOW:4:15 MINLEN:36 +  BASE=${BASE}-trim 
- +  echo "File name base will be changed into ${BASE}" 
-echo "Writing interleaved file ${BASE}.pe.fq from ${BASE}_1P.fq.gz ${BASE}_2P.fq.gz..." +   
-$INTERLEAVE -o ${BASE}.pe.fq ${BASE}_1P.fq.gz ${BASE}_2P.fq.gz +  java -jar $TRIMMOMATIC PE -threads ${THREADS} -phred33 -baseout ${BASE}.fq.gz $1 $2 ILLUMINACLIP:$ADAPTER:2:30:10 LEADING:3 TRAILING:3 SLIDINGWINDOW:4:20 MINLEN:${MINLEN} 
- +   
-echo "Deleting intermediate files (including orphan files)..." +  # 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+  #   ILLUMINACLIP:$adapter:2:30:10 LEADING:3 TRAILING:3 SLIDINGWINDOW:4:15 MINLEN:36 
 +   
 +  echo "Writing interleaved file ${BASE}.pe.fq from ${BASE}_1P.fq.gz ${BASE}_2P.fq.gz..." 
 +  $INTERLEAVE -o ${BASE}.pe.fq ${BASE}_1P.fq.gz ${BASE}_2P.fq.gz 
 +   
 +  echo "Deleting intermediate files (including orphan files)..." 
 +  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)