-
Notifications
You must be signed in to change notification settings - Fork 0
run_slurm_array.sh
francosimonetti edited this page May 13, 2021
·
1 revision
# Replace path to your chromosome VCF files
if [ ! -f "ntot_per_chromosome.txt" ]; then
for i in {1..22}; do
echo $i `zcat /path/to/data/CHR${i}.vcf.gz |grep -v "#" |wc -l` >> ntot_per_chromosome.txt;
done
fi
GENOFILE="/path/to/data/CHR1.vcf.gz"
EXPRFILE="/path/to/data/expression.txt"
GENEINFO=/path/to/data/gencode.v26.annotation.gtf.gz
# Some parameters for Tejaas
TEJAAS_BIN=/path/to/tejaas/bin/tejaas
TJMETHOD=jpa-rr
NULLMODL=perm
SNPTHRES=0.00000005
GENTHRES=0.01
SBETA=0.1
EXPR_CORR="/path/to/data/expression_linear_corrected.txt"
for CHRM in {1..22}; do
NMAX=40000
NTOT_CHRM=$( sed "${CHRM}q;d" ${CHRM_NTOT_FILE} | awk '{print $2}' )
NJOBS=$(echo $(( NTOT/NMAX )))
JOBPREFIX="tejaas_chr${CHRM}"
OUTDIR="/path/to/data/output
OUTPREFIX="${OUTDIR}/chunk"
# create the job submission file
sed "s|_JOB_NAME|${JOBPREFIX}|g;
s|_TJS_BINR|${TEJAAS_BIN}|g;
s|_GT_FILE_|${GENOFILE}|g;
s|_EXPR_FL_|${EXPRFILE}|g;
s|_GEN_POSF|${GENEINFO}|g;
s|_TJ_METHD|${TJMETHOD}|g;
s|_NULL_MDL|${NULLMODL}|g;
s|_OUT_PRFX|${OUTPREFIX}|g;
s|_NUM_TOT_|${NTOT}|g;
s|_NUM_MAX_|${NMAX}|g;
s|_SNP_CUT_|${SNPTHRES}|g;
s|_GEN_CUT_|${GENTHRES}|g;
s|_SIG_BETA|${SBETA}|g;
s|_CHRM_NUM|${CHRM}|g;
s|_EXPRCORR_|${EXPR_CORR}|g;
" tejaas_array.slurm > ${jobname}.slurm
sbatch --array=0-${NJOBS}%20 ${jobname}.slurm