Skip to content

Instantly share code, notes, and snippets.

@nievergeltlab
Last active May 25, 2021 20:00
Show Gist options
  • Save nievergeltlab/2f9276929cca204520a23f23b88a36ae to your computer and use it in GitHub Desktop.
Save nievergeltlab/2f9276929cca204520a23f23b88a36ae to your computer and use it in GitHub Desktop.
IF you want to run batches of jobs on a single node, but need multiple runs (e.g. 6 core processor, but 20 processes to run), this is a mostly efficient way to achieve this. Not as good as a dedicated system, but close as long as jobs are equal in ru
inc1=0
inc2=0
while [ $inc1 -le 100 ]
do
inc1=$(($inc2 + 1))
inc2=$((inc1 + 5))
echo $inc1 $inc2
for i in $(seq $inc1 1 $inc2 )
do
Rscript 03_genes_simple.sh \
cnv_plink/ukbb_sample_qced_kb5_sites5_frq01.fam \
phenocov/UKB_ptsd_eur_unrelated_m0_july7_2020.pheno \
phenocov/covarites_metrics.csv \
gene_level/gene_"$i".txt \
output_gene_level/ukbbglm.gene_"$i".txt \
PCL_sum_imp &
done
wait
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment