Skip to content

Instantly share code, notes, and snippets.

@mtw
Last active December 23, 2015 05:19
Show Gist options
  • Select an option

  • Save mtw/6585930 to your computer and use it in GitHub Desktop.

Select an option

Save mtw/6585930 to your computer and use it in GitHub Desktop.
bam2fastqc
#!/bin/bash
fastqcdir="./FastQC"
if [ -d "$fastqcdir" ];
then
echo "$fastqcdir available"
else
mkdir $fastqcdir
fi
for FQ in $(ls *.bam)
do
#echo $FQ
bn=$(basename $FQ .bam)
echo "processing $bn"
echo
bam2fastq -q $bn.bam -o $bn\#.fastq
for i in 1 2
do
fastqc --quiet --noextract -o $fastqcdir -t 16 ${bn}_${i}.fastq
gzip -c ${bn}_${i}.fastq > ${bn}_${i}.fq.gz
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment