2 #-------------------------------------------------------------------------------------------------------------------------------
5 # generate_indiv_vcfs.sh
8 # Shell script for creating multiple versions of individual VCF files from a single multivcf and imputed dosage file.
10 # ./generate_indiv_vcfs.sh -v [multivcf file] -d [dosage file]
12 # To run, this script requires create_indiv.pl
14 #-------------------------------------------------------------------------------------------------------------------------------
17 #--------------------------------------------------------------------------------
18 # 1 Parse command line arguments:
19 #-------------------------------------------------------------------------------
36 echo MULTI_VCF
= "$MULTI_VCF"
37 echo DOSAGE
= "$DOSAGE"
38 if [ -z "$MULTI_VCF" ] ||
[ -z "$DOSAGE" ]
40 echo "Trouble reading command line arguments, make sure
41 -v [multi vcf file] and
42 -d [dosage file] are both specified";
47 #----------------------------------------------------------------------------------
48 # 2 create a nearly empty vcf file for each accession in the multi-vcf
49 #----------------------------------------------------------------------------------
51 echo Creating starter vcf files...
55 .
/create_indiv.pl
-v $MULTI_VCF -o output
57 #--------------------------------------------------------------------------------
58 # 3 add genotype data to complete indiv vcf files. then generate filt and imputed files too. Requires long operations, so do it in parallel to speed it up
59 #-------------------------------------------------------------------------------
61 ls output
/* | parallel
-j 30 --gnu --verbose "./finish_indiv.pl -v $MULTI_VCF -d $DOSAGE -f {}"