Skip to content

Instantly share code, notes, and snippets.

@mtw
Last active December 28, 2015 08:09
Show Gist options
  • Save mtw/7469673 to your computer and use it in GitHub Desktop.
Save mtw/7469673 to your computer and use it in GitHub Desktop.
Wrapper for DEXseq read counting
#!/bin/bash
samdir="./"
dexseq_flat_gff="my.DEXSeq.gff"
outdir="./dexseq-count"
dexseq_count="python /home/foo/bin/dexseq_count.py"
samtools=`which samtools`
if ! [ -d "$outdir" ];
then
mkdir -p $outdir
fi
for BAM in $(ls $samdir/*.bam)
do
bn=$(basename $BAM .uniq.bam)
echo "processing" $bn.uniq.bam
set -x
$samtools sort -n -o $BAM $bn | $samtools view -h - | $dexseq_count -p yes -s no -r pos -f sam $dexseq_flat_gff - $outdir/$bn.dexseq.count 2> $outdir/$bn.dexseq.count.err
set +x
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment