Tool: Shell script to automate trimmomatic for multiple samples
3
gravatar for lakhujanivijay
12 months ago by
lakhujanivijay5.0k
India
lakhujanivijay5.0k wrote:

Couple of months back, I had developed this shell script to automate trimmomatic for multiple paired end fastq files. I could see multiple posts on biostars and I believe this is a routine work at many institutions.

Availability:

Hosted on GitHub

Feedback is highly appreciated 💚

  • Reach me on GitHub

    or

  • Post comments here on Biostars


bash shell tool trimmomatic • 1.6k views
ADD COMMENTlink modified 12 months ago • written 12 months ago by lakhujanivijay5.0k
2

thanks for sharing. IMHO, you should have a look at solutions like nextflow or snakemake.

ADD REPLYlink written 12 months ago by Pierre Lindenbaum128k

Hi Pierre Lindenbaum

I completely agree with you on that. I should start learning. Thanks for the suggestion.

ADD REPLYlink written 12 months ago by lakhujanivijay5.0k
1

Thanks for sharing the params.

ADD REPLYlink written 12 months ago by cpad011213k

Thanks cpad0112

ADD REPLYlink written 12 months ago by lakhujanivijay5.0k
3
gravatar for ATpoint
12 months ago by
ATpoint34k
Germany
ATpoint34k wrote:

Suggestion for improvement: Check up front at the beginning of a script that all necessary tools are in PATH and/or defined in variables, e.g.:

## $TRIMMOMATIC could be a path like $HOME/software/trimmomatic.jar
TOOLS=(samtools bedtools bowtie2 $TRIMMOMATIC)

## A simple command that checks if tools can be found, if not names are written to a file <missing_tools.txt>
function PathCheck {

  if [[ $(command -v $1 | wc -l) == 0 ]]; then 
    echo ${1} >> missing_tools.txt
    fi

}; export -f PathCheck

## Check all tools:
for i in $(echo ${TOOLS[*]}); do
  PathCheck $i; done

## If any of the specified tools is missing, throw an error and exit:
if [[ -e missing_tools.txt ]] && [[ $(cat missing_tools.txt | wc -l | xargs) > 0 ]]; then
  echo '[ERROR] Missing tools -- see missing_tools.txt for details' && exit 1
  fi
ADD COMMENTlink modified 12 months ago • written 12 months ago by ATpoint34k

Thanks for the awesome suggestion ATpoint. That's worth implementing!

ADD REPLYlink modified 12 months ago • written 12 months ago by lakhujanivijay5.0k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1547 users visited in the last hour