-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
183 additions
and
84 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
LDSTORE="${HOME}/packages/ldstore/ldstore_v1.1_x86_64/ldstore" | ||
TEJAAS="${HOME}/trans-eQTL/codebase/tejaas/bin/tejaas" | ||
GNETLMMDIR="${HOME}/packages/GNetLMM" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
#!/bin/bash | ||
|
||
CURDIR=`pwd` | ||
|
||
# external programs required for the pipeline | ||
LDSTORE="${HOME}/packages/ldstore/ldstore_v1.1_x86_64/ldstore" | ||
TEJAAS="${HOME}/trans-eQTL/codebase/tejaas/bin/tejaas" | ||
|
||
# Pipeline directories | ||
UTILSDIR="${CURDIR}/utils" | ||
CONFIGDIR="${CURDIR}/configs" | ||
SCRIPTDIR="${CURDIR}/../scripts" | ||
MASTER_BSUBDIR="${CURDIR}/../bsubfiles" | ||
JOBSUBDIR="${CURDIR}/../jobsubs" | ||
ANALYSISDIR="${CURDIR}/../analysis" | ||
CURDIRUP="$(dirname "$(pwd)")" | ||
UTILSDIR="${CURDIRUP}/main/utils" | ||
CONFIGDIR="${CURDIRUP}/main/configs" | ||
SCRIPTDIR="${CURDIRUP}/scripts" | ||
MASTER_BSUBDIR="${CURDIRUP}/bsubfiles" | ||
JOBSUBDIR="${CURDIRUP}/jobsubs" | ||
ANALYSISDIR="${CURDIRUP}/analysis" | ||
|
||
# Script files | ||
MATRIXEQTL="${SCRIPTDIR}/matrixeqtl.R" |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#!/bin/bash | ||
|
||
function submit_tejaas() { | ||
local tejaas=$1 | ||
local chrm=$2 | ||
local genotype=$3 | ||
local expression=$4 | ||
local sample=$5 | ||
local geneinfo=$6 | ||
local maffile=$7 | ||
local method=$8 | ||
local null=$9 | ||
local snpthres=${10} | ||
local genethres=${11} | ||
local sbeta=${12} | ||
local extraflags=${13} | ||
local jobsubdir=${14} | ||
local outdir=${15} | ||
local jobprefix=${16} | ||
local nmax=${17} | ||
local thisjobdep=${18} | ||
local bsubdir=${19} | ||
local __jobdeps=${20} | ||
local jobdeps=${21} | ||
local jobname=0 | ||
local i=0 | ||
local index=0 | ||
local includesnps=0 | ||
local startsnp=0 | ||
local endsnp=0 | ||
local outprefix=0 | ||
|
||
## echo $tejaas $chrm $genotype ${expression} ${sample} ${geneinfo} $maffile | ||
## echo "Method: " ${method} ${null} ${snpthres} ${genethres} ${sbeta} | ||
## echo "Extraflags: " ${extraflags} | ||
## echo $jobsubdir $outdir $jobprefix | ||
## echo $nmax $thisjobdep $bsubdir $__jobdeps $jobdeps | ||
|
||
ntot=`zcat ${genotype} | wc -l` | ||
njobs=$(echo $(( ntot/nmax ))) | ||
|
||
if [ -d ${jobsubdir} ]; then rm -rf ${jobsubdir}; fi; mkdir -p ${jobsubdir} | ||
if [ ! -d ${outdir} ]; then mkdir -p ${outdir}; fi | ||
|
||
for (( i=0; i <= ${njobs}; i++ )); do | ||
index=`echo ${i} | awk '{printf "%03d", $1}'` | ||
jobname="${jobprefix}_${index}" | ||
|
||
startsnp=$(( nmax * i + 1 )) | ||
endsnp=$(( nmax * (i + 1) )) | ||
if [ $endsnp -gt $ntot ]; then | ||
endsnp=${ntot} | ||
fi | ||
includesnps="${startsnp}:${endsnp}" | ||
|
||
outprefix="${outdir}/chunk${index}" | ||
|
||
# create the job submission file | ||
sed "s|_i_NAME|${jobname}|g; | ||
s|_TJS_BINR|${tejaas}|g; | ||
s|_GT_FILE_|${genotype}|g; | ||
s|_SAM_FILE|${sample}|g; | ||
s|_EXPR_FL_|${expression}|g; | ||
s|_GEN_POSF|${geneinfo}|g; | ||
s|_TJ_METHD|${method}|g; | ||
s|_NULL_MDL|${null}|g; | ||
s|_OUT_PRFX|${outprefix}|g; | ||
s|_STRT_END|${includesnps}|g; | ||
s|_SNP_CUT_|${snpthres}|g; | ||
s|_GEN_CUT_|${genethres}|g; | ||
s|_SIG_BETA|${sbeta}|g; | ||
s|_CHRM_NUM|${chrm}|g; | ||
s|_MAF_FILE|${maffile}|g; | ||
s|_EXT_FLAG|\"${extraflags}\"|g; | ||
" ${bsubdir}/tejaas.bsub > ${jobsubdir}/${jobname}.bsub | ||
|
||
submit_job ${jobsubdir} ${jobname} ${thisjobdep} | ||
jobdeps=`add_deps "${jobdeps}" ${jobname}` | ||
done | ||
eval $__jobdeps="'$jobdeps'" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,65 @@ | ||
#!/bin/bash | ||
|
||
THISMETHOD="tejaas" | ||
THISJOBDEPS="" | ||
THISJOBDEPS="None" | ||
|
||
source ${UTILSDIR}/submit_tejaas | ||
|
||
for CHRM in ${CHRNUMS}; do | ||
GENOTYPEFILE=${GENO_FMT/\[CHRM\]/${CHRM}} | ||
TOTALSNPS=`zcat ${GENOTYPEFILE} | wc -l` | ||
NJOBS=$(echo $(( TOTALSNPS/MAX_NSNP_PERJOB ))) | ||
MAF_1KG_FILE=${MAF_1KG_FMT/\[CHRM\]/${CHRM}} | ||
|
||
for NULL in ${TEJAAS_NULL}; do | ||
for SBETA in ${TEJAAS_SIGMA_BETA}; do | ||
if [ "${RUNJPA}" = "true" ]; then | ||
METHOD_VARIANT="jpa" | ||
SPECIFIC_JOBSUBDIR="${JOBSUBDIR_DATA}/${THISMETHOD}/${METHOD_VARIANT}/chr${CHRM}" | ||
SPECIFIC_OUTDIR="${OUTDIR_DATA}/${THISMETHOD}/${METHOD_VARIANT}/chr${CHRM}" | ||
|
||
METHOD_VARIANT="${NULL}null_sb${SBETA}" | ||
SPECIFIC_JOBSUBDIR="${JOBSUBDIR_DATA}/${THISMETHOD}/${METHOD_VARIANT}/chr${CHRM}" | ||
SPECIFIC_OUTDIR="${OUTDIR_DATA}/${THISMETHOD}/${METHOD_VARIANT}/chr${CHRM}" | ||
EXTRAFLAGS="--dosage" | ||
if [ "${DATATYPE}" = "cardiogenics" ]; then | ||
EXTRAFLAGS="$EXTRAFLAGS --trim" | ||
fi | ||
|
||
if [ -d ${SPECIFIC_JOBSUBDIR} ]; then rm -rf ${SPECIFIC_JOBSUBDIR}; fi; mkdir -p ${SPECIFIC_JOBSUBDIR} | ||
if [ ! -d ${SPECIFIC_OUTDIR} ]; then mkdir -p ${SPECIFIC_OUTDIR}; fi | ||
|
||
JOBPREFIX="${THISMETHOD}_${METHOD_VARIANT}_${MDATA}_chr${CHRM}_${RANDSTRING}" | ||
|
||
for (( JOB=0; JOB <= ${NJOBS}; JOB++ )); do | ||
INDEX=`echo ${JOB} | awk '{printf "%03d", $1}'` | ||
JOBNAME="${JOBPREFIX}_${INDEX}" | ||
|
||
STARTSNP=$(( MAX_NSNP_PERJOB * JOB + 1 )) | ||
ENDSNP=$(( MAX_NSNP_PERJOB * (JOB+1) )) | ||
if [ $ENDSNP -gt $TOTALSNPS ]; then | ||
ENDSNP=${TOTALSNPS} | ||
fi | ||
INCSNP="${STARTSNP}:${ENDSNP}" | ||
|
||
OUTPREFIX="${SPECIFIC_OUTDIR}/chunk${INDEX}" | ||
JOBPREFIX="${THISMETHOD}_${METHOD_VARIANT}_${MDATA}_chr${CHRM}_${RANDSTRING}" | ||
|
||
submit_tejaas ${TEJAAS} ${CHRM} ${GENOTYPEFILE} ${EXPRESSIONFILE} ${SAMPLEFILE} \ | ||
${GENEINFOFILE} ${MAF_1KG_FILE} \ | ||
jpa perm \ | ||
${TEJAAS_SNPS_THRES} ${TEJAAS_GENE_THRES} 0.01 \ | ||
"${EXTRAFLAGS}" \ | ||
${SPECIFIC_JOBSUBDIR} ${SPECIFIC_OUTDIR} ${JOBPREFIX} \ | ||
${MAX_NSNP_PERJOB} \ | ||
${THISJOBDEPS} ${MASTER_BSUBDIR} \ | ||
JOBDEPS "${JOBDEPS}" | ||
|
||
else | ||
for NULL in ${TEJAAS_NULL}; do | ||
for SBETA in ${TEJAAS_SIGMA_BETA}; do | ||
|
||
METHOD_VARIANT="${NULL}null_sb${SBETA}" | ||
SPECIFIC_JOBSUBDIR="${JOBSUBDIR_DATA}/${THISMETHOD}/${METHOD_VARIANT}/chr${CHRM}" | ||
SPECIFIC_OUTDIR="${OUTDIR_DATA}/${THISMETHOD}/${METHOD_VARIANT}/chr${CHRM}" | ||
|
||
EXTRAFLAGS="--dosage" | ||
if [ "${DATATYPE}" = "cardiogenics" ]; then | ||
EXTRAFLAGS="$EXTRAFLAGS --trim" | ||
fi | ||
|
||
# create the job submission file | ||
sed "s|_JOB_NAME|${JOBNAME}|g; | ||
s|_TJS_BINR|${TEJAAS}|g; | ||
s|_GT_FILE_|${GENOTYPEFILE}|g; | ||
s|_SAM_FILE|${SAMPLEFILE}|g; | ||
s|_EXPR_FL_|${EXPRESSIONFILE}|g; | ||
s|_GEN_POSF|${GENEINFOFILE}|g; | ||
s|_TJ_METHD|${TEJAAS_MODEL}|g; | ||
s|_NULL_MDL|${NULL}|g; | ||
s|_OUT_PRFX|${OUTPREFIX}|g; | ||
s|_STRT_END|${INCSNP}|g; | ||
s|_SNP_CUT_|${TEJAAS_SNPS_THRES}|g; | ||
s|_GEN_CUT_|${TEJAAS_GENE_THRES}|g; | ||
s|_SIG_BETA|${SBETA}|g; | ||
s|_CHRM_NUM|${CHRM}|g; | ||
s|_MAF_FILE|${MAF_1KG_FILE}|g; | ||
s|_EXT_FLAG|\"${EXTRAFLAGS}\"|g; | ||
" ${MASTER_BSUBDIR}/tejaas.bsub > ${SPECIFIC_JOBSUBDIR}/${JOBNAME}.bsub | ||
|
||
submit_job ${SPECIFIC_JOBSUBDIR} ${JOBNAME} ${THISJOBDEPS} | ||
JOBDEPS=`add_deps "${JOBDEPS}" ${JOBNAME}` | ||
|
||
JOBPREFIX="${THISMETHOD}_${METHOD_VARIANT}_${MDATA}_chr${CHRM}_${RANDSTRING}" | ||
|
||
submit_tejaas ${TEJAAS} ${CHRM} ${GENOTYPEFILE} ${EXPRESSIONFILE} ${SAMPLEFILE} \ | ||
${GENEINFOFILE} ${MAF_1KG_FILE} \ | ||
${TEJAAS_MODEL} ${NULL} \ | ||
${TEJAAS_SNPS_THRES} ${TEJAAS_GENE_THRES} ${SBETA}\ | ||
"${EXTRAFLAGS}" \ | ||
${SPECIFIC_JOBSUBDIR} ${SPECIFIC_OUTDIR} ${JOBPREFIX} \ | ||
${MAX_NSNP_PERJOB} \ | ||
${THISJOBDEPS} ${MASTER_BSUBDIR} \ | ||
JOBDEPS "${JOBDEPS}" | ||
|
||
done | ||
done | ||
done | ||
|
||
fi | ||
done | ||
|
||
RUNJPA=false |