-
Notifications
You must be signed in to change notification settings - Fork 4
/
pgstoolkit.prep.list_variants.run.sh
34 lines (31 loc) · 1.35 KB
/
pgstoolkit.prep.list_variants.run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
# Load the required conda environment and check if conda activate was successful
echo "Loading required mamba environment containing the pgstoolkit installation..."
eval "$(conda shell.bash hook)"
conda activate pgstoolkit
if [ $? -ne 0 ]; then
echo "Error: Failed to activate pgstoolkit environment." >&2
exit 1
fi
echo "> Checking existence of relevant apps..."
bgenix -help
bcftools --version
vcftools --version
samtools --version
# Array job: list variants
CHR=${SLURM_ARRAY_TASK_ID} # The chromosome number automatically assigned by SLURM
STUDYDIR=$1
# Set variables - for manual per chromosome individual job version
# CHR=$1 # The chromosome number
# STUDYDIR=$2
# List the variants
# 8 bit
bgenix -g ${STUDYDIR}/aegscombo.topmed_r3_f10_b38.split_norm_af_filter.8bit.chr${CHR}.bgen \
-i ${STUDYDIR}/aegscombo.topmed_r3_f10_b38.split_norm_af_filter.8bit.chr${CHR}.bgen.bgi \
-list | grep -v "#" > ${STUDYDIR}/aegscombo.topmed_r3_f10_b38.split_norm_af_filter.8bit.chr${CHR}.variantlist.txt;
# 16 bit
bgenix -g ${STUDYDIR}/aegscombo.topmed_r3_f10_b38.split_norm_af_filter.16bit.chr${CHR}.bgen \
-i ${STUDYDIR}/aegscombo.topmed_r3_f10_b38.split_norm_af_filter.16bit.chr${CHR}.bgen.bgi \
-list | grep -v "#" > ${STUDYDIR}/aegscombo.topmed_r3_f10_b38.split_norm_af_filter.16bit.chr${CHR}.variantlist.txt;
# Deactivate the conda environment
conda deactivate