Created
August 29, 2017 15:17
-
-
Save nievergeltlab/3ccff9b29140bdd0855ef06e314781da to your computer and use it in GitHub Desktop.
Dosage to best guess, handler for ricopili script, to correct best guess to include low freq variants
This file contains hidden or 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
| #PBS -lnodes=1 | |
| #PBS -lwalltime=02:05:00 | |
| #!/bin/bash | |
| #Make walltime a function of N? | |
| while getopts i:f:o:p:d:n: option | |
| do | |
| case "${option}" | |
| in | |
| i) indir=${OPTARG};; | |
| f) file_list=${OPTARG};; | |
| p) plinkloc=${OPTARG};; | |
| d) outdir=${OPTARG};; | |
| n) nodeuse=${OPTARG};; | |
| esac | |
| done | |
| #Write the start and stop points of the file | |
| jstart=$((($PBS_ARRAYID-1)*$nodeuse +1)) | |
| jstop=$(($PBS_ARRAYID*$nodeuse)) | |
| for j in $(seq -w $jstart 1 $jstop) | |
| do | |
| file_use=$(awk -v lineno=$j '{if(NR==lineno) print}' $file_list) | |
| perl /home/maihofer/ricopili/rp_bin_manc/daner_bg3_am $file_use --freq_th 0 --info_th 0.02 --ploc $plinkloc --indir $indir --outdir $outdir & | |
| done | |
| wait | |
This file contains hidden or 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
| #Specify where probability format genotypes are stored | |
| probdir=/home/maihofer/yehuda/WRBY/qc/imputation/dasuqc1_pts_wrby_mix_am-qc.hg19.ch.fl/qc1 | |
| #Specify where output will be stored | |
| outdir=/home/maihofer/yehuda/WRBY/test | |
| #Specify working directory (error logs will go here) | |
| workingdir=/home/maihofer/yehuda/WRBY | |
| ls $probdir | grep .gz$ > files_to_make_dose.txt | |
| #Number of commands to run is a function of the number of files | |
| ncommands=$(wc -l files_To_make_dose.txt | awk '{print $1}' ) | |
| #Make a job code, where 'nodesize' processes will run on each node simultaneously | |
| nodesize=16 | |
| nodeuse=$(($nodesize - 1)) | |
| #Total number of jobs = Number of commands / number of commands used per job, rounded up | |
| totjobs=$(( ($ncommands + $nodeuse - 1 ) / $nodeuse )) | |
| qsub bg_fix.pbs -t 1-$totjobs -d $workingdir -F "-f files_To_make_dose.txt -d $outdir -i $probdir -n $nodeuse -p /home/maihofer/yehuda/plink" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment