Created
April 6, 2018 01:26
-
-
Save rec3141/97c9a7f8e50ed05d4afb6c348fd828e8 to your computer and use it in GitHub Desktop.
srun-metaspades.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NODE=bio | |
THREADS=7 #7 for bio, 24 for t1small | |
MEM=200 #128 max for t1small, 200+ for bio | |
mkdir -p spades-assembly | |
DIR='.' | |
#NPRB_meta_TBS.04.MEIO.R1.trimmed.fastq.gz | |
for PREFIX in `ls *.trimmed.fastq.gz | cut -f1-3 -d'.' | sort -u `; do | |
F1=($PREFIX"."*R1.trimmed*) | |
R1=($PREFIX"."*R2.trimmed*) | |
#echo "${F1[*]}" | |
#echo "${R1[*]}" | |
# FINDIR=`dirname $F1`"_"`basename $F1 | cut -f2 -d'_'` | |
OUTDIR=$PREFIX"_"`date +'%F-%H-%M-%S'` | |
if [ -e spades-assembly/metaspades_$FINDIR*/scaffolds.fasta ]; then continue; fi | |
SPADESCMD="~/apps/SPAdes-3.11.0-Linux/bin/metaspades.py -o spades-assembly/metaspades_$OUTDIR -t $THREADS -m $MEM --tmp-dir /tmp -k21,33,55,67,77,89,99,121 " | |
J=$((${#F1[@]}-1)) | |
for I in `seq 0 $J`; do | |
SPADESCMD=$SPADESCMD" --pe1-1 ${F1[$I]} --pe1-2 ${R1[$I]} " | |
echo -e $SPADESCMD | |
sbatch --partition=$NODE --ntasks=$THREADS --tasks-per-node=$THREADS --mem=$MEMG <<-EOF | |
#!/bin/sh | |
eval "$SPADESCMD" | |
EOF | |
done | |
done | |
done | |
#mkdir -p corrected/$DIR | |
#mv spades-assembly/metaspades_$OUTDIR/corrected/*.gz corrected/$DIR/ | |
#rm -rf spades-assembly/metaspades_$OUTDIR/K* | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment