Skip to content

Instantly share code, notes, and snippets.

@kdm9
Last active August 29, 2015 13:56
Show Gist options
  • Save kdm9/8951246 to your computer and use it in GitHub Desktop.
Save kdm9/8951246 to your computer and use it in GitHub Desktop.
Pete fastqc
#!/bin/bash
set -e
set -x
if [ $# -ne 1 ]
then
echo "USAGE: fastqc.sh SAMPLENAME"
fi
sample=$1
sample_dir=reads/$sample
fastqs="$(ls $sample_dir/*.fastq.gz)"
mkdir qc/$sample
fastqc -o qc/$sample $fastqs
@kdm9
Copy link
Author

kdm9 commented Feb 12, 2014

in parallel:

echo -e "Sample1\nSample2" | parallel bash fastqc.sh {}

Assuming sample names of Sample1 and Sample2

@kdm9
Copy link
Author

kdm9 commented Feb 12, 2014

or, more properly:

function findSamples () {
find reads/  -mindepth 1 -maxdepth 1 -type d -exec basename {} \;| tr ' ' '\n'
}

findSamples | parallel .....

But be careful with tr ' ' '\n', it will fuck things up if the sample names have spaces in them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment