From 06a445c3e7f12793d10b6cb29b3ba3d416099ea0 Mon Sep 17 00:00:00 2001 From: Chris Moth Date: Wed, 14 Jul 2021 11:53:18 -0500 Subject: [PATCH] Update clinvar SQL load slurm file to load per chromosome #25 --- slurm/load_clinvar.slurm | 47 +++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/slurm/load_clinvar.slurm b/slurm/load_clinvar.slurm index a026584..5d06f3c 100755 --- a/slurm/load_clinvar.slurm +++ b/slurm/load_clinvar.slurm @@ -1,29 +1,56 @@ #!/bin/sh # -# Project : PDBMap-v13 +# Project : PDBMap # Filename : load_clinvar.slurm -# Author : R. Michael Sivley +# Author : R. Michael Sivley; updated Chris Moth June 2020 # Organization : Vanderbilt Genetics Institute, # : Department of Biomedical Informatics, # : Vanderbilt University -# Email : mike.sivley@vanderbilt.edu -# Date : 2015-12-28 +# Email : chris.moth@vanderbilt.edu +# Date : 2021-07-09 +# Description : Load each chromosome of clinvar variants separately, in parallel # Description : Loads latest ClinVar release into PDBMap. # : sbatch load_clinvar.slurm +# +# This script depends on the presence of (recently) downloaded clinvar .vcf files #=============================================================================# -# Slurm Parameters +# Slurm Parameters - tailor to your cluster, account, etc. #SBATCH -J Load_ClinVar -#SBATCH --mail-user=mike.sivley@vanderbilt.edu +#SBATCH --mail-user=chris.moth@vanderbilt.edu #SBATCH --mail-type=end #SBATCH --ntasks=1 #SBATCH --time=5-0 -#SBATCH --mem=50GB +#SBATCH --mem=32GB #SBATCH -o load_clinvar/load_clinvar.%A[%a].out +#SBATCH -e load_clinvar/load_clinvar.%A[%a].err +#SBATCH --array=1-24 #=============================================================================# -cd pdbmap # move into pdbmap main directory -fname="/dors/capra_lab/data/clinvar/clinvar.vcf.gz" +source /dors/capra_lab/users/mothcw/psbadmin/psb_prep.bash +cd $psbbin/../pdbmap # move into pdbmap main directory +# fname="/dors/capra_lab/data/clinvar/clinvar.vcf.gz" +fbase="/dors/capra_lab/data/clinvar/2021-07-07/GRCh38/clinvar_20210626.chr" +ftail=".vcf" +if (( ${SLURM_ARRAY_TASK_ID} > 1000000 )); then +echo "You must start this slurm array script with --array=1-24" +exit 1 +fi + +echo $warning # Syntax for autosomal chromosomes -./pdbmap.py -c config/v13.config --dlabel=clinvar load_data ${fname} +# Launch this script with sbatch --array=1-24 to populate the SLURM_ARRAY_TASK_ID +chr=${SLURM_ARRAY_TASK_ID} + +if (( $chr == 23 )); then +chr='X' +elif (( $chr == 24 )); then +chr='Y' +fi + +# Syntax for autosomal chromosomes +logfile="--logfile=slurm/load_clinvar/load_clinvar.${chr}.log" +runcmd="./pdbmap.py -c $UDN/config/global.config ${logfile} load_vcf --dlabel clinvar ${fbase}${chr}${ftail}" +echo "Executing $runcmd" +`$runcmd`