changeset 8:d6af2a78617f draft

added support for databases upto 4 march 2016
author saskia-hiltemann
date Fri, 04 Mar 2016 11:32:50 -0500
parents 69e2067a120d
children f7ff063c738e
files tools/annovar/annovar.sh tools/annovar/annovar.xml
diffstat 2 files changed, 1546 insertions(+), 1410 deletions(-) [+]
line wrap: on
line diff
--- a/tools/annovar/annovar.sh	Tue Oct 27 11:01:10 2015 -0400
+++ b/tools/annovar/annovar.sh	Fri Mar 04 11:32:50 2016 -0500
@@ -4,169 +4,168 @@
 dofilter="N"
 
 #########################
-#	   DEFINE SOME
-#	    FUNCTIONS
+#       DEFINE SOME
+#        FUNCTIONS
 #########################
 
 function usage(){
-	echo "usage: $0 todo"
+    echo "usage: $0 todo"
 }
 
 function runfilter(){
-	ifile=$1	
-	columnname=$2
-	threshold=$3
+    ifile=$1
+    columnname=$2
+    threshold=$3
 
-	if [[ $threshold == "-1" ]]
-	then
-		echo "not filtering"
-		return
-	fi
-	
-	echo "filtering: $columnname, $threshold"
-	cat $ifile
+    if [[ $threshold == "-1" ]]
+    then
+        echo "not filtering"
+        return
+    fi
+    
+    echo "filtering: $columnname, $threshold"
+    cat $ifile
 
-	#get column number corresponding to column header
-	column=`awk 'BEGIN{
-					FS="\t";
-					col=-1
-				}{
-					if(FNR==1){
-						for(i=1;i<=NF;i++){
-							if($i == "'"${columnname}"'") 
-								col=i 
-						} 
-						print col 
-					}
-				}' $ifile `
+    #get column number corresponding to column header
+    column=`awk 'BEGIN{
+                    FS="\t";
+                    col=-1
+                }{
+                    if(FNR==1){
+                        for(i=1;i<=NF;i++){
+                            if($i == "'"${columnname}"'") 
+                                col=i 
+                        } 
+                        print col 
+                    }
+                }' $ifile `
 
-	if [ $column == -1 ]
-	then
-		echo "no such column, exiting"
-		return
-	fi	
+    if [ $column == -1 ]
+    then
+        echo "no such column, exiting"
+        return
+    fi
 
-	#perform filtering using the threshold
-	awk 'BEGIN{
-		FS="\t";
-		OFS="\t";
-	}{
-		if(FNR==1) 
-			print $0; 
-		if(FNR>1){
-			if( $"'"${column}"'" == "" )  # empty column, then print
-				print $0
-			else if ("'"${threshold}"'" == "text"){}  #if set to text dont check threshold
-				
-			else if ($"'"${column}"'" < "'"${threshold}"'")  #else do check it
-				print $0	
-		}
-	}' $ifile > tmpfile
+    #perform filtering using the threshold
+    awk 'BEGIN{
+        FS="\t";
+        OFS="\t";
+    }{
+        if(FNR==1) 
+            print $0; 
+        if(FNR>1){
+            if( $"'"${column}"'" == "" )  # empty column, then print
+                print $0
+            else if ("'"${threshold}"'" == "text"){}  #if set to text dont check threshold
 
-	mv tmpfile $ifile	
+            else if ($"'"${column}"'" < "'"${threshold}"'")  #else do check it
+                print $0
+        }
+    }' $ifile > tmpfile
+
+    mv tmpfile $ifile    
 }
 
 # arguments: originalfile,resultfile,chrcol,startcol,endcol,refcol,obscol,addcols
 function joinresults(){
-	ofile=$1
-	rfile=$2
-	colchr=$3
-	colstart=$4
-	colend=$5
-	colref=$6
-	colobs=$7
-	addcols=$8 #e.g. "B.col1,B.col2"
-	
-	test="N"
-	
-	# echo "joining result with original file"
-	if [ $test == "Y" ]
-	then 	
-		echo "ofile: $ofile"
-		head $ofile 
-		echo "rfile: $rfile"
-		head $rfile
-	fi
-	numlines=`wc $rfile | cut -d" " -f2`
-	
-	# if empty results file, just add header fields
-	if [[ ! -s $rfile ]] 
-	then			
-		dummycol=${addcols:2}
-		outputcol=${dummycol//",B."/"	"}
-		numcommas=`echo "$addcols" | grep -o "," | wc -l`		
-		
-		awk 'BEGIN{FS="\t";OFS="\t"}{
-				if(FNR==1)
-					print $0,"'"$outputcol"'"; 
-				else{
-					printf $0
-					for(i=0;i<="'"$numcommas"'"+1;i++)
-						printf "\t"
-					printf "\n"
-				}
-			}END{}' $ofile > tempofile
-			
-			mv tempofile $ofile		
-		return
-	fi
-	
+    ofile=$1
+    rfile=$2
+    colchr=$3
+    colstart=$4
+    colend=$5
+    colref=$6
+    colobs=$7
+    addcols=$8 #e.g. "B.col1,B.col2"
+
+    test="N"
+
+    # echo "joining result with original file"
+    if [ $test == "Y" ]
+    then
+        echo "ofile: $ofile"
+        head $ofile 
+        echo "rfile: $rfile"
+        head $rfile
+    fi
+    numlines=`wc $rfile | cut -d" " -f2`
+
+    # if empty results file, just add header fields
+    if [[ ! -s $rfile ]] 
+    then
+        dummycol=${addcols:2}
+        outputcol=${dummycol//",B."/"   "}
+        numcommas=`echo "$addcols" | grep -o "," | wc -l`
+
+        awk 'BEGIN{FS="\t";OFS="\t"}{
+                if(FNR==1)
+                    print $0,"'"$outputcol"'"; 
+                else{
+                    printf $0
+                    for(i=0;i<="'"$numcommas"'"+1;i++)
+                        printf "\t"
+                    printf "\n"
+                }
+            }END{}' $ofile > tempofile
+
+            mv tempofile $ofile
+        return
+    fi
+
 
-	#get input file column names for cgatools join
-	col_chr_name=`head -1  $rfile | cut -f${colchr}`
-	col_start_name=`head -1  $rfile | cut -f${colstart}`
-	col_end_name=`head -1  $rfile | cut -f${colend}`
-	col_ref_name=`head -1  $rfile | cut -f${colref}`
-	col_obs_name=`head -1  $rfile | cut -f${colobs}`
+    #get input file column names for cgatools join
+    col_chr_name=`head -1  $rfile | cut -f${colchr}`
+    col_start_name=`head -1  $rfile | cut -f${colstart}`
+    col_end_name=`head -1  $rfile | cut -f${colend}`
+    col_ref_name=`head -1  $rfile | cut -f${colref}`
+    col_obs_name=`head -1  $rfile | cut -f${colobs}`
 
-	#get annotation file column names for cgatools join
-	chr_name=`head -1  $ofile | cut -f${chrcol}`
-	start_name=`head -1  $ofile | cut -f${startcol}`
-	end_name=`head -1  $ofile | cut -f${endcol}`
-	ref_name=`head -1  $ofile | cut -f${refcol}`
-	obs_name=`head -1  $ofile | cut -f${obscol}`
+    #get annotation file column names for cgatools join
+    chr_name=`head -1  $ofile | cut -f${chrcol}`
+    start_name=`head -1  $ofile | cut -f${startcol}`
+    end_name=`head -1  $ofile | cut -f${endcol}`
+    ref_name=`head -1  $ofile | cut -f${refcol}`
+    obs_name=`head -1  $ofile | cut -f${obscol}`
 
-	if [ $test == "Y" ]	
-	then
-		echo "input file"
-		echo "chr   col: $col_chr_name ($colchr)"	
-		echo "start col: $col_start_name ($colstart)"	
-		echo "end   col: $col_end_name ($colend)"	
-		echo "ref   col: $col_ref_name ($colref)"	
-		echo "obs   col: $col_obs_name ($colobs)"	
-		echo ""
-		echo "annotation file"
-		echo "chr   col: $chr_name ($chrcol)"	
-		echo "start col: $start_name ($startcol)"	
-		echo "end   col: $end_name ($endcol)"	
-		echo "ref   col: $ref_name ($refcol)"	
-		echo "obs   col: $obs_name ($obscol)"	
-	fi
+    if [ $test == "Y" ]
+    then
+        echo "input file"
+        echo "chr   col: $col_chr_name ($colchr)"
+        echo "start col: $col_start_name ($colstart)"
+        echo "end   col: $col_end_name ($colend)"
+        echo "ref   col: $col_ref_name ($colref)"
+        echo "obs   col: $col_obs_name ($colobs)"
+        echo ""
+        echo "annotation file"
+        echo "chr   col: $chr_name ($chrcol)"
+        echo "start col: $start_name ($startcol)"
+        echo "end   col: $end_name ($endcol)"
+        echo "ref   col: $ref_name ($refcol)"
+        echo "obs   col: $obs_name ($obscol)"
+    fi
 
-	#perform join
-	cgatools join --beta \
-		--input $ofile $rfile \
-		--output temporiginal \
-		--match ${chr_name}:${col_chr_name} \
-		--match ${start_name}:${col_start_name} \
-		--match ${end_name}:${col_end_name} \
-		--match ${ref_name}:${col_ref_name} \
-		--match ${obs_name}:${col_obs_name} \
-		--select A.*,$addcols \
-		--always-dump \
-		--output-mode compact 
+    #perform join
+    cgatools join --beta \
+        --input $ofile $rfile \
+        --output temporiginal \
+        --match ${chr_name}:${col_chr_name} \
+        --match ${start_name}:${col_start_name} \
+        --match ${end_name}:${col_end_name} \
+        --match ${ref_name}:${col_ref_name} \
+        --match ${obs_name}:${col_obs_name} \
+        --select A.*,$addcols \
+        --always-dump \
+        --output-mode compact
 
-	#replace originalfile
-	sed -i 's/^>//g' temporiginal #join sometimes adds a '>' symbol to header
-	mv temporiginal originalfile
-		
-	if [ $test == "Y" ]
-	then
-		echo "joining complete"
-		head originalfile
-		echo ""	
-	fi
-	
+    #replace originalfile
+    sed -i 's/^>//g' temporiginal #join sometimes adds a '>' symbol to header
+    mv temporiginal originalfile
+        
+    if [ $test == "Y" ]
+    then
+        echo "joining complete"
+        head originalfile
+        echo ""
+    fi
 }
 
 
@@ -174,12 +173,12 @@
 
 #################################
 #
-#	   PARSE PARAMETERS
+#       PARSE PARAMETERS
 #
 #################################
 
 
-set -- `getopt -n$0 -u -a --longoptions="inputfile: buildver: humandb: varfile: VCF: chrcol: startcol: endcol: refcol: obscol: vartypecol: convertcoords: geneanno: hgvs: verdbsnp: tfbs: mce: cytoband: segdup: dgv: gwas: ver1000g: cg46: cg69: impactscores: newimpactscores: otherinfo: esp: exac03: spidex: gonl: gerp: cosmic61: cosmic63: cosmic64: cosmic65: cosmic67: cosmic68: clinvar: nci60: outall: outfilt: outinvalid: scriptsdir: dorunannovar: dofilter: filt_dbsnp: filt1000GALL: filt1000GAFR: filt1000GAMR: filt1000GASN: filt1000GEUR: filtESP6500ALL: filtESP6500EA: filtESP6500AA: filtcg46: filtcg69: dummy:" "h:" "$@"` || usage
+set -- `getopt -n$0 -u -a --longoptions="inputfile: buildver: humandb: varfile: VCF: chrcol: startcol: endcol: refcol: obscol: vartypecol: convertcoords: geneanno: hgvs: verdbsnp: tfbs: mce: cytoband: segdup: dgv: gwas: ver1000g: cg46: cg69: impactscores: newimpactscores: otherinfo: esp: exac03: exac03nonpsych: exac03nontcga: dbscsnv11: kaviar_20150923: hrcr1: mitimpact2: mitimpact24: dbnsfp30a: spidex: gonl: gerp: cosmic61: cosmic63: cosmic64: cosmic65: cosmic67: cosmic68: clinvar: nci60: outall: outfilt: outinvalid: scriptsdir: dorunannovar: dofilter: filt_dbsnp: filt1000GALL: filt1000GAFR: filt1000GAMR: filt1000GASN: filt1000GEUR: filtESP6500ALL: filtESP6500EA: filtESP6500AA: filtcg46: filtcg69: dummy:" "h:" "$@"` || usage
 [ $# -eq 0 ] && usage
 
 
@@ -187,66 +186,74 @@
 while [ $# -gt 0 ]
 do
     case "$1" in
-       	--inputfile)      			infile=$2;shift;;  # inputfile
-		--buildver)					buildvertmp=$2;shift;; # hg18 or hg19
-		--humandb)					humandbtmp=$2;shift;; # location of humandb database
-	 	--varfile)      			varfile=$2;shift;; # Y or N  
-		--VCF)						vcf=$2;shift;; #Y or N
-		--chrcol)      				chrcol=$2;shift;;  # which column has chr 
-		--startcol)      			startcol=$2;shift;;  # which column has start
-		--endcol)      				endcol=$2;shift;;  # which column has end
-		--refcol)      				refcol=$2;shift;;  # which column has ref
-		--obscol)      				obscol=$2;shift;;  # which column has alt
-		--vartypecol)      			vartypecol=$2;shift;;  # which column has vartype
-		--convertcoords)			convertcoords=$2;shift;;  # Y or N convert coordinate from CG to 1-based?		
-		--geneanno)      			geneanno=$2;shift;; # comma-separated list of strings refSeq, knowngene, ensgene  
-		--hgvs)						hgvs=$2;shift;;
-		--verdbsnp)					verdbsnp=$2;shift;; #comma-separated list of dbsnp version to annotate with (e.g. "132,135NonFlagged,137,138")"
-		--tfbs)      				tfbs=$2;shift;; 	# Y or N 
-		--mce)      				mce=$2;shift;; 	# Y or N 
-		--cytoband)      			cytoband=$2;shift;; # Y or N  
-		--segdup)      				segdup=$2;shift;; 	# Y or N 				
-        --dgv)      				dgv=$2;shift;; 	# Y or N 
-		--gwas)      				gwas=$2;shift;; 	# Y or N 
-		--ver1000g) 				ver1000g=$2;shift;; 	# Y or N 
-		--cg46)						cg46=$2;shift;;
-		--cg69)						cg69=$2;shift;;		
-		--impactscores)      		impactscores=$2;shift;; # Y or N 
-		--newimpactscores)      	newimpactscores=$2;shift;; # Y or N 
-		--otherinfo)				otherinfo=$2;shift;; 
-		--scriptsdir)	      		scriptsdirtmp=$2;shift;; # Y or N 
-		--esp)      				esp=$2;shift;; 	# Y or N 
-		--exac03)                   exac03=$2;shift;;
-		--gonl)                     gonl=$2;shift;;
-		--spidex)                   spidex=$2;shift;;
-		--gerp)      				gerp=$2;shift;; 	# Y or N 
-		--cosmic61)					cosmic61=$2;shift;;  # Y or N
-		--cosmic63)					cosmic63=$2;shift;;  # Y or N
-		--cosmic64)					cosmic64=$2;shift;;  # Y or N
-		--cosmic65)					cosmic65=$2;shift;;  # Y or N
-		--cosmic67)					cosmic67=$2;shift;;  # Y or N
-		--cosmic68)					cosmic68=$2;shift;;  # Y or N
-		--nci60)					nci60=$2;shift;;  # Y or N
-		--clinvar)					clinvar=$2;shift;;  # Y or N
-		--filt_dbsnp)				filt_dbsnp=$2;shift;;
-		--filt1000GALL)				threshold_1000g_ALL=$2;shift;; #threshold value
-		--filt1000GAFR)				threshold_1000g_AFR=$2;shift;; #threshold value
-		--filt1000GAMR)				threshold_1000g_AMR=$2;shift;; #threshold value
-		--filt1000GASN)				threshold_1000g_ASN=$2;shift;; #threshold value
-		--filt1000GEUR)				threshold_1000g_EUR=$2;shift;; #threshold value
-		--filtESP6500ALL)			threshold_ESP6500_ALL=$2;shift;; #threshold value
-		--filtESP6500EA)			threshold_ESP6500_EA=$2;shift;; #threshold value
-		--filtESP6500AA)			threshold_ESP6500_AA=$2;shift;; #threshold value
-		--filtcg46)					threshold_cg46=$2;shift;;
-		--filtcg69)					threshold_cg69=$2;shift;;
-		--outall)      				outfile_all=$2;shift;; # file 
-		--outfilt)      			outfile_filt=$2;shift;; # file
-		--outinvalid)				outfile_invalid=$2;shift;; #file
-		--dorunannovar)				dorunannovar=$2;shift;; 	#Y or N		
-       -h)        	shift;;
-	   --)        	shift;break;;
-       -*)        	usage;;
-       *)         	break;;            
+        --inputfile)           infile=$2;shift;;      # inputfile
+        --buildver)            buildvertmp=$2;shift;; # hg18 or hg19
+        --humandb)             humandbtmp=$2;shift;;  # location of humandb database
+        --varfile)             varfile=$2;shift;;     # Y or N  
+        --VCF)                 vcf=$2;shift;;         #Y or N
+        --chrcol)              chrcol=$2;shift;;      # which column has chr 
+        --startcol)            startcol=$2;shift;;    # which column has start coord
+        --endcol)              endcol=$2;shift;;      # which column has end coord
+        --refcol)              refcol=$2;shift;;      # which column has ref allele
+        --obscol)              obscol=$2;shift;;      # which column has alt allele
+        --vartypecol)          vartypecol=$2;shift;;  # which column has vartype
+        --convertcoords)       convertcoords=$2;shift;;  # Y or N convert coordinate from CG to 1-based?
+        --geneanno)            geneanno=$2;shift;;    # comma-separated list of strings refSeq, knowngene, ensgene
+        --hgvs)                hgvs=$2;shift;;
+        --verdbsnp)            verdbsnp=$2;shift;;    #comma-separated list of dbsnp version to annotate with (e.g. "132,135NonFlagged,137,138")"
+        --tfbs)                tfbs=$2;shift;;        # Y or N 
+        --mce)                 mce=$2;shift;;         # Y or N 
+        --cytoband)            cytoband=$2;shift;;    # Y or N  
+        --segdup)              segdup=$2;shift;;      # Y or N 
+        --dgv)                 dgv=$2;shift;;         # Y or N 
+        --gwas)                gwas=$2;shift;;        # Y or N 
+        --ver1000g)            ver1000g=$2;shift;;    # Y or N 
+        --cg46)                cg46=$2;shift;;        # Y or N
+        --cg69)                cg69=$2;shift;;        # Y or N
+        --impactscores)        impactscores=$2;shift;;    # Y or N 
+        --newimpactscores)     newimpactscores=$2;shift;; # Y or N 
+        --otherinfo)           otherinfo=$2;shift;;       # display additional columns?
+        --scriptsdir)          scriptsdirtmp=$2;shift;;   # Y or N 
+        --esp)                 esp=$2;shift;;             # Y or N 
+        --exac03)              exac03=$2;shift;;          # Y or N
+        --exac03nonpsych)      exac03nonpsych=$2;shift;;  # Y or N
+        --exac03nontcga)       exac03nontcga=$2;shift;;   # Y or N
+        --dbscsnv11)           dbscsnv11=$2;shift;;
+        --kaviar_20150923)     kaviar_20150923=$2;shift;;
+        --hrcr1)               hrcr1=$2;shift;;
+        --mitimpact2)          mitimpact2=$2;shift;;
+        --mitimpact24)         mitimpact24=$2;shift;;
+        --dbnsfp30a)           dbnsfp30a=$2;shift;;
+        --gonl)                gonl=$2;shift;;        # Y or N
+        --spidex)              spidex=$2;shift;;      # Y or N
+        --gerp)                gerp=$2;shift;;        # Y or N
+        --cosmic61)            cosmic61=$2;shift;;    # Y or N
+        --cosmic63)            cosmic63=$2;shift;;    # Y or N
+        --cosmic64)            cosmic64=$2;shift;;    # Y or N
+        --cosmic65)            cosmic65=$2;shift;;    # Y or N
+        --cosmic67)            cosmic67=$2;shift;;    # Y or N
+        --cosmic68)            cosmic68=$2;shift;;    # Y or N
+        --nci60)               nci60=$2;shift;;       # Y or N
+        --clinvar)             clinvar=$2;shift;;     # Y or N
+        --filt_dbsnp)          filt_dbsnp=$2;shift;;  # Y or N
+        --filt1000GALL)        threshold_1000g_ALL=$2;shift;;   #threshold value
+        --filt1000GAFR)        threshold_1000g_AFR=$2;shift;;   #threshold value
+        --filt1000GAMR)        threshold_1000g_AMR=$2;shift;;   #threshold value
+        --filt1000GASN)        threshold_1000g_ASN=$2;shift;;   #threshold value
+        --filt1000GEUR)        threshold_1000g_EUR=$2;shift;;   #threshold value
+        --filtESP6500ALL)      threshold_ESP6500_ALL=$2;shift;; #threshold value
+        --filtESP6500EA)       threshold_ESP6500_EA=$2;shift;;  #threshold value
+        --filtESP6500AA)       threshold_ESP6500_AA=$2;shift;;  #threshold value
+        --filtcg46)            threshold_cg46=$2;shift;;
+        --filtcg69)            threshold_cg69=$2;shift;;
+        --outall)              outfile_all=$2;shift;;     # file 
+        --outfilt)             outfile_filt=$2;shift;;    # file
+        --outinvalid)          outfile_invalid=$2;shift;; #file
+        --dorunannovar)        dorunannovar=$2;shift;;    #Y or N
+       -h)            shift;;
+       --)            shift;break;;
+       -*)            usage;;
+       *)             break;;
     esac
     shift
 done
@@ -259,48 +266,47 @@
 
 if [ $test == "Y" ]
 then
-	echo "dorunannovar: $dorunannovar"
-	echo "infile: $infile"
-	echo "buildver: $buildver"
-	echo "annovardb: $humandb"
-	echo "verdbnsp: $verdbsnp"
-	echo "geneanno: $geneanno"
-	echo "tfbs: $tfbs"
-	echo "mce: $mce"
-	echo "cytoband: $cytoband"
-	echo "segdup: $segdup"
-	echo "dgv: $dgv"
-	echo "gwas: $gwas"	
-	echo "g1000: ${g1000}"
-	echo "cg46: ${cg46}"	
-	echo "cg69: ${cg69}"
-	echo "impactscores: $impactscores"
-	echo "impactscores: $newimpactscores"	
-	echo "esp: $esp"
-	echo "gerp: $gerp"
-	echo "cosmic: $cosmic"
-	echo "outfile: $outfile_all"
-	echo "outinvalid: $outfile_invalid"
-	echo "outfiltered: $outfile_filt"
-	echo "varfile: $varfile"
-	echo "vcf" $vcf
-	echo "chrcol: $chrcol"
-	echo "startcol: $startcol"
-	echo "endcol: $endcol"
-	echo "refcol: $refcol"
-	echo "obscol: $obscol"
-	echo "convertcoords: $convertcoords"
-	echo "vartypecol: $vartypecol"
-	echo "dofilter: $dofilter"
-	echo "threshold_1000g_ALL  : $threshold_1000g_ALL"
-	echo "threshold_1000g_AFR  : $threshold_1000g_AFR"
-	echo "threshold_1000g_AMR  : $threshold_1000g_AMR"
-	echo "threshold_1000g_ASN  : $threshold_1000g_ASN"
-	echo "threshold_1000g_EUR  : $threshold_1000g_EUR"
-	echo "threshold_ESP6500_ALL: $threshold_ESP6500_ALL"
-	echo "threshold_ESP6500_EA : $threshold_ESP6500_EA"
-	echo "threshold_ESP6500_AA : $threshold_ESP6500_AA"
-
+    echo "dorunannovar: $dorunannovar"
+    echo "infile: $infile"
+    echo "buildver: $buildver"
+    echo "annovardb: $humandb"
+    echo "verdbnsp: $verdbsnp"
+    echo "geneanno: $geneanno"
+    echo "tfbs: $tfbs"
+    echo "mce: $mce"
+    echo "cytoband: $cytoband"
+    echo "segdup: $segdup"
+    echo "dgv: $dgv"
+    echo "gwas: $gwas"
+    echo "g1000: ${g1000}"
+    echo "cg46: ${cg46}"
+    echo "cg69: ${cg69}"
+    echo "impactscores: $impactscores"
+    echo "impactscores: $newimpactscores"
+    echo "esp: $esp"
+    echo "gerp: $gerp"
+    echo "cosmic: $cosmic"
+    echo "outfile: $outfile_all"
+    echo "outinvalid: $outfile_invalid"
+    echo "outfiltered: $outfile_filt"
+    echo "varfile: $varfile"
+    echo "vcf" $vcf
+    echo "chrcol: $chrcol"
+    echo "startcol: $startcol"
+    echo "endcol: $endcol"
+    echo "refcol: $refcol"
+    echo "obscol: $obscol"
+    echo "convertcoords: $convertcoords"
+    echo "vartypecol: $vartypecol"
+    echo "dofilter: $dofilter"
+    echo "threshold_1000g_ALL  : $threshold_1000g_ALL"
+    echo "threshold_1000g_AFR  : $threshold_1000g_AFR"
+    echo "threshold_1000g_AMR  : $threshold_1000g_AMR"
+    echo "threshold_1000g_ASN  : $threshold_1000g_ASN"
+    echo "threshold_1000g_EUR  : $threshold_1000g_EUR"
+    echo "threshold_ESP6500_ALL: $threshold_ESP6500_ALL"
+    echo "threshold_ESP6500_EA : $threshold_ESP6500_EA"
+    echo "threshold_ESP6500_AA : $threshold_ESP6500_AA"
 fi
 
 
@@ -311,26 +317,26 @@
 #
 ############################################
 
-#parse geneanno param
+# parse geneanno param
 refgene="N"
 knowngene="N"
-ensgene="N"	
+ensgene="N"
 
 if [[ $geneanno =~ "refSeq" ]]
 then
-	refgene="Y"
+    refgene="Y"
 fi
 if [[ $geneanno =~ "knowngene" ]]
 then
-	knowngene="Y"
+    knowngene="Y"
 fi
 if [[ $geneanno =~ "ensgene" ]]
 then
-	ensgene="Y"
+    ensgene="Y"
 fi
 if [ $hgvs == "N" ]
 then
-	hgvs=""
+    hgvs=""
 fi
 
 #parse verdbsnp/1000g/esp strings
@@ -341,9 +347,9 @@
 
 if [ $test == "Y" ]
 then
-	echo "annotate dbsnp: $dbsnpstr"
-	echo "annotate esp:   $espstr"
-	echo "filter dbsnp: $filt_dbsnpstr"
+    echo "annotate dbsnp: $dbsnpstr"
+    echo "annotate esp:   $espstr"
+    echo "filter dbsnp: $filt_dbsnpstr"
 fi
 
 mutationtaster="N"
@@ -356,36 +362,36 @@
 #parse old impactscores param (obsolete)
 if [[ $impactscores =~ "mutationtaster" ]]
 then
-	mutationtaster="Y"
+    mutationtaster="Y"
 fi
 if [[ $impactscores =~ "sift" ]]
 then
-	avsift="Y"
+    avsift="Y"
 fi
 if [[ $impactscores =~ "lrt" ]]
 then
-	lrt="Y"
+    lrt="Y"
 fi
 if [[ $impactscores =~ "ljbsift" ]]
 then
-	ljbsift="Y"
+    ljbsift="Y"
 fi
 if [[ $impactscores =~ "ljb2sift" ]]
 then
-	ljb2sift="Y"
+    ljb2sift="Y"
 fi
 if [[ $impactscores =~ "pp2" ]]
 then
-	polyphen2="Y"
+    polyphen2="Y"
 fi
 if [[ $impactscores =~ "phylop" ]]
 then
-	phylop="Y"
+    phylop="Y"
 fi
 
 if [[ $varfile == "Y" ]]
 then
-	convertcoords="Y"
+    convertcoords="Y"
 fi
 
 #ljb refers to Liu, Jian, Boerwinkle paper in Human Mutation with pubmed ID 21520341. Cite this paper if you use the scores
@@ -405,48 +411,48 @@
 # ljb2_sift, ljb2_pp2hdiv, ljb2_pp2hvar, ljb2_lrt, ljb2_mt, ljb2_ma, ljb2_fathmm, ljb2_gerp++, ljb2_phylop, ljb2_siphy
 if [[ $newimpactscores =~ "ljb2_sift" ]]
 then
-	ljb2_sift="Y"
+    ljb2_sift="Y"
 fi
 if [[ $newimpactscores =~ "ljb2_pp2hdiv" ]]
 then
-	ljb2_pp2hdiv="Y"
+    ljb2_pp2hdiv="Y"
 fi
 if [[ $newimpactscores =~ "ljb2_pp2hvar" ]]
 then
-	ljb2_pp2hvar="Y"
+    ljb2_pp2hvar="Y"
 fi
 if [[ $newimpactscores =~ "ljb2_lrt" ]]
 then
-	ljb2_lrt="Y"
+    ljb2_lrt="Y"
 fi
 if [[ $newimpactscores =~ "ljb2_mt" ]]
 then
-	ljb2_mt="Y"
+    ljb2_mt="Y"
 fi
 if [[ $newimpactscores =~ "ljb2_ma" ]]
 then
-	ljb2_ma="Y"
+    ljb2_ma="Y"
 fi
 if [[ $newimpactscores =~ "ljb2_fathmm" ]]
 then
-	ljb2_fathmm="Y"
+    ljb2_fathmm="Y"
 fi
 if [[ $newimpactscores =~ "ljb2_gerp" ]]
 then
-	ljb2_gerp="Y"
+    ljb2_gerp="Y"
 fi
 if [[ $newimpactscores =~ "ljb2_phylop" ]]
 then
-	ljb2_phylop="Y"
+    ljb2_phylop="Y"
 fi
 if [[ $newimpactscores =~ "ljb2_siphy" ]]
 then
-	ljb2_siphy="Y"
+    ljb2_siphy="Y"
 fi
 
 if [ $otherinfo == "N" ]
 then
-	otherinfo=""
+    otherinfo=""
 fi
 
 
@@ -476,1032 +482,1176 @@
 then
 
 
-	####################################
-	#
-	#       PREPARE INPUT FILE
-	#
-	####################################
-	
-	echo "converting input file"
-	vcfheader=""
-	if [ $vcf == "Y" ]     #if CG varfile, convert
-	then 
-		# convert vcf to annovarinput
-		$scriptsdir/convert2annovar.pl --format vcf4old --allallele --includeinfo --outfile annovarinput $infile 2>&1
-		
-		#construct header line from vcf file		
-		cat $infile | grep "#CHROM" > additionalcols
-		sed -i 's/#//g' additionalcols 			
-		vcfheader="\t`cat additionalcols`"
-		echo "vcfheader:$vcfheader"
-		echo -e "chromosome\tbegin\tend\treference\tobserved\t`cat additionalcols`" > originalfile
-		cat annovarinput >> originalfile
-		
-		chrcol=1
-		startcol=2
-		endcol=3
-		refcol=4
-		obscol=5
+    ####################################
+    #
+    #       PREPARE INPUT FILE
+    #
+    ####################################
+    
+    echo "converting input file"
+    vcfheader=""
+    if [ $vcf == "Y" ]     #if CG varfile, convert
+    then 
+        # convert vcf to annovarinput
+        $scriptsdir/convert2annovar.pl --format vcf4old --allallele --includeinfo --outfile annovarinput $infile 2>&1
+        
+        #construct header line from vcf file
+        cat $infile | grep "#CHROM" > additionalcols
+        sed -i 's/#//g' additionalcols
+        vcfheader="\t`cat additionalcols`"
+        echo "vcfheader:$vcfheader"
+        echo -e "chromosome\tbegin\tend\treference\tobserved\t`cat additionalcols`" > originalfile
+        cat annovarinput >> originalfile
+        
+        chrcol=1
+        startcol=2
+        endcol=3
+        refcol=4
+        obscol=5
 
-	
-	elif [ $varfile == "Y" ]     #if CG varfile, convert
-	then 
-		# convert varfile
-		$scriptsdir/convert2annovar.pl --format cg --outfile annovarinput $infile 2>&1
-		echo -e "chromosome\tbegin\tend\treference\talleleSeq\tvarType\thaplotype" > originalfile
-		cat annovarinput | cut -f1-6,8 >> originalfile
-		cat annovarinput | cut -f1-5 >> annovarinput2
-		mv annovarinput2 annovarinput
+    
+    elif [ $varfile == "Y" ]     #if CG varfile, convert
+    then 
+        # convert varfile
+        $scriptsdir/convert2annovar.pl --format cg --outfile annovarinput $infile 2>&1
+        echo -e "chromosome\tbegin\tend\treference\talleleSeq\tvarType\thaplotype" > originalfile
+        cat annovarinput | cut -f1-6,8 >> originalfile
+        cat annovarinput | cut -f1-5 >> annovarinput2
+        mv annovarinput2 annovarinput
 
-		chrcol=1
-		startcol=2
-		endcol=3
-		refcol=4
-		obscol=5
+        chrcol=1
+        startcol=2
+        endcol=3
+        refcol=4
+        obscol=5
 
-	elif [ $convertcoords == "Y" ]    # if CG-coordinates, convert 
-	then
-		#echo "rearranging columns and converting coordinates"
-		awk 'BEGIN{
-				FS="\t";
-				OFS="\t";
-			}{
-				if(FNR>1) { 
+    elif [ $convertcoords == "Y" ]    # if CG-coordinates, convert 
+    then
+        #echo "rearranging columns and converting coordinates"
+        awk 'BEGIN{
+                FS="\t";
+                OFS="\t";
+            }{
+                if(FNR>1) { 
                                         gsub(/chr/,"",$"'"${chrcol}"'")
-					if( $"'"${vartypecol}"'" == "snp" ){ $"'"${startcol}"'" += 1 }; 
-					if( $"'"${vartypecol}"'" == "ins" ){ $"'"${refcol}"'" = "-" };
-					if( $"'"${vartypecol}"'" == "del" ){ $"'"${startcol}"'" +=1; $"'"${obscol}"'" = "-" };
-					if( $"'"${vartypecol}"'" == "sub" ){ $"'"${startcol}"'" += 1 }; 
-			
-					printf("%s\t%s\t%s\t%s\t%s\n" ,$"'"${chrcol}"'",$"'"${startcol}"'",$"'"${endcol}"'",$"'"${refcol}"'",$"'"${obscol}"'");				
-				}
-			}	
-			END{
-			}' $infile > annovarinput
+                    if( $"'"${vartypecol}"'" == "snp" ){ $"'"${startcol}"'" += 1 }; 
+                    if( $"'"${vartypecol}"'" == "ins" ){ $"'"${refcol}"'" = "-" };
+                    if( $"'"${vartypecol}"'" == "del" ){ $"'"${startcol}"'" +=1; $"'"${obscol}"'" = "-" };
+                    if( $"'"${vartypecol}"'" == "sub" ){ $"'"${startcol}"'" += 1 }; 
+            
+                    printf("%s\t%s\t%s\t%s\t%s\n" ,$"'"${chrcol}"'",$"'"${startcol}"'",$"'"${endcol}"'",$"'"${refcol}"'",$"'"${obscol}"'");
+                }
+            }    
+            END{
+            }' $infile > annovarinput
 
-			#remove any "chr" prefixes
-			#sed -i '2,$s/chr//g' annovarinput
+            #remove any "chr" prefixes
+            #sed -i '2,$s/chr//g' annovarinput
+
+            awk 'BEGIN{
+                FS="\t";
+                OFS="\t";
+            }{
 
-			awk 'BEGIN{
-				FS="\t";
-				OFS="\t";				
-			}{
-                                
-				if(FNR>=1) { 
-				        gsub(/chr/,"",$"'"${chrcol}"'")
-					if( $"'"${vartypecol}"'" == "snp" ){ $"'"${startcol}"'" += 1 }; 
-					if( $"'"${vartypecol}"'" == "ins" ){ $"'"${refcol}"'" = "-" };
-					if( $"'"${vartypecol}"'" == "del" ){ $"'"${startcol}"'" +=1; $"'"${obscol}"'" = "-" };
-					if( $"'"${vartypecol}"'" == "sub" ){ $"'"${startcol}"'" += 1 }; 
-			
-					print $0			
-				}
-			}	
-			END{
-			}' $infile > originalfile
+                if(FNR>=1) {
+                        gsub(/chr/,"",$"'"${chrcol}"'")
+                    if( $"'"${vartypecol}"'" == "snp" ){ $"'"${startcol}"'" += 1 }; 
+                    if( $"'"${vartypecol}"'" == "ins" ){ $"'"${refcol}"'" = "-" };
+                    if( $"'"${vartypecol}"'" == "del" ){ $"'"${startcol}"'" +=1; $"'"${obscol}"'" = "-" };
+                    if( $"'"${vartypecol}"'" == "sub" ){ $"'"${startcol}"'" += 1 }; 
+            
+                    print $0
+                }
+            }
+            END{
+            }' $infile > originalfile
 
-			#remove any "chr" prefixes
-			#sed -i '2,$s/chr//g' originalfile
-			sed -i 's/omosome/chromosome/g' originalfile
+            #remove any "chr" prefixes
+            #sed -i '2,$s/chr//g' originalfile
+            sed -i 's/omosome/chromosome/g' originalfile
 
 
-	else #only rearrange columns if already 1-based coordinates	
-		echo "rearranging columns "
-		awk 'BEGIN{
-				FS="\t";
-				OFS="\t";
-			}{
-				if(FNR>1) { 		                                    
-                                    printf("%s\t%s\t%s\t%s\t%s\n",$"'"${chrcol}"'",$"'"${startcol}"'",$"'"${endcol}"'",$"'"${refcol}"'",$"'"${obscol}"'");				
-				}
-			}	
-			END{
-			}' $infile > annovarinput
+    else #only rearrange columns if already 1-based coordinates
+        echo "rearranging columns "
+        awk 'BEGIN{
+                FS="\t";
+                OFS="\t";
+            }{
+                if(FNR>1) {
+                                    printf("%s\t%s\t%s\t%s\t%s\n",$"'"${chrcol}"'",$"'"${startcol}"'",$"'"${endcol}"'",$"'"${refcol}"'",$"'"${obscol}"'");
+                }
+            }
+            END{
+            }' $infile > annovarinput
 
-			#remove any "chr" prefixes
-			sed -i '2,$s/chr//g' annovarinput
-			sed '2,$s/chr//g' $infile > originalfile
-			sed -i 's/omosome/chromosome/g' originalfile
-	fi
+            #remove any "chr" prefixes
+            sed -i '2,$s/chr//g' annovarinput
+            sed '2,$s/chr//g' $infile > originalfile
+            sed -i 's/omosome/chromosome/g' originalfile
+    fi
 
-	echo "...finished conversion"
-	
+    echo "...finished conversion"
 
 
 
-	####################################
-	#
-	#       RUN ANNOVAR COMMANDS
-	#
-	####################################
+    ####################################
+    #
+    #       RUN ANNOVAR COMMANDS
+    #
+    ####################################
 
-	
+    
 
-	######    gene-based annotation   #######
+    ######    gene-based annotation   #######
 
-	# RefSeq Gene
-	if [ $refgene == "Y" ]
-	then
-		echo -e "\nrefSeq gene"
-		$scriptsdir/annotate_variation.pl --geneanno --buildver $buildver -dbtype gene ${hgvs} annovarinput $humandb 2>&1
-		
-		annovarout=annovarinput.variant_function
-		sed -i '1i\RefSeq_Func\tRefSeq_Gene\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout  3 4 5 6 7 B.RefSeq_Func,B.RefSeq_Gene
+    # RefSeq Gene
+    if [ $refgene == "Y" ]
+    then
+        echo -e "\nrefSeq gene"
+        $scriptsdir/annotate_variation.pl --geneanno --buildver $buildver -dbtype gene ${hgvs} annovarinput $humandb 2>&1
+        
+        annovarout=annovarinput.variant_function
+        sed -i '1i\RefSeq_Func\tRefSeq_Gene\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout  3 4 5 6 7 B.RefSeq_Func,B.RefSeq_Gene
 
-		annovarout=annovarinput.exonic_variant_function 
-		sed -i '1i\linenum\tRefSeq_ExonicFunc\tRefSeq_AAChange\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout  
-		joinresults originalfile $annovarout  4 5 6 7 8 B.RefSeq_ExonicFunc,B.RefSeq_AAChange
-	fi
+        annovarout=annovarinput.exonic_variant_function 
+        sed -i '1i\linenum\tRefSeq_ExonicFunc\tRefSeq_AAChange\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout
+        joinresults originalfile $annovarout  4 5 6 7 8 B.RefSeq_ExonicFunc,B.RefSeq_AAChange
+    fi
 
 
-	# UCSC KnownGene
-	if [ $knowngene == "Y" ]
-	then
-		echo -e "\nUCSC known gene"
-		$scriptsdir/annotate_variation.pl --geneanno --buildver $buildver -dbtype knowngene annovarinput $humandb 2>&1
-	
-		annovarout=annovarinput.variant_function
-		sed -i '1i\UCSCKnownGene_Func\tUCSCKnownGene_Gene\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.UCSCKnownGene_Func,B.UCSCKnownGene_Gene
+    # UCSC KnownGene
+    if [ $knowngene == "Y" ]
+    then
+        echo -e "\nUCSC known gene"
+        $scriptsdir/annotate_variation.pl --geneanno --buildver $buildver -dbtype knowngene annovarinput $humandb 2>&1
+    
+        annovarout=annovarinput.variant_function
+        sed -i '1i\UCSCKnownGene_Func\tUCSCKnownGene_Gene\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.UCSCKnownGene_Func,B.UCSCKnownGene_Gene
 
-		annovarout=annovarinput.exonic_variant_function
-		sed -i '1i\linenum\tUCSCKnownGene_ExonicFunc\tUCSCKnownGene_AAChange\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 4 5 6 7 8 B.UCSCKnownGene_ExonicFunc,B.UCSCKnownGene_AAChange
-	fi
+        annovarout=annovarinput.exonic_variant_function
+        sed -i '1i\linenum\tUCSCKnownGene_ExonicFunc\tUCSCKnownGene_AAChange\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 4 5 6 7 8 B.UCSCKnownGene_ExonicFunc,B.UCSCKnownGene_AAChange
+    fi
 
 
-	# Emsembl Gene
-	if [ $ensgene == "Y" ]
-	then
-		echo -e "\nEnsembl gene"
-		$scriptsdir/annotate_variation.pl --geneanno --buildver $buildver -dbtype ensgene annovarinput $humandb 2>&1
-	
-		annovarout=annovarinput.variant_function
-		sed -i '1i\EnsemblGene_Func\tEnsemblGene_Gene\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.EnsemblGene_Func,B.EnsemblGene_Gene
+    # Emsembl Gene
+    if [ $ensgene == "Y" ]
+    then
+        echo -e "\nEnsembl gene"
+        $scriptsdir/annotate_variation.pl --geneanno --buildver $buildver -dbtype ensgene annovarinput $humandb 2>&1
+    
+        annovarout=annovarinput.variant_function
+        sed -i '1i\EnsemblGene_Func\tEnsemblGene_Gene\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.EnsemblGene_Func,B.EnsemblGene_Gene
 
-		annovarout=annovarinput.exonic_variant_function
-		sed -i '1i\linenum\tEnsemblGene_ExonicFunc\tEnsemblGene_AAChange\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 4 5 6 7 8 B.EnsemblGene_ExonicFunc,B.EnsemblGene_AAChange
-	fi
+        annovarout=annovarinput.exonic_variant_function
+        sed -i '1i\linenum\tEnsemblGene_ExonicFunc\tEnsemblGene_AAChange\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 4 5 6 7 8 B.EnsemblGene_ExonicFunc,B.EnsemblGene_AAChange
+    fi
 
 
 
-	######    region-based annotation   #######
+    ######    region-based annotation   #######
 
 
-	# Transcription Factor Binding Sites Annotation
-	if [ $mce == "Y" ]
-	then
-		echo -e "\nMost Conserved Elements"
-	
-		if [ $buildver == "hg18" ]
-		then
-			$scriptsdir/annotate_variation.pl --regionanno --buildver $buildver -dbtype mce44way annovarinput $humandb 2>&1
-			annovarout=annovarinput.${buildver}_phastConsElements44way
-			sed -i '1i\db\tphastConsElements44way\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-			joinresults originalfile $annovarout 3 4 5 6 7 B.phastConsElements44way	
+    # Transcription Factor Binding Sites Annotation
+    if [ $mce == "Y" ]
+    then
+        echo -e "\nMost Conserved Elements"
+    
+        if [ $buildver == "hg18" ]
+        then
+            $scriptsdir/annotate_variation.pl --regionanno --buildver $buildver -dbtype mce44way annovarinput $humandb 2>&1
+            annovarout=annovarinput.${buildver}_phastConsElements44way
+            sed -i '1i\db\tphastConsElements44way\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+            joinresults originalfile $annovarout 3 4 5 6 7 B.phastConsElements44way    
 
-		else #hg19	
-			$scriptsdir/annotate_variation.pl --regionanno --buildver $buildver -dbtype mce46way annovarinput $humandb 2>&1
-			annovarout=annovarinput.${buildver}_phastConsElements46way	   
-			sed -i '1i\db\tphastConsElements46way\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-			joinresults originalfile $annovarout 3 4 5 6 7 B.phastConsElements46way	
-		fi
-	
-	fi
+        else #hg19    
+            $scriptsdir/annotate_variation.pl --regionanno --buildver $buildver -dbtype mce46way annovarinput $humandb 2>&1
+            annovarout=annovarinput.${buildver}_phastConsElements46way       
+            sed -i '1i\db\tphastConsElements46way\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+            joinresults originalfile $annovarout 3 4 5 6 7 B.phastConsElements46way    
+        fi
+    
+    fi
 
 
 
-	# Transcription Factor Binding Sites Annotation
-	if [ $tfbs == "Y" ]
-	then
-		echo -e "\nTranscription Factor Binding Site Annotation"
-		$scriptsdir/annotate_variation.pl --regionanno --buildver $buildver -dbtype tfbs annovarinput $humandb 2>&1
-	
-		# arguments: originalfile, resultfile,chrcol,startcol,endcol,refcol,obscol,selectcolumns
-		annovarout=annovarinput.${buildver}_tfbsConsSites
-		sed -i '1i\db\tTFBS\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.TFBS	
-	fi
+    # Transcription Factor Binding Sites Annotation
+    if [ $tfbs == "Y" ]
+    then
+        echo -e "\nTranscription Factor Binding Site Annotation"
+        $scriptsdir/annotate_variation.pl --regionanno --buildver $buildver -dbtype tfbs annovarinput $humandb 2>&1
+    
+        # arguments: originalfile, resultfile,chrcol,startcol,endcol,refcol,obscol,selectcolumns
+        annovarout=annovarinput.${buildver}_tfbsConsSites
+        sed -i '1i\db\tTFBS\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.TFBS    
+    fi
 
 
 
-	# Identify cytogenetic band for genetic variants
-	if [ $cytoband == "Y" ]
-	then
-		echo -e "\nCytogenic band Annotation"
-		$scriptsdir/annotate_variation.pl --regionanno --buildver $buildver -dbtype band annovarinput $humandb 2>&1
-	
-		annovarout=annovarinput.${buildver}_cytoBand
-		sed -i '1i\db\tBand\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.Band	
-	fi
+    # Identify cytogenetic band for genetic variants
+    if [ $cytoband == "Y" ]
+    then
+        echo -e "\nCytogenic band Annotation"
+        $scriptsdir/annotate_variation.pl --regionanno --buildver $buildver -dbtype band annovarinput $humandb 2>&1
+    
+        annovarout=annovarinput.${buildver}_cytoBand
+        sed -i '1i\db\tBand\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.Band    
+    fi
 
 
-	# Identify variants located in segmental duplications
-	if [ $segdup == "Y" ]
-	then
-		echo -e "\nSegmental Duplications Annotation"
-		$scriptsdir/annotate_variation.pl --regionanno --buildver $buildver -dbtype segdup annovarinput $humandb 2>&1
-	
-		annovarout=annovarinput.${buildver}_genomicSuperDups
-		sed -i '1i\db\tSegDup\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.SegDup	
-	fi
+    # Identify variants located in segmental duplications
+    if [ $segdup == "Y" ]
+    then
+        echo -e "\nSegmental Duplications Annotation"
+        $scriptsdir/annotate_variation.pl --regionanno --buildver $buildver -dbtype segdup annovarinput $humandb 2>&1
+    
+        annovarout=annovarinput.${buildver}_genomicSuperDups
+        sed -i '1i\db\tSegDup\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.SegDup    
+    fi
 
 
 
-	# Identify previously reported structural variants in DGV
-	if [ $dgv == "Y" ]
-	then
-		echo -e "\nDGV Annotation"
-		$scriptsdir/annotate_variation.pl --regionanno --buildver $buildver -dbtype dgvMerged annovarinput $humandb 2>&1
-	
-		annovarout=annovarinput.${buildver}_dgvMerged
-		sed -i '1i\db\tDGV\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.DGV	
-	fi
+    # Identify previously reported structural variants in DGV
+    if [ $dgv == "Y" ]
+    then
+        echo -e "\nDGV Annotation"
+        $scriptsdir/annotate_variation.pl --regionanno --buildver $buildver -dbtype dgvMerged annovarinput $humandb 2>&1
+    
+        annovarout=annovarinput.${buildver}_dgvMerged
+        sed -i '1i\db\tDGV\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.DGV    
+    fi
 
 
-	# Identify variants reported in previously published GWAS studies
-	if [ $gwas == "Y" ]
-	then
-		echo -e "\nGWAS Annotation"
-		$scriptsdir/annotate_variation.pl --regionanno --buildver $buildver -dbtype gwascatalog annovarinput $humandb 2>&1
-	
-		annovarout=annovarinput.${buildver}_gwasCatalog
-		sed -i '1i\db\tGWAS\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.GWAS	
-	fi
+    # Identify variants reported in previously published GWAS studies
+    if [ $gwas == "Y" ]
+    then
+        echo -e "\nGWAS Annotation"
+        $scriptsdir/annotate_variation.pl --regionanno --buildver $buildver -dbtype gwascatalog annovarinput $humandb 2>&1
+    
+        annovarout=annovarinput.${buildver}_gwasCatalog
+        sed -i '1i\db\tGWAS\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout
+        joinresults originalfile $annovarout 3 4 5 6 7 B.GWAS    
+    fi
 
 
-	
-	
-	######    filter-based annotation   #######
+    
+    
+    ######    filter-based annotation   #######
 
-	#dbSNP
-	for version in $dbsnpstr
-	do
-		if [ $version == "None" ] 
-		then
-			break
-		fi
-		echo -e "\ndbSNP region Annotation, version: $version"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype ${version} annovarinput $humandb 2>&1
-	
-		columnname=${version}
-		if [[ $columnname == snp* ]]
-		then
-			columnname="db${version}"
-		fi
+    #dbSNP
+    for version in $dbsnpstr
+    do
+        if [ $version == "None" ] 
+        then
+            break
+        fi
+        echo -e "\ndbSNP region Annotation, version: $version"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype ${version} annovarinput $humandb 2>&1
+    
+        columnname=${version}
+        if [[ $columnname == snp* ]]
+        then
+            columnname="db${version}"
+        fi
 
-		annovarout=annovarinput.${buildver}_${version}_dropped		
-		sed -i '1i\db\t'${columnname}'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.${columnname}	
-	
+        annovarout=annovarinput.${buildver}_${version}_dropped
+        sed -i '1i\db\t'${columnname}'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.${columnname}
 
-	done
+    done
 
 
 
-	#1000 Genomes
+    #1000 Genomes
 
-	if [ $ver1000g != "None" ] 
-	then
+    if [ $ver1000g != "None" ] 
+    then
 
-		for version in $g1000str
-		do
-			#column headers
-			g1000_colheader_ALL="${version}_ALL"
-			g1000_colheader_AFR="${version}_AFR"
-			g1000_colheader_AMR="${version}_AMR"
-			g1000_colheader_ASN="${version}_ASN"
-			g1000_colheader_EUR="${version}_EUR"
-			g1000_colheader_EAS="${version}_EAS"
-			g1000_colheader_SAS="${version}_SAS"
-			g1000_colheader_CEU="${version}_CEU"
-			g1000_colheader_YRI="${version}_YRI"
-			g1000_colheader_JPTCHB="${version}_JPTCHB"
-			
-			doALL="N"
-			doAMR="N"
-			doAFR="N"
-			doASN="N"
-			doEAS="N"
-			doSAS="N"
-			doEUR="N"
-			doCEU="N"
-			doYRI="N"
-			doJPTCHB="N"
+        for version in $g1000str
+        do
+            #column headers
+            g1000_colheader_ALL="${version}_ALL"
+            g1000_colheader_AFR="${version}_AFR"
+            g1000_colheader_AMR="${version}_AMR"
+            g1000_colheader_ASN="${version}_ASN"
+            g1000_colheader_EUR="${version}_EUR"
+            g1000_colheader_EAS="${version}_EAS"
+            g1000_colheader_SAS="${version}_SAS"
+            g1000_colheader_CEU="${version}_CEU"
+            g1000_colheader_YRI="${version}_YRI"
+            g1000_colheader_JPTCHB="${version}_JPTCHB"
+            
+            doALL="N"
+            doAMR="N"
+            doAFR="N"
+            doASN="N"
+            doEAS="N"
+            doSAS="N"
+            doEUR="N"
+            doCEU="N"
+            doYRI="N"
+            doJPTCHB="N"
 
 
-			if [ $version == "1000g2012apr" ]
-			then
-				fileID="2012_04"
-				doALL="Y"
-				if [ $buildver == "hg19" ]
-				then
-					doAMR="Y"
-					doAFR="Y"
-					doASN="Y"
-					doEUR="Y"
-				fi
-			elif [ $version == "1000g2014oct" ]
-			then
-				fileID="2014_10"
-				doALL="Y"
-				doAMR="Y"
-				doAFR="Y"
-				doEUR="Y"
-				doEAS="Y"
-				if [ $buildver == "hg19" ]
-				then
-					doSAS="Y"
-				fi
-				
-			elif [[ $version == "1000g2015aug"  ]]
-			then
-				fileID="2015_08"				
-				doALL="Y"
-				doAMR="Y"
-				doAFR="Y"
-				doEUR="Y"
-				doEAS="Y"
-				doSAS="Y"
-					
-			elif [[ $version == "1000g2012feb"  ]]
-			then
-				fileID="2012_02"				
-				doALL="Y"	
-			elif [[ $version == "1000g2010nov"  ]]
-			then
-				fileID="2010_11"
-				doALL="Y"	
-			elif [[ $version == "1000g2010jul"  ]]
-			then
-				fileID="2010_07"
-				doALL="N"
-				doCEU="Y"
-				doYRI="Y"
-				doJPTCHB="Y"
-			else
-				echo "unrecognized 1000g version, skipping"
-			fi
+            if [ $version == "1000g2012apr" ]
+            then
+                fileID="2012_04"
+                doALL="Y"
+                if [ $buildver == "hg19" ]
+                then
+                    doAMR="Y"
+                    doAFR="Y"
+                    doASN="Y"
+                    doEUR="Y"
+                fi
+            elif [ $version == "1000g2014oct" ]
+            then
+                fileID="2014_10"
+                doALL="Y"
+                doAMR="Y"
+                doAFR="Y"
+                doEUR="Y"
+                doEAS="Y"
+                if [ $buildver == "hg19" ]
+                then
+                    doSAS="Y"
+                fi
+                
+            elif [[ $version == "1000g2015aug"  ]]
+            then
+                fileID="2015_08"
+                doALL="Y"
+                doAMR="Y"
+                doAFR="Y"
+                doEUR="Y"
+                doEAS="Y"
+                doSAS="Y"
+                    
+            elif [[ $version == "1000g2012feb"  ]]
+            then
+                fileID="2012_02"
+                doALL="Y"
+            elif [[ $version == "1000g2010nov"  ]]
+            then
+                fileID="2010_11"
+                doALL="Y"
+            elif [[ $version == "1000g2010jul"  ]]
+            then
+                fileID="2010_07"
+                doALL="N"
+                doCEU="Y"
+                doYRI="Y"
+                doJPTCHB="Y"
+            else
+                echo "unrecognized 1000g version, skipping"
+            fi
 
-			#ALL
-			if [ $doALL == "Y"  ]
-				then
-				echo -e "\n1000Genomes ALL"
-				$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype "${version}_all" annovarinput $humandb 2>&1
-	
-				annovarout=annovarinput.${buildver}_ALL.sites.${fileID}_dropped
-				sed -i '1i\db\t'$g1000_colheader_ALL'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-				joinresults originalfile $annovarout 3 4 5 6 7 B.$g1000_colheader_ALL	
-			fi
+            #ALL
+            if [ $doALL == "Y"  ]
+                then
+                echo -e "\n1000Genomes ALL"
+                $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype "${version}_all" annovarinput $humandb 2>&1
+    
+                annovarout=annovarinput.${buildver}_ALL.sites.${fileID}_dropped
+                sed -i '1i\db\t'$g1000_colheader_ALL'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+                joinresults originalfile $annovarout 3 4 5 6 7 B.$g1000_colheader_ALL
+            fi
 
-			# AFR
-			if [ $doAFR == "Y"  ]
-			then
-				echo -e "\n1000Genomes AFR"
-				$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype "${version}_afr" annovarinput $humandb 2>&1
-	
-				annovarout=annovarinput.${buildver}_AFR.sites.${fileID}_dropped
-				sed -i '1i\db\t'$g1000_colheader_AFR'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-				joinresults originalfile $annovarout 3 4 5 6 7 B.$g1000_colheader_AFR	
-			fi
+            # AFR
+            if [ $doAFR == "Y"  ]
+            then
+                echo -e "\n1000Genomes AFR"
+                $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype "${version}_afr" annovarinput $humandb 2>&1
+    
+                annovarout=annovarinput.${buildver}_AFR.sites.${fileID}_dropped
+                sed -i '1i\db\t'$g1000_colheader_AFR'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+                joinresults originalfile $annovarout 3 4 5 6 7 B.$g1000_colheader_AFR
+            fi
 
-			
-			# AMR
-			if [ $doAMR == "Y"  ]
-			then
-				echo -e "\n1000Genomes AMR"
-				$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype "${version}_amr" annovarinput $humandb 2>&1
-	
-				annovarout=annovarinput.${buildver}_AMR.sites.${fileID}_dropped
-				sed -i '1i\db\t'$g1000_colheader_AMR'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-				joinresults originalfile $annovarout 3 4 5 6 7 B.$g1000_colheader_AMR	
-			fi
+            
+            # AMR
+            if [ $doAMR == "Y"  ]
+            then
+                echo -e "\n1000Genomes AMR"
+                $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype "${version}_amr" annovarinput $humandb 2>&1
+    
+                annovarout=annovarinput.${buildver}_AMR.sites.${fileID}_dropped
+                sed -i '1i\db\t'$g1000_colheader_AMR'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+                joinresults originalfile $annovarout 3 4 5 6 7 B.$g1000_colheader_AMR
+            fi
 
-			# ASN
-			if [ $doASN == "Y"  ]
-			then
-				echo -e "\n1000Genomes ASN"
-				$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype "${version}_asn" annovarinput $humandb 2>&1
-	
-				annovarout=annovarinput.${buildver}_ASN.sites.${fileID}_dropped
-				sed -i '1i\db\t'$g1000_colheader_ASN'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-				joinresults originalfile $annovarout 3 4 5 6 7 B.$g1000_colheader_ASN	
-			fi
-			
-			# EAS
-			if [ $doEAS == "Y"  ]
-			then
-				echo -e "\n1000Genomes EAS"
-				$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype "${version}_eas" annovarinput $humandb 2>&1
-	
-				annovarout=annovarinput.${buildver}_EAS.sites.${fileID}_dropped
-				sed -i '1i\db\t'$g1000_colheader_EAS'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-				joinresults originalfile $annovarout 3 4 5 6 7 B.$g1000_colheader_EAS	
-			fi
-			
-			# SAS
-			if [ $doSAS == "Y"  ]
-			then
-				echo -e "\n1000Genomes SAS"
-				$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype "${version}_sas" annovarinput $humandb 2>&1
-	
-				annovarout=annovarinput.${buildver}_SAS.sites.${fileID}_dropped
-				sed -i '1i\db\t'$g1000_colheader_SAS'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-				joinresults originalfile $annovarout 3 4 5 6 7 B.$g1000_colheader_SAS	
-			fi
-			
-			# EUR
-			if [ $doEUR == "Y"  ]
-			then
-				echo -e "\n1000Genomes EUR"
-				$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype "${version}_eur" annovarinput $humandb 2>&1
-	
-				annovarout=annovarinput.${buildver}_EUR.sites.${fileID}_dropped
-				sed -i '1i\db\t'$g1000_colheader_EUR'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-				joinresults originalfile $annovarout 3 4 5 6 7 B.$g1000_colheader_EUR	
-			fi
+            # ASN
+            if [ $doASN == "Y"  ]
+            then
+                echo -e "\n1000Genomes ASN"
+                $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype "${version}_asn" annovarinput $humandb 2>&1
+    
+                annovarout=annovarinput.${buildver}_ASN.sites.${fileID}_dropped
+                sed -i '1i\db\t'$g1000_colheader_ASN'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+                joinresults originalfile $annovarout 3 4 5 6 7 B.$g1000_colheader_ASN
+            fi
+            
+            # EAS
+            if [ $doEAS == "Y"  ]
+            then
+                echo -e "\n1000Genomes EAS"
+                $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype "${version}_eas" annovarinput $humandb 2>&1
+    
+                annovarout=annovarinput.${buildver}_EAS.sites.${fileID}_dropped
+                sed -i '1i\db\t'$g1000_colheader_EAS'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+                joinresults originalfile $annovarout 3 4 5 6 7 B.$g1000_colheader_EAS
+            fi
+            
+            # SAS
+            if [ $doSAS == "Y"  ]
+            then
+                echo -e "\n1000Genomes SAS"
+                $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype "${version}_sas" annovarinput $humandb 2>&1
+    
+                annovarout=annovarinput.${buildver}_SAS.sites.${fileID}_dropped
+                sed -i '1i\db\t'$g1000_colheader_SAS'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+                joinresults originalfile $annovarout 3 4 5 6 7 B.$g1000_colheader_SAS
+            fi
+            
+            # EUR
+            if [ $doEUR == "Y"  ]
+            then
+                echo -e "\n1000Genomes EUR"
+                $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype "${version}_eur" annovarinput $humandb 2>&1
+    
+                annovarout=annovarinput.${buildver}_EUR.sites.${fileID}_dropped
+                sed -i '1i\db\t'$g1000_colheader_EUR'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+                joinresults originalfile $annovarout 3 4 5 6 7 B.$g1000_colheader_EUR
+            fi
 
-			# CEU
-			if [ $doCEU == "Y"  ]
-			then
-				echo -e "\n1000Genomes CEU"
-				$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype "${version}_ceu" annovarinput $humandb 2>&1
-	
-				annovarout=annovarinput.${buildver}_CEU.sites.${fileID}_dropped
-				sed -i '1i\db\t'$g1000_colheader_CEU'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-				joinresults originalfile $annovarout 3 4 5 6 7 B.$g1000_colheader_CEU	
-			fi
+            # CEU
+            if [ $doCEU == "Y"  ]
+            then
+                echo -e "\n1000Genomes CEU"
+                $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype "${version}_ceu" annovarinput $humandb 2>&1
+    
+                annovarout=annovarinput.${buildver}_CEU.sites.${fileID}_dropped
+                sed -i '1i\db\t'$g1000_colheader_CEU'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+                joinresults originalfile $annovarout 3 4 5 6 7 B.$g1000_colheader_CEU
+            fi
 
-			# YRI
-			if [ $doYRI == "Y"  ]
-			then
-				echo -e "\n1000Genomes YRI"
-				$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype "${version}_yri" annovarinput $humandb 2>&1
-	
-				annovarout=annovarinput.${buildver}_YRI.sites.${fileID}_dropped
-				sed -i '1i\db\t'$g1000_colheader_YRI'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-				joinresults originalfile $annovarout 3 4 5 6 7 B.$g1000_colheader_YRI	
-	
+            # YRI
+            if [ $doYRI == "Y"  ]
+            then
+                echo -e "\n1000Genomes YRI"
+                $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype "${version}_yri" annovarinput $humandb 2>&1
+    
+                annovarout=annovarinput.${buildver}_YRI.sites.${fileID}_dropped
+                sed -i '1i\db\t'$g1000_colheader_YRI'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+                joinresults originalfile $annovarout 3 4 5 6 7 B.$g1000_colheader_YRI
+    
 
-			fi
+            fi
 
-			#JPTCHB
-			if [ $doJPTCHB == "Y"  ]
-			then
-				echo -e "\n1000Genomes JPTCHB"
-				$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype "${version}_jptchb" annovarinput $humandb 2>&1
-	
-				annovarout=annovarinput.${buildver}_JPTCHB.sites.${fileID}_dropped
-				sed -i '1i\db\t'$g1000_colheader_JPTCHB'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-				joinresults originalfile $annovarout 3 4 5 6 7 B.$g1000_colheader_JPTCHB	
-			fi
+            #JPTCHB
+            if [ $doJPTCHB == "Y"  ]
+            then
+                echo -e "\n1000Genomes JPTCHB"
+                $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype "${version}_jptchb" annovarinput $humandb 2>&1
+    
+                annovarout=annovarinput.${buildver}_JPTCHB.sites.${fileID}_dropped
+                sed -i '1i\db\t'$g1000_colheader_JPTCHB'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+                joinresults originalfile $annovarout 3 4 5 6 7 B.$g1000_colheader_JPTCHB
+            fi
 
-		done
-	fi
+        done
+    fi
 
 
-	
-	
-	#### IMPACT SCORE ANNOTATIONS
+    
+    
+    #### IMPACT SCORE ANNOTATIONS
 
 
-	if [ $ljb2_sift == "Y" ]
-	then
-		echo -e "\nLJB2 SIFT Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver $otherinfo -dbtype ljb2_sift annovarinput $humandb 2>&1
-	
-		annovarout=annovarinput.${buildver}_ljb2_sift_dropped
-		sed -i '1i\db\tLJB2_SIFT\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.LJB2_SIFT	
-	fi
-	
-	if [ $ljb2_pp2hdiv == "Y" ]
-	then
-		echo -e "\nLJB2 pp2hdiv Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver $otherinfo -dbtype ljb2_pp2hdiv annovarinput $humandb 2>&1
-	
-		annovarout=annovarinput.${buildver}_ljb2_pp2hdiv_dropped
-		sed -i '1i\db\tLJB2_PolyPhen2_HDIV\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.LJB2_PolyPhen2_HDIV	
-	fi
-	
-	if [ $ljb2_pp2hvar == "Y" ]
-	then
-		echo -e "\nLJB2 pp2hvar Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver $otherinfo -dbtype ljb2_pp2hvar annovarinput $humandb 2>&1
-	
-		annovarout=annovarinput.${buildver}_ljb2_pp2hvar_dropped
-		
-		head $annovarout
-		sed -i '1i\db\tLJB2_PolyPhen2_HVAR\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.LJB2_PolyPhen2_HVAR	
-	fi
-	
-	if [ $ljb2_lrt == "Y" ]
-	then
-		echo -e "\nLJB2 LRT Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver $otherinfo -dbtype ljb2_lrt annovarinput $humandb 2>&1
-	
-		annovarout=annovarinput.${buildver}_ljb2_lrt_dropped
-		sed -i '1i\db\tLJB2_LRT\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.LJB2_LRT	
-	fi
-	
-	if [ $ljb2_mt == "Y" ]
-	then
-		echo -e "\nLJB2 mutationtaster Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver $otherinfo -dbtype ljb2_mt annovarinput $humandb 2>&1
-	
-		annovarout=annovarinput.${buildver}_ljb2_mt_dropped
-		sed -i '1i\db\tLJB2_MutationTaster\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.LJB2_MutationTaster	
-	fi
-	
-	if [ $ljb2_ma == "Y" ]
-	then
-		echo -e "\nLJB2 mutationassessor Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver $otherinfo -dbtype ljb2_ma annovarinput $humandb 2>&1
-	
-		annovarout=annovarinput.${buildver}_ljb2_ma_dropped
-		sed -i '1i\db\tLJB2_MutationAssessor\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.LJB2_MutationAssessor	
-	fi
-	
-	if [ $ljb2_fathmm == "Y" ]
-	then
-		echo -e "\nLJB2 FATHMM Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver $otherinfo -dbtype ljb2_fathmm annovarinput $humandb 2>&1
-	
-		annovarout=annovarinput.${buildver}_ljb2_fathmm_dropped
-		sed -i '1i\db\tLJB2_FATHMM\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.LJB2_FATHMM	
-	fi
-	
-	if [ $ljb2_gerp == "Y" ]
-	then
-		echo -e "\nLJB2 GERP++ Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver $otherinfo -dbtype ljb2_gerp++ annovarinput $humandb 2>&1
-	
-		annovarout=annovarinput.${buildver}_ljb2_gerp++_dropped
-		sed -i '1i\db\tLJB2_GERP++\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.LJB2_GERP++	
-	fi
-	
-	if [ $ljb2_phylop == "Y" ]
-	then
-		echo -e "\nLJB2 PhyloP Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver $otherinfo -dbtype ljb2_phylop annovarinput $humandb 2>&1
-	
-		annovarout=annovarinput.${buildver}_ljb2_phylop_dropped
-		sed -i '1i\db\tLJB2_PhyloP\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.LJB2_PhyloP	
-	fi
-	
-	if [ $ljb2_siphy == "Y" ]
-	then
-		echo -e "\nLJB2 SiPhy Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver $otherinfo -dbtype ljb2_siphy annovarinput $humandb 2>&1
-	
-		annovarout=annovarinput.${buildver}_ljb2_siphy_dropped
-		sed -i '1i\db\tLJB2_SiPhy\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.LJB2_SiPhy	
-	fi
+    if [ $ljb2_sift == "Y" ]
+    then
+        echo -e "\nLJB2 SIFT Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver $otherinfo -dbtype ljb2_sift annovarinput $humandb 2>&1
+    
+        annovarout=annovarinput.${buildver}_ljb2_sift_dropped
+        sed -i '1i\db\tLJB2_SIFT\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.LJB2_SIFT
+    fi
+    
+    if [ $ljb2_pp2hdiv == "Y" ]
+    then
+        echo -e "\nLJB2 pp2hdiv Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver $otherinfo -dbtype ljb2_pp2hdiv annovarinput $humandb 2>&1
+    
+        annovarout=annovarinput.${buildver}_ljb2_pp2hdiv_dropped
+        sed -i '1i\db\tLJB2_PolyPhen2_HDIV\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.LJB2_PolyPhen2_HDIV
+    fi
+    
+    if [ $ljb2_pp2hvar == "Y" ]
+    then
+        echo -e "\nLJB2 pp2hvar Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver $otherinfo -dbtype ljb2_pp2hvar annovarinput $humandb 2>&1
+    
+        annovarout=annovarinput.${buildver}_ljb2_pp2hvar_dropped
+        
+        head $annovarout
+        sed -i '1i\db\tLJB2_PolyPhen2_HVAR\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.LJB2_PolyPhen2_HVAR
+    fi
+    
+    if [ $ljb2_lrt == "Y" ]
+    then
+        echo -e "\nLJB2 LRT Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver $otherinfo -dbtype ljb2_lrt annovarinput $humandb 2>&1
+    
+        annovarout=annovarinput.${buildver}_ljb2_lrt_dropped
+        sed -i '1i\db\tLJB2_LRT\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.LJB2_LRT
+    fi
+    
+    if [ $ljb2_mt == "Y" ]
+    then
+        echo -e "\nLJB2 mutationtaster Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver $otherinfo -dbtype ljb2_mt annovarinput $humandb 2>&1
+    
+        annovarout=annovarinput.${buildver}_ljb2_mt_dropped
+        sed -i '1i\db\tLJB2_MutationTaster\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.LJB2_MutationTaster
+    fi
+    
+    if [ $ljb2_ma == "Y" ]
+    then
+        echo -e "\nLJB2 mutationassessor Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver $otherinfo -dbtype ljb2_ma annovarinput $humandb 2>&1
+    
+        annovarout=annovarinput.${buildver}_ljb2_ma_dropped
+        sed -i '1i\db\tLJB2_MutationAssessor\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.LJB2_MutationAssessor
+    fi
+    
+    if [ $ljb2_fathmm == "Y" ]
+    then
+        echo -e "\nLJB2 FATHMM Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver $otherinfo -dbtype ljb2_fathmm annovarinput $humandb 2>&1
+    
+        annovarout=annovarinput.${buildver}_ljb2_fathmm_dropped
+        sed -i '1i\db\tLJB2_FATHMM\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.LJB2_FATHMM
+    fi
+    
+    if [ $ljb2_gerp == "Y" ]
+    then
+        echo -e "\nLJB2 GERP++ Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver $otherinfo -dbtype ljb2_gerp++ annovarinput $humandb 2>&1
+    
+        annovarout=annovarinput.${buildver}_ljb2_gerp++_dropped
+        sed -i '1i\db\tLJB2_GERP++\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.LJB2_GERP++
+    fi
+    
+    if [ $ljb2_phylop == "Y" ]
+    then
+        echo -e "\nLJB2 PhyloP Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver $otherinfo -dbtype ljb2_phylop annovarinput $humandb 2>&1
+    
+        annovarout=annovarinput.${buildver}_ljb2_phylop_dropped
+        sed -i '1i\db\tLJB2_PhyloP\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.LJB2_PhyloP
+    fi
+    
+    if [ $ljb2_siphy == "Y" ]
+    then
+        echo -e "\nLJB2 SiPhy Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver $otherinfo -dbtype ljb2_siphy annovarinput $humandb 2>&1
+    
+        annovarout=annovarinput.${buildver}_ljb2_siphy_dropped
+        sed -i '1i\db\tLJB2_SiPhy\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.LJB2_SiPhy
+    fi
 
 
 
-	### OLD IMPACT SCORE ANNOTATIONS
+    ### OLD IMPACT SCORE ANNOTATIONS
+
+    # SIFT
+    if [ $avsift == "Y" ]
+    then
+        echo -e "\nSIFT Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype avsift annovarinput $humandb 2>&1
+    
+        annovarout=annovarinput.${buildver}_avsift_dropped
+        sed -i '1i\db\tAVSIFT\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.AVSIFT
+    fi
 
-	# SIFT
-	if [ $avsift == "Y" ]
-	then
-		echo -e "\nSIFT Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype avsift annovarinput $humandb 2>&1
-	
-		annovarout=annovarinput.${buildver}_avsift_dropped
-		sed -i '1i\db\tAVSIFT\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.AVSIFT	
-	fi
+    #ljb refers to Liu, Jian, Boerwinkle paper in Human Mutation with pubmed ID 21520341. Cite this paper if you use the scores
+    # SIFT2
+    if [ $ljbsift == "Y" ]
+    then
+        echo -e "\nLJB SIFT Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype ljb_sift annovarinput $humandb 2>&1
+    
+        annovarout=annovarinput.${buildver}_ljb_sift_dropped
+        sed -i '1i\db\tLJB_SIFT\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.LJB_SIFT
+    fi
+
 
-	#ljb refers to Liu, Jian, Boerwinkle paper in Human Mutation with pubmed ID 21520341. Cite this paper if you use the scores
-	# SIFT2
-	if [ $ljbsift == "Y" ]
-	then
-		echo -e "\nLJB SIFT Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype ljb_sift annovarinput $humandb 2>&1
-	
-		annovarout=annovarinput.${buildver}_ljb_sift_dropped
-		sed -i '1i\db\tLJB_SIFT\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.LJB_SIFT
-	fi
+    # PolyPhen2
+    if [ $polyphen2 == "Y" ]
+    then
+        echo -e "\nPolyPhen Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype ljb_pp2 annovarinput $humandb 2>&1
+    
+        annovarout=annovarinput.${buildver}_ljb_pp2_dropped
+        sed -i '1i\db\tPolyPhen2\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.PolyPhen2
+    fi
+
+
+    # MutationTaster
+    if [ $mutationtaster == "Y" ]
+    then
+        echo -e "\nMutationTaster Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype ljb_mt annovarinput $humandb 2>&1
+    
+        annovarout=annovarinput.${buildver}_ljb_mt_dropped
+        sed -i '1i\db\tMutationTaster\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.MutationTaster
+    fi
 
 
-	# PolyPhen2
-	if [ $polyphen2 == "Y" ]
-	then
-		echo -e "\nPolyPhen Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype ljb_pp2 annovarinput $humandb 2>&1
-	
-		annovarout=annovarinput.${buildver}_ljb_pp2_dropped
-		sed -i '1i\db\tPolyPhen2\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.PolyPhen2
-	fi
+    # LRT
+    if [ $lrt == "Y" ]
+    then
+        echo -e "\nLRT Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype ljb_lrt annovarinput $humandb 2>&1
+    
+        annovarout=annovarinput.${buildver}_ljb_lrt_dropped
+        sed -i '1i\db\tLikelihoodRatioTestScore\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.LikelihoodRatioTestScore
+    fi
+
+    # PhyloP
+    if [ $phylop == "Y" ]
+    then
+        echo -e "\nPhyloP Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype ljb_phylop annovarinput $humandb 2>&1
+    
+        annovarout=annovarinput.${buildver}_ljb_phylop_dropped
+        sed -i '1i\db\tPhyloP\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.PhyloP
+    fi
 
 
-	# MutationTaster
-	if [ $mutationtaster == "Y" ]
-	then
-		echo -e "\nMutationTaster Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype ljb_mt annovarinput $humandb 2>&1
-	
-		annovarout=annovarinput.${buildver}_ljb_mt_dropped
-		sed -i '1i\db\tMutationTaster\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.MutationTaster
-	fi
+    ### ESP  Exome Variant Server
+    if [ $esp != "None" ] 
+    then
+        echo -e "\nESP Annotation"
+        for version in $espstr
+        do
+            echo "version: $version"
+            # 6500si ALL
+            if [ $version == "esp6500si_all" ]
+            then                 
+                $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype esp6500si_all annovarinput $humandb 2>&1
+    
+                annovarout=annovarinput.${buildver}_esp6500si_all_dropped
+                sed -i '1i\db\t'$esp6500si_colheader_ALL'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+                joinresults originalfile $annovarout 3 4 5 6 7 B.$esp6500si_colheader_ALL
+            fi
+
+            
+            # 6500si European American
+            if [ $version == "esp6500si_ea" ]
+            then
+                $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype esp6500si_ea annovarinput $humandb 2>&1
+    
+                annovarout=annovarinput.${buildver}_esp6500si_ea_dropped
+                sed -i '1i\db\t'$esp6500si_colheader_EA'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'" ' $annovarout 
+                joinresults originalfile $annovarout 3 4 5 6 7 B.$esp6500si_colheader_EA
+            fi
+
+            # 6500si African Americans
+            if [ $version == "esp6500si_aa" ]
+            then
+                $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype esp6500si_aa annovarinput $humandb 2>&1
+    
+                annovarout=annovarinput.${buildver}_esp6500si_aa_dropped
+                sed -i '1i\db\t'$esp6500si_colheader_AA'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'" ' $annovarout 
+                joinresults originalfile $annovarout 3 4 5 6 7 B.$esp6500si_colheader_AA
+            fi
 
 
-	# LRT
-	if [ $lrt == "Y" ]
-	then
-		echo -e "\nLRT Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype ljb_lrt annovarinput $humandb 2>&1
-	
-		annovarout=annovarinput.${buildver}_ljb_lrt_dropped
-		sed -i '1i\db\tLikelihoodRatioTestScore\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.LikelihoodRatioTestScore
-	fi
+            # 6500 ALL
+            if [ $version == "esp6500_all" ]
+            then
+                ls
+                $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype esp6500_all annovarinput $humandb 2>&1
+                
+                annovarout=annovarinput.${buildver}_esp6500_all_dropped
+                sed -i '1i\db\t'$esp6500_colheader_ALL'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'" ' $annovarout
+                joinresults originalfile $annovarout 3 4 5 6 7 B.$esp6500_colheader_ALL
+            fi
 
-	# PhyloP
-	if [ $phylop == "Y" ]
-	then
-		echo -e "\nPhyloP Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype ljb_phylop annovarinput $humandb 2>&1
-	
-		annovarout=annovarinput.${buildver}_ljb_phylop_dropped
-		sed -i '1i\db\tPhyloP\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.PhyloP
-	fi
+            
+            # 6500 European American
+            if [ $version == "esp6500_ea" ]
+            then
+                $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype esp6500_ea annovarinput $humandb 2>&1
+                annovarout=annovarinput.${buildver}_esp6500_ea_dropped
+                sed -i '1i\db\t'$esp6500_colheader_EA'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+                joinresults originalfile $annovarout 3 4 5 6 7 B.$esp6500_colheader_EA
+            fi
+
+            # 6500 African Americans
+            if [ $version == "esp6500_aa" ]
+            then
+                $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype esp6500_aa annovarinput $humandb 2>&1
+    
+                annovarout=annovarinput.${buildver}_esp6500_aa_dropped
+                sed -i '1i\db\t'$esp6500_colheader_AA'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+                joinresults originalfile $annovarout 3 4 5 6 7 B.$esp6500_colheader_AA
+            fi
 
 
-	### ESP  Exome Variant Server
-	if [ $esp != "None" ] 
-	then
-		echo -e "\nESP Annotation"
-		for version in $espstr
-		do
-			echo "version: $version"
-			# 6500si ALL
-			if [ $version == "esp6500si_all" ]
-			then 				
-				$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype esp6500si_all annovarinput $humandb 2>&1
-	
-				annovarout=annovarinput.${buildver}_esp6500si_all_dropped
-				sed -i '1i\db\t'$esp6500si_colheader_ALL'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-				joinresults originalfile $annovarout 3 4 5 6 7 B.$esp6500si_colheader_ALL
-			fi
+            # 5400 ALL
+            if [ $version == "esp5400_all" ]
+            then
+                $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype esp5400_all annovarinput $humandb 2>&1
+    
+                annovarout=annovarinput.${buildver}_esp5400_all_dropped
+                sed -i '1i\db\t'$esp5400_colheader_ALL'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+                joinresults originalfile $annovarout 3 4 5 6 7 B.$esp5400_colheader_ALL
+            fi
 
-			
-			# 6500si European American
-			if [ $version == "esp6500si_ea" ]
-			then
-				$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype esp6500si_ea annovarinput $humandb 2>&1
-	
-				annovarout=annovarinput.${buildver}_esp6500si_ea_dropped
-				sed -i '1i\db\t'$esp6500si_colheader_EA'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'" ' $annovarout 
-				joinresults originalfile $annovarout 3 4 5 6 7 B.$esp6500si_colheader_EA
-			fi
+            
+            # 5400 European American
+            if [ $version == "esp5400_ea" ]
+            then
+                $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype esp5400_ea annovarinput $humandb 2>&1
+    
+                annovarout=annovarinput.${buildver}_esp5400_ea_dropped
+                sed -i '1i\db\t'$esp5400_colheader_EA'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+                joinresults originalfile $annovarout 3 4 5 6 7 B.$esp5400_colheader_EA
+            fi
 
-			# 6500si African Americans
-			if [ $version == "esp6500si_aa" ]
-			then
-				$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype esp6500si_aa annovarinput $humandb 2>&1
-	
-				annovarout=annovarinput.${buildver}_esp6500si_aa_dropped
-				sed -i '1i\db\t'$esp6500si_colheader_AA'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'" ' $annovarout 
-				joinresults originalfile $annovarout 3 4 5 6 7 B.$esp6500si_colheader_AA
-			fi
+            # 5400 African Americans
+            if [ $version == "esp5400_aa" ]
+            then
+                $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype esp5400_aa annovarinput $humandb 2>&1
+    
+                annovarout=annovarinput.${buildver}_esp5400_aa_dropped
+                sed -i '1i\db\t'$esp5400_colheader_AA'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+                joinresults originalfile $annovarout 3 4 5 6 7 B.$esp5400_colheader_AA
+            fi
 
+        done
+    fi
 
-			# 6500 ALL
-			if [ $version == "esp6500_all" ]
-			then 				
-				ls
-				$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype esp6500_all annovarinput $humandb 2>&1
-				
-				annovarout=annovarinput.${buildver}_esp6500_all_dropped				
-				sed -i '1i\db\t'$esp6500_colheader_ALL'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'" ' $annovarout
-				joinresults originalfile $annovarout 3 4 5 6 7 B.$esp6500_colheader_ALL
-			fi
-
-			
-			# 6500 European American
-			if [ $version == "esp6500_ea" ]
-			then
-				$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype esp6500_ea annovarinput $humandb 2>&1	
-				annovarout=annovarinput.${buildver}_esp6500_ea_dropped
-				sed -i '1i\db\t'$esp6500_colheader_EA'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-				joinresults originalfile $annovarout 3 4 5 6 7 B.$esp6500_colheader_EA
-			fi
+    #ExAC-03 database 
+    if [ $exac03 == "Y" ]
+    then
+        echo -e "\nExAC03 Annotation"
+        $scriptsdir/annotate_variation.pl --filter -otherinfo --buildver $buildver --otherinfo -dbtype exac03 annovarinput $humandb 2>&1
+            
+        #annovarout=annovarinput.${buildver}_exac03_dropped
+        
+        # split allelefrequency column into several columns, one per population
+        awk 'BEGIN{FS="\t"
+                   OFS="\t"
+                   }{
+                   gsub(",","\t",$2)
+                   print $0
+                   }END{}' annovarinput.${buildver}_exac03_dropped > $annovarout
+        
+        sed -i '1i\db\tExAC_ALL\tExAC_AFR\tExAC_AMR\tExAC_EAS\tExAC_FIN\tExAC_NFE\tExAC_OTH\tExAC_SAS\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 10 11 12 13 14 B.ExAC_ALL,B.ExAC_AFR,B.ExAC_AMR,B.ExAC_EAS,B.ExAC_FIN,B.ExAC_NFE,B.ExAC_OTH,B.ExAC_SAS
+    fi
 
-			# 6500 African Americans
-			if [ $version == "esp6500_aa" ]
-			then
-				$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype esp6500_aa annovarinput $humandb 2>&1
-	
-				annovarout=annovarinput.${buildver}_esp6500_aa_dropped
-				sed -i '1i\db\t'$esp6500_colheader_AA'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-				joinresults originalfile $annovarout 3 4 5 6 7 B.$esp6500_colheader_AA
-			fi
-
-
-			# 5400 ALL
-			if [ $version == "esp5400_all" ]
-			then 				
-				$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype esp5400_all annovarinput $humandb 2>&1
-	
-				annovarout=annovarinput.${buildver}_esp5400_all_dropped
-				sed -i '1i\db\t'$esp5400_colheader_ALL'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-				joinresults originalfile $annovarout 3 4 5 6 7 B.$esp5400_colheader_ALL
-			fi
-
-			
-			# 5400 European American
-			if [ $version == "esp5400_ea" ]
-			then
-				$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype esp5400_ea annovarinput $humandb 2>&1
-	
-				annovarout=annovarinput.${buildver}_esp5400_ea_dropped
-				sed -i '1i\db\t'$esp5400_colheader_EA'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-				joinresults originalfile $annovarout 3 4 5 6 7 B.$esp5400_colheader_EA
-			fi
+        #ExAC-03 database 
+    if [ $exac03nonpsych == "Y" ]
+    then
+        echo -e "\nExAC03 non-psych Annotation"
+        $scriptsdir/annotate_variation.pl --filter -otherinfo --buildver $buildver --otherinfo -dbtype exac03nonpsych annovarinput $humandb 2>&1
+            
+        #annovarout=annovarinput.${buildver}_exac03_dropped
+        
+        # split allelefrequency column into several columns, one per population
+        awk 'BEGIN{FS="\t"
+                   OFS="\t"
+                   }{
+                   gsub(",","\t",$2)
+                   print $0
+                   }END{}' annovarinput.${buildver}_exac03nonpsych_dropped > $annovarout
+        
+        sed -i '1i\db\tExAC_non-phsych_ALL\tExAC_non-phsych_AFR\tExAC_non-phsych_AMR\tExAC_non-phsych_EAS\tExAC_non-phsych_FIN\tExAC_non-phsych_NFE\tExAC_non-phsych_OTH\tExAC_non-phsych_SAS\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 10 11 12 13 14 B.ExAC_non-phsych_ALL,B.ExAC_non-phsych_AFR,B.ExAC_non-phsych_AMR,B.ExAC_non-phsych_EAS,B.ExAC_non-phsych_FIN,B.ExAC_non-phsych_NFE,B.ExAC_non-phsych_OTH,B.ExAC_non-phsych_SAS
+    fi
+    
+    #ExAC-03 database 
+    if [ $exac03nontcga == "Y" ]
+    then
+        echo -e "\nExAC03 non-tcga Annotation"
+        $scriptsdir/annotate_variation.pl --filter -otherinfo --buildver $buildver --otherinfo -dbtype exac03nontcga annovarinput $humandb 2>&1
+            
+        #annovarout=annovarinput.${buildver}_exac03_dropped
+        
+        # split allelefrequency column into several columns, one per population
+        awk 'BEGIN{FS="\t"
+                   OFS="\t"
+                   }{
+                   gsub(",","\t",$2)
+                   print $0
+                   }END{}' annovarinput.${buildver}_exac03nontcga_dropped > $annovarout
+        
+        sed -i '1i\db\tExAC_non-TCGA_ALL\tExAC_non-TCGA_AFR\tExAC_non-TCGA_AMR\tExAC_non-TCGA_EAS\tExAC_non-TCGA_FIN\tExAC_non-TCGA_NFE\tExAC_non-TCGA_OTH\tExAC_non-TCGA_SAS\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 10 11 12 13 14 B.ExAC_non-TCGA_ALL,B.ExAC_non-TCGA_AFR,B.ExAC_non-TCGA_AMR,B.ExAC_non-TCGA_EAS,B.ExAC_non-TCGA_FIN,B.ExAC_non-TCGA_NFE,B.ExAC_non-TCGA_OTH,B.ExAC_non-TCGA_SAS
+    fi
+    
+    #dbscSNV 1.1 
+    if [ $dbscsnv11 == "Y" ]
+    then
+        echo -e "\ndbscSNV11 Annotation"
+        $scriptsdir/annotate_variation.pl --filter -otherinfo --buildver $buildver -dbtype dbscsnv11 annovarinput $humandb 2>&1
+    
+        #annovarout="annovarinput.${buildver}_dbscsnv11_dropped"
+        awk 'BEGIN{FS="\t"
+                   OFS="\t"
+                   }{
+                   gsub(",","\t",$2)
+                   print $0
+                   }END{}' annovarinput.${buildver}_dbscsnv11_dropped > $annovarout        
+        
+        sed -i '1i\db\tdbscSNV11_ADA_SCORE\tdbscSNV11_RF_SCORE\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 4 5 6 7 8 B.dbscSNV11_ADA_SCORE,B.dbscSNV11_RF_SCORE
+    fi
+    
+    
+    #kaviar_20150923
+    if [ $kaviar_20150923 == "Y" ]
+    then
+        echo -e "\nkaviar_20150923 Annotation"
+        $scriptsdir/annotate_variation.pl --filter -otherinfo --buildver $buildver -dbtype kaviar_20150923 annovarinput $humandb 2>&1
+    
+        #annovarout="annovarinput.${buildver}_kaviar_20150923_dropped"
+        awk 'BEGIN{FS="\t"
+                   OFS="\t"
+                   }{
+                   gsub(",","\t",$2)
+                   print $0
+                   }END{}' annovarinput.${buildver}_kaviar_20150923_dropped > $annovarout        
+        
+        sed -i '1i\db\tKaviar_AF\tKaviar_AC\tKaviar_AN\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 5 6 7 8 9 B.Kaviar_AF,B.Kaviar_AC,B.Kaviar_AN
+    fi
+    
+    #hrcr1
+    if [ $hrcr1 == "Y" ]
+    then
+        echo -e "\nhrcr1 Annotation"
+        $scriptsdir/annotate_variation.pl --filter -otherinfo --buildver $buildver -dbtype hrcr1 annovarinput $humandb 2>&1
+    
+        #annovarout="annovarinput.${buildver}_dbscsnv11_dropped"
+        awk 'BEGIN{FS="\t"
+                   OFS="\t"
+                   }{
+                   gsub(",","\t",$2)
+                   print $0
+                   }END{}' annovarinput.${buildver}_hrcr1_dropped > $annovarout        
+        sed -i '1i\db\tHRC_AF\tHRC_AC\tHRC_AN\tHRC_non1000G_AF\tHRC_non1000G_AC\tHRC_non1000g_AN\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 8 9 10 11 12 B.HRC_AF,B.HRC_AC,B.HRC_AN,B.HRC_non1000g_AF,B.HRC_non1000g_AC,B.HRC_non1000g_AN
+    fi
+    
+    #dbnsfp30a
+    if [ $dbnsfp30a == "Y" ]
+    then
+        echo -e "\ndbnsfp30a Annotation"
+        $scriptsdir/annotate_variation.pl --filter -otherinfo --buildver $buildver -dbtype dbnsfp30a annovarinput $humandb 2>&1
+    
+        #annovarout="annovarinput.${buildver}_dbnsfp30a_dropped"
+        awk 'BEGIN{FS="\t"
+                   OFS="\t"
+                   }{
+                   gsub(",","\t",$2)
+                   print $0
+                   }END{}' annovarinput.${buildver}_dbnsfp30a_dropped > $annovarout
 
-			# 5400 African Americans
-			if [ $version == "esp5400_aa" ]
-			then
-				$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype esp5400_aa annovarinput $humandb 2>&1
-	
-				annovarout=annovarinput.${buildver}_esp5400_aa_dropped
-				sed -i '1i\db\t'$esp5400_colheader_AA'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-				joinresults originalfile $annovarout 3 4 5 6 7 B.$esp5400_colheader_AA
-			fi
-
-		done
-	fi	
-
-	
-	#ExAC-03 database 
-	if [ $exac03 == "Y" ]
-	then
-		echo -e "\nExAC03 Annotation"
-		$scriptsdir/annotate_variation.pl --filter -otherinfo --buildver $buildver --otherinfo -dbtype exac03 annovarinput $humandb 2>&1
-	        
-		#annovarout=annovarinput.${buildver}_exac03_dropped
-		
-		# split allelefrequency column into several columns, one per population
-		awk 'BEGIN{FS="\t"
-		           OFS="\t"		           
-		           }{		           
-		           gsub(",","\t",$2)
-		           print $0		           
-		           }END{}' annovarinput.${buildver}_exac03_dropped > $annovarout
-		
-		sed -i '1i\db\tExAC_Freq\tExAC_AFR\tExAC_AMR\tExAC_EAS\tExAC_FIN\tExAC_NFE\tExAC_OTH\tExAC_SAS\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 10 11 12 13 14 B.ExAC_Freq,B.ExAC_AFR,B.ExAC_AMR,B.ExAC_EAS,B.ExAC_FIN,B.ExAC_NFE,B.ExAC_OTH,B.ExAC_SAS	
-	fi
-
+        sed -i '1i\db\tdbNSFP_SIFT_score\tdbNSFP_SIFT_pred\tdbNSFP_Polyphen2_HDIV_score\tdbNSFP_Polyphen2_HDIV_pred\tdbNSFP_Polyphen2_HVAR_score\tdbNSFP_Polyphen2_HVAR_pred\tdbNSFP_LRT_score\tdbNSFP_LRT_pred\tdbNSFP_MutationTaster_score\tdbNSFP_MutationTaster_pred\tdbNSFP_MutationAssessor_score\tdbNSFP_MutationAssessor_pred\tdbNSFP_FATHMM_score\tdbNSFP_FATHMM_pred\tdbNSFP_PROVEAN_score\tdbNSFP_PROVEAN_pred\tdbNSFP_VEST3_score\tdbNSFP_CADD_raw\tdbNSFP_CADD_phredDANN_score\tdbNSFP_fathmm-MKL_coding_score\tdbNSFP_fathmm-MKL_coding_pred\tdbNSFP_MetaSVM_score\tdbNSFP_MetaSVM_pred\tdbNSFP_MetaLR_score\tdbNSFP_MetaLR_pred\tdbNSFP_integrated_fitCons_score\tdbNSFP_integrated_confidence_value\tdbNSFP_GERP_RS\tdbNSFP_phyloP7way_vertebrate\tdbNSFP_phyloP20way_mammalian\tdbNSFP_phastCons7way_vertebrate\tdbNSFP_phastCons20way_mammalian\tdbNSFP_SiPhy_29way_logOdds\tdbNSFP_unknown\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 36 37 38 39 40 B.dbNSFP_SIFT_score,B.dbNSFP_SIFT_pred,B.dbNSFP_Polyphen2_HDIV_score,B.dbNSFP_Polyphen2_HDIV_pred,B.dbNSFP_Polyphen2_HVAR_score,B.dbNSFP_Polyphen2_HVAR_pred,B.dbNSFP_LRT_score,B.dbNSFP_LRT_pred,B.dbNSFP_MutationTaster_score,B.dbNSFP_MutationTaster_pred,B.dbNSFP_MutationAssessor_score,B.dbNSFP_MutationAssessor_pred,B.dbNSFP_FATHMM_score,B.dbNSFP_FATHMM_pred,B.dbNSFP_PROVEAN_score,B.dbNSFP_PROVEAN_pred,B.dbNSFP_VEST3_score,B.dbNSFP_CADD_raw,B.dbNSFP_CADD_phredDANN_score,B.dbNSFP_fathmm-MKL_coding_score,B.dbNSFP_fathmm-MKL_coding_pred,B.dbNSFP_MetaSVM_score,B.dbNSFP_MetaSVM_pred,B.dbNSFP_MetaLR_score,B.dbNSFP_MetaLR_pred,B.dbNSFP_integrated_fitCons_score,B.dbNSFP_integrated_confidence_value,B.dbNSFP_GERP_RS,B.dbNSFP_phyloP7way_vertebrate,B.dbNSFP_phyloP20way_mammalian,B.dbNSFP_phastCons7way_vertebrate,B.dbNSFP_phastCons20way_mammalian,B.dbNSFP_SiPhy_29way_logOdds
+        
+    fi
+    
+    #mitimpact2
+    if [ $mitimpact2 == "Y" ]
+    then
+        echo -e "\nmitimpact2 Annotation"        
+        $scriptsdir/annotate_variation.pl --filter -otherinfo --buildver $buildver -dbtype mitimpact2 annovarinput $humandb 2>&1
+    
+        #annovarout="annovarinput.${buildver}_mitimpact2_dropped"
+        awk 'BEGIN{FS="\t"
+                   OFS="\t"
+                   }{
+                   gsub(",","\t",$2)
+                   print $0
+                   }END{}' annovarinput.${buildver}_mitimpact2_dropped > $annovarout
+        
+        sed -i '1i\db\tMITimpact2_Gene_symbol\tMITimpact2_OXPHOS_Complex\tMITimpact2_Ensembl_Gene_ID\tMITimpact2_Ensembl_Protein_ID\tMITimpact2_Uniprot_Name\tMITimpact2_Uniprot_ID\tMITimpact2_NCBI_Gene_ID\tMITimpact2_NCBI_Protein_ID\tMITimpact2_Gene_pos\tMITimpact2_AA_pos\tMITimpact2_AA_sub\tMITimpact2_Codon_sub\tMITimpact2_dbSNP_ID\tMITimpact2_PhyloP_46V\tMITimpact2_PhastCons_46V\tMITimpact2_PhyloP_100V\tMITimpact2_PhastCons_100V\tMITimpact2_SiteVar\tMITimpact2_PolyPhen2_prediction\tMITimpact2_PolyPhen2_score\tMITimpact2_SIFT_prediction\tMITimpact2_SIFT_score\tMITimpact2_FatHmm_prediction\tMITimpact2_FatHmm_score\tMITimpact2_PROVEAN_prediction\tMITimpact2_PROVEAN_score\tMITimpact2_MutAss_prediction\tMITimpact2_MutAss_score\tMITimpact2_EFIN_Swiss_Prot_Score\tMITimpact2_EFIN_Swiss_Prot_Prediction\tMITimpact2_EFIN_HumDiv_Score\tMITimpact2_EFIN_HumDiv_Prediction\tMITimpact2_CADD_score\tMITimpact2_CADD_Phred_score\tMITimpact2_CADD_prediction\tMITimpact2_Carol_prediction\tMITimpact2_Carol_score\tMITimpact2_Condel_score\tMITimpact2_Condel_pred\tMITimpact2_COVEC_WMV\tMITimpact2_COVEC_WMV_prediction\tMITimpact2_PolyPhen2_score_transf\tMITimpact2_PolyPhen2_pred_transf\tMITimpact2_SIFT_score_transf\tMITimpact2_SIFT_pred_transf\tMITimpact2_MutAss_score_transf\tMITimpact2_MutAss_pred_transf\tMITimpact2_Perc_coevo_Sites\tMITimpact2_Mean_MI_score\tMITimpact2_COSMIC_ID\tMITimpact2_Tumor_site\tMITimpact2_Examined_samples\tMITimpact2_Mutation_frequency\tMITimpact2_US\tMITimpact2_Status\tMITimpact2_Associated_disease\tMITimpact2_Presence_in_TD\tMITimpact2_Class_predicted\tMITimpact2_Prob_N\tMITimpact2_Prob_P\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 62 63 64 65 66 B.MITimpact2_Gene_symbol,B.MITimpact2_OXPHOS_Complex,B.MITimpact2_Ensembl_Gene_ID,B.MITimpact2_Ensembl_Protein_ID,B.MITimpact2_Uniprot_Name,B.MITimpact2_Uniprot_ID,B.MITimpact2_NCBI_Gene_ID,B.MITimpact2_NCBI_Protein_ID,B.MITimpact2_Gene_pos,B.MITimpact2_AA_pos,B.MITimpact2_AA_sub,B.MITimpact2_Codon_sub,B.MITimpact2_dbSNP_ID,B.MITimpact2_PhyloP_46V,B.MITimpact2_PhastCons_46V,B.MITimpact2_PhyloP_100V,B.MITimpact2_PhastCons_100V,B.MITimpact2_SiteVar,B.MITimpact2_PolyPhen2_prediction,B.MITimpact2_PolyPhen2_score,B.MITimpact2_SIFT_prediction,B.MITimpact2_SIFT_score,B.MITimpact2_FatHmm_prediction,B.MITimpact2_FatHmm_score,B.MITimpact2_PROVEAN_prediction,B.MITimpact2_PROVEAN_score,B.MITimpact2_MutAss_prediction,B.MITimpact2_MutAss_score,B.MITimpact2_EFIN_Swiss_Prot_Score,B.MITimpact2_EFIN_Swiss_Prot_Prediction,B.MITimpact2_EFIN_HumDiv_Score,B.MITimpact2_EFIN_HumDiv_Prediction,B.MITimpact2_CADD_score,B.MITimpact2_CADD_Phred_score,B.MITimpact2_CADD_prediction,B.MITimpact2_Carol_prediction,B.MITimpact2_Carol_score,B.MITimpact2_Condel_score,B.MITimpact2_Condel_pred,B.MITimpact2_COVEC_WMV,B.MITimpact2_COVEC_WMV_prediction,B.MITimpact2_PolyPhen2_score_transf,B.MITimpact2_PolyPhen2_pred_transf,B.MITimpact2_SIFT_score_transf,B.MITimpact2_SIFT_pred_transf,B.MITimpact2_MutAss_score_transf,B.MITimpact2_MutAss_pred_transf,B.MITimpact2_Perc_coevo_Sites,B.MITimpact2_Mean_MI_score,B.MITimpact2_COSMIC_ID,B.MITimpact2_Tumor_site,B.MITimpact2_Examined_samples,B.MITimpact2_Mutation_frequency,B.MITimpact2_US,B.MITimpact2_Status,B.MITimpact2_Associated_disease,B.MITimpact2_Presence_in_TD,B.MITimpact2_Class_predicted,B.MITimpact2_Prob_N,B.MITimpact2_Prob_P
+    fi
+    
+    #mitimpact24
+    if [ $mitimpact24 == "Y" ]
+    then
+        echo -e "\nmitimpact24 Annotation"        
+        $scriptsdir/annotate_variation.pl --filter -otherinfo --buildver $buildver -dbtype mitimpact24 annovarinput $humandb 2>&1
+    
+        #annovarout="annovarinput.${buildver}_mitimpact24_dropped"
+        awk 'BEGIN{FS="\t"
+                   OFS="\t"
+                   }{
+                   gsub(",","\t",$24)
+                   print $0
+                   }END{}' annovarinput.${buildver}_mitimpact24_dropped > $annovarout
+        
+        sed -i '1i\db\tMITimpact24_Gene_symbol\tMITimpact24_OXPHOS_Complex\tMITimpact24_Ensembl_Gene_ID\tMITimpact24_Ensembl_Protein_ID\tMITimpact24_Uniprot_Name\tMITimpact24_Uniprot_ID\tMITimpact24_NCBI_Gene_ID\tMITimpact24_NCBI_Protein_ID\tMITimpact24_Gene_pos\tMITimpact24_AA_pos\tMITimpact24_AA_sub\tMITimpact24_Codon_sub\tMITimpact24_dbSNP_ID\tMITimpact24_PhyloP_46V\tMITimpact24_PhastCons_46V\tMITimpact24_PhyloP_100V\tMITimpact24_PhastCons_100V\tMITimpact24_SiteVar\tMITimpact24_PolyPhen24_prediction\tMITimpact24_PolyPhen24_score\tMITimpact24_SIFT_prediction\tMITimpact24_SIFT_score\tMITimpact24_FatHmm_prediction\tMITimpact24_FatHmm_score\tMITimpact24_PROVEAN_prediction\tMITimpact24_PROVEAN_score\tMITimpact24_MutAss_prediction\tMITimpact24_MutAss_score\tMITimpact24_EFIN_Swiss_Prot_Score\tMITimpact24_EFIN_Swiss_Prot_Prediction\tMITimpact24_EFIN_HumDiv_Score\tMITimpact24_EFIN_HumDiv_Prediction\tMITimpact24_CADD_score\tMITimpact24_CADD_Phred_score\tMITimpact24_CADD_prediction\tMITimpact24_Carol_prediction\tMITimpact24_Carol_score\tMITimpact24_Condel_score\tMITimpact24_Condel_pred\tMITimpact24_COVEC_WMV\tMITimpact24_COVEC_WMV_prediction\tMITimpact24_PolyPhen24_score_transf\tMITimpact24_PolyPhen24_pred_transf\tMITimpact24_SIFT_score_transf\tMITimpact24_SIFT_pred_transf\tMITimpact24_MutAss_score_transf\tMITimpact24_MutAss_pred_transf\tMITimpact24_Perc_coevo_Sites\tMITimpact24_Mean_MI_score\tMITimpact24_COSMIC_ID\tMITimpact24_Tumor_site\tMITimpact24_Examined_samples\tMITimpact24_Mutation_frequency\tMITimpact24_US\tMITimpact24_Status\tMITimpact24_Associated_disease\tMITimpact24_Presence_in_TD\tMITimpact24_Class_predicted\tMITimpact24_Prob_N\tMITimpact24_Prob_P\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 62 63 64 65 66 B.MITimpact24_Gene_symbol,B.MITimpact24_OXPHOS_Complex,B.MITimpact24_Ensembl_Gene_ID,B.MITimpact24_Ensembl_Protein_ID,B.MITimpact24_Uniprot_Name,B.MITimpact24_Uniprot_ID,B.MITimpact24_NCBI_Gene_ID,B.MITimpact24_NCBI_Protein_ID,B.MITimpact24_Gene_pos,B.MITimpact24_AA_pos,B.MITimpact24_AA_sub,B.MITimpact24_Codon_sub,B.MITimpact24_dbSNP_ID,B.MITimpact24_PhyloP_46V,B.MITimpact24_PhastCons_46V,B.MITimpact24_PhyloP_100V,B.MITimpact24_PhastCons_100V,B.MITimpact24_SiteVar,B.MITimpact24_PolyPhen24_prediction,B.MITimpact24_PolyPhen24_score,B.MITimpact24_SIFT_prediction,B.MITimpact24_SIFT_score,B.MITimpact24_FatHmm_prediction,B.MITimpact24_FatHmm_score,B.MITimpact24_PROVEAN_prediction,B.MITimpact24_PROVEAN_score,B.MITimpact24_MutAss_prediction,B.MITimpact24_MutAss_score,B.MITimpact24_EFIN_Swiss_Prot_Score,B.MITimpact24_EFIN_Swiss_Prot_Prediction,B.MITimpact24_EFIN_HumDiv_Score,B.MITimpact24_EFIN_HumDiv_Prediction,B.MITimpact24_CADD_score,B.MITimpact24_CADD_Phred_score,B.MITimpact24_CADD_prediction,B.MITimpact24_Carol_prediction,B.MITimpact24_Carol_score,B.MITimpact24_Condel_score,B.MITimpact24_Condel_pred,B.MITimpact24_COVEC_WMV,B.MITimpact24_COVEC_WMV_prediction,B.MITimpact24_PolyPhen24_score_transf,B.MITimpact24_PolyPhen24_pred_transf,B.MITimpact24_SIFT_score_transf,B.MITimpact24_SIFT_pred_transf,B.MITimpact24_MutAss_score_transf,B.MITimpact24_MutAss_pred_transf,B.MITimpact24_Perc_coevo_Sites,B.MITimpact24_Mean_MI_score,B.MITimpact24_COSMIC_ID,B.MITimpact24_Tumor_site,B.MITimpact24_Examined_samples,B.MITimpact24_Mutation_frequency,B.MITimpact24_US,B.MITimpact24_Status,B.MITimpact24_Associated_disease,B.MITimpact24_Presence_in_TD,B.MITimpact24_Class_predicted,B.MITimpact24_Prob_N,B.MITimpact24_Prob_P
+    fi
+    
+    
     #GoNL database 
-	if [ $gonl == "Y" ]
-	then
-	
+    if [ $gonl == "Y" ]
+    then
+    
         if [ $buildver == "hg19" ]
             then
-		echo -e "\nGoNL Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver --otherinfo -dbtype generic -genericdbfile ${buildver}_gonl.txt annovarinput $humandb 2>&1
-	        
-	        ls
-		annovarout=annovarinput.${buildver}_generic_dropped
-		
-		head $annovarout
-		
-		sed -i '1i\db\tGoNL\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.GoNL	
-		
+        echo -e "\nGoNL Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver --otherinfo -dbtype generic -genericdbfile ${buildver}_gonl.txt annovarinput $humandb 2>&1
+
+            ls
+        annovarout=annovarinput.${buildver}_generic_dropped
+        
+        head $annovarout
+        
+        sed -i '1i\db\tGoNL\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.GoNL
+        
             fi
-            
-	fi
-	
-	#SPIDEX database 
-	if [ $spidex == "Y" ]
-	then
-	
+
+    fi
+    
+    #SPIDEX database 
+    if [ $spidex == "Y" ]
+    then
+    
         if [ $buildver == "hg19" ]
         then
-			echo -e "\nSPIDEX Annotation"
-			$scriptsdir/annotate_variation.pl --filter --buildver $buildver --otherinfo -dbtype spidex annovarinput $humandb 2>&1
-			    
-			# split allelefrequency column into several columns, one per population
-		    awk 'BEGIN{FS="\t"
-		           OFS="\t"		           
-		           }{		           
-		           gsub(",","\t",$2)
-		           print $0		           
-		    }END{}' annovarinput.${buildver}_spidex_dropped > $annovarout    
-			
-			#annovarout=annovarinput.${buildver}_spidex_dropped
-		    #head $annovarout
-		
-			sed -i '1i\db\tSPIDEX_dpsi_max_tissue\tSPIDEX_dpsi_zscore\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-			joinresults originalfile $annovarout 4 5 6 7 8 B.SPIDEX_dpsi_max_tissue,B.SPIDEX_dpsi_zscore	
-		
+            echo -e "\nSPIDEX Annotation"
+            $scriptsdir/annotate_variation.pl --filter --buildver $buildver --otherinfo -dbtype spidex annovarinput $humandb 2>&1
+                
+            # split allelefrequency column into several columns, one per population
+            awk 'BEGIN{FS="\t"
+                   OFS="\t"
+                   }{
+                   gsub(",","\t",$2)
+                   print $0
+            }END{}' annovarinput.${buildver}_spidex_dropped > $annovarout    
+            
+            #annovarout=annovarinput.${buildver}_spidex_dropped
+            #head $annovarout
+        
+            sed -i '1i\db\tSPIDEX_dpsi_max_tissue\tSPIDEX_dpsi_zscore\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+            joinresults originalfile $annovarout 4 5 6 7 8 B.SPIDEX_dpsi_max_tissue,B.SPIDEX_dpsi_zscore
         fi
-            
-	fi
-	
-	
-	#GERP++
-	if [ $gerp == "Y" ]
-	then
-		echo -e "\nGERP++ Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype gerp++gt2 annovarinput $humandb 2>&1
-	
-		annovarout="annovarinput.${buildver}_gerp++gt2_dropped"
-		sed -i '1i\db\tGERP++\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.GERP++
-	fi
+
+    fi
+
+    #GERP++
+    if [ $gerp == "Y" ]
+    then
+        echo -e "\nGERP++ Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype gerp++gt2 annovarinput $humandb 2>&1
+    
+        annovarout="annovarinput.${buildver}_gerp++gt2_dropped"
+        sed -i '1i\db\tGERP++\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.GERP++
+    fi
 
 
-	#COSMIC
-	if [[ $cosmic61 == "Y" && $buildver == "hg19" ]]
-	then
-		echo -e "\nCOSMIC61 Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype cosmic61 annovarinput $humandb 2>&1
-	
-		annovarout="annovarinput.${buildver}_cosmic61_dropped"
-		sed -i '1i\db\tCOSMIC61\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.COSMIC61
+    #COSMIC
+    if [[ $cosmic61 == "Y" && $buildver == "hg19" ]]
+    then
+        echo -e "\nCOSMIC61 Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype cosmic61 annovarinput $humandb 2>&1
+    
+        annovarout="annovarinput.${buildver}_cosmic61_dropped"
+        sed -i '1i\db\tCOSMIC61\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.COSMIC61
 
-	fi
+    fi
 
-	if [[ $cosmic63 == "Y" && $buildver == "hg19" ]]
-	then
-		echo -e "\nCOSMIC63 Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype cosmic63 annovarinput $humandb 2>&1
-	
-		annovarout="annovarinput.${buildver}_cosmic63_dropped"
-		sed -i '1i\db\tCOSMIC63\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.COSMIC63
+    if [[ $cosmic63 == "Y" && $buildver == "hg19" ]]
+    then
+        echo -e "\nCOSMIC63 Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype cosmic63 annovarinput $humandb 2>&1
+    
+        annovarout="annovarinput.${buildver}_cosmic63_dropped"
+        sed -i '1i\db\tCOSMIC63\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.COSMIC63
 
-	fi
+    fi
 
-	if [[ $cosmic64 == "Y" && $buildver == "hg19" ]]
-	then
-		echo -e "\nCOSMIC64 Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype cosmic64 annovarinput $humandb 2>&1
-	
-		annovarout="annovarinput.${buildver}_cosmic64_dropped"
-		sed -i '1i\db\tCOSMIC64\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.COSMIC64
+    if [[ $cosmic64 == "Y" && $buildver == "hg19" ]]
+    then
+        echo -e "\nCOSMIC64 Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype cosmic64 annovarinput $humandb 2>&1
+    
+        annovarout="annovarinput.${buildver}_cosmic64_dropped"
+        sed -i '1i\db\tCOSMIC64\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.COSMIC64
 
-	fi
-	
-	if [[ $cosmic65 == "Y" && $buildver == "hg19" ]]
-	then
-		echo -e "\nCOSMIC65 Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype cosmic65 annovarinput $humandb 2>&1
-	
-		annovarout="annovarinput.${buildver}_cosmic65_dropped"
-		sed -i '1i\db\tCOSMIC65\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.COSMIC65
+    fi
+    
+    if [[ $cosmic65 == "Y" && $buildver == "hg19" ]]
+    then
+        echo -e "\nCOSMIC65 Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype cosmic65 annovarinput $humandb 2>&1
+    
+        annovarout="annovarinput.${buildver}_cosmic65_dropped"
+        sed -i '1i\db\tCOSMIC65\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.COSMIC65
 
-	fi
+    fi
 
-	if [[ $cosmic67 == "Y" && $buildver == "hg19" ]]
-	then
-		echo -e "\nCOSMIC67 Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype cosmic67 annovarinput $humandb 2>&1
-	
-		annovarout="annovarinput.${buildver}_cosmic67_dropped"
-		sed -i '1i\db\tCOSMIC67\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.COSMIC67
+    if [[ $cosmic67 == "Y" && $buildver == "hg19" ]]
+    then
+        echo -e "\nCOSMIC67 Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype cosmic67 annovarinput $humandb 2>&1
+    
+        annovarout="annovarinput.${buildver}_cosmic67_dropped"
+        sed -i '1i\db\tCOSMIC67\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.COSMIC67
 
-	fi
-	
-	if [[ $cosmic68 == "Y" && $buildver == "hg19" ]]
-	then
-		echo -e "\nCOSMIC68 Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype cosmic68 annovarinput $humandb 2>&1
-	
-		annovarout="annovarinput.${buildver}_cosmic68_dropped"
-		sed -i '1i\db\tCOSMIC68\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.COSMIC68
+    fi
+    
+    if [[ $cosmic68 == "Y" && $buildver == "hg19" ]]
+    then
+        echo -e "\nCOSMIC68 Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype cosmic68 annovarinput $humandb 2>&1
+    
+        annovarout="annovarinput.${buildver}_cosmic68_dropped"
+        sed -i '1i\db\tCOSMIC68\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.COSMIC68
 
-	fi
-	
-	if [[ $cosmic70 == "Y" && $buildver == "hg19" ]]
-	then
-		echo -e "\nCOSMIC70 Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype cosmic70 annovarinput $humandb 2>&1
-	
-		annovarout="annovarinput.${buildver}_cosmic70_dropped"
-		sed -i '1i\db\tCOSMIC70\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.COSMIC70
+    fi
+    
+    if [[ $cosmic70 == "Y" && $buildver == "hg19" ]]
+    then
+        echo -e "\nCOSMIC70 Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype cosmic70 annovarinput $humandb 2>&1
+    
+        annovarout="annovarinput.${buildver}_cosmic70_dropped"
+        sed -i '1i\db\tCOSMIC70\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.COSMIC70
 
-	fi
+    fi
 
-	if [[ $clinvar == "Y" && $buildver == "hg19" ]]
-	then
-		echo -e "\nCLINVAR Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype clinvar_20140211 annovarinput $humandb 2>&1
-	
-		annovarout="annovarinput.${buildver}_clinvar_20140211_dropped"
-		sed -i '1i\db\tCLINVAR\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.CLINVAR
+    if [[ $clinvar == "Y" && $buildver == "hg19" ]]
+    then
+        echo -e "\nCLINVAR Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype clinvar_20140211 annovarinput $humandb 2>&1
+    
+        annovarout="annovarinput.${buildver}_clinvar_20140211_dropped"
+        sed -i '1i\db\tCLINVAR\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.CLINVAR
 
-	fi
-	
-	if [[ $nci60 == "Y" && $buildver == "hg19" ]]
-	then
-		echo -e "\nNCI60 Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype nci60 annovarinput $humandb 2>&1
-	
-		annovarout="annovarinput.${buildver}_nci60_dropped"
-		sed -i '1i\db\tNCI60\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.NCI60
+    fi
+    
+    if [[ $nci60 == "Y" && $buildver == "hg19" ]]
+    then
+        echo -e "\nNCI60 Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype nci60 annovarinput $humandb 2>&1
+    
+        annovarout="annovarinput.${buildver}_nci60_dropped"
+        sed -i '1i\db\tNCI60\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.NCI60
 
-	fi
-	
-	#cg46
-	if [[ $cg46 == "Y"  ]]
-	then
-		echo -e "\nCG 46 genomes Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype cg46 annovarinput $humandb 2>&1
-	
-		annovarout="annovarinput.${buildver}_cg46_dropped"
-		sed -i '1i\db\t'${cg46_colheader}'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.${cg46_colheader}
+    fi
+    
+    #cg46
+    if [[ $cg46 == "Y"  ]]
+    then
+        echo -e "\nCG 46 genomes Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype cg46 annovarinput $humandb 2>&1
+    
+        annovarout="annovarinput.${buildver}_cg46_dropped"
+        sed -i '1i\db\t'${cg46_colheader}'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.${cg46_colheader}
 
-	fi
+    fi
 
 
-	#cg69
-	if [[ $cg69 == "Y"  ]]
-	then
-		echo -e "\nCG 69 genomes Annotation"
-		$scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype cg69 annovarinput $humandb 2>&1
-	
-		annovarout="annovarinput.${buildver}_cg69_dropped"
-		sed -i '1i\db\t'${cg69_colheader}'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
-		joinresults originalfile $annovarout 3 4 5 6 7 B.${cg69_colheader}
+    #cg69
+    if [[ $cg69 == "Y"  ]]
+    then
+        echo -e "\nCG 69 genomes Annotation"
+        $scriptsdir/annotate_variation.pl --filter --buildver $buildver -dbtype cg69 annovarinput $humandb 2>&1
+    
+        annovarout="annovarinput.${buildver}_cg69_dropped"
+        sed -i '1i\db\t'${cg69_colheader}'\tchromosome\tstart\tend\treference\talleleSeq"'"$vcfheader"'"' $annovarout 
+        joinresults originalfile $annovarout 3 4 5 6 7 B.${cg69_colheader}
 
-	fi
+    fi
 
 
-	
-	if [ $convertcoords == "Y" ]
-	then
-		echo "converting back coordinates"
-		awk 'BEGIN{
-				FS="\t";
-				OFS="\t";
-			}{
-				if (FNR==1)
-					print $0
-				if(FNR>1) { 
-					$"'"${chrcol}"'" = "chr"$"'"${chrcol}"'"
-					if( $"'"${vartypecol}"'" == "snp" ){ $"'"${startcol}"'" -= 1 }; 	
-					if( $"'"${vartypecol}"'" == "ins" ){ $"'"${refcol}"'" = "" };			
-					if( $"'"${vartypecol}"'" == "del" ){ $"'"${startcol}"'" -=1; $"'"${obscol}"'" = "" };
-					if( $"'"${vartypecol}"'" == "sub" ){ $"'"${startcol}"'" -= 1 }; 
-					print $0
-								
-				}
-			}	
-			END{
-			}' originalfile > originalfile_coords
-	else
-		mv originalfile originalfile_coords
-	fi
+    
+    if [ $convertcoords == "Y" ]
+    then
+        echo "converting back coordinates"
+        awk 'BEGIN{
+                FS="\t";
+                OFS="\t";
+            }{
+                if (FNR==1)
+                    print $0
+                if(FNR>1) { 
+                    $"'"${chrcol}"'" = "chr"$"'"${chrcol}"'"
+                    if( $"'"${vartypecol}"'" == "snp" ){ $"'"${startcol}"'" -= 1 };
+                    if( $"'"${vartypecol}"'" == "ins" ){ $"'"${refcol}"'" = "" };
+                    if( $"'"${vartypecol}"'" == "del" ){ $"'"${startcol}"'" -=1; $"'"${obscol}"'" = "" };
+                    if( $"'"${vartypecol}"'" == "sub" ){ $"'"${startcol}"'" -= 1 }; 
+                    print $0
+                }
+            }
+            END{
+            }' originalfile > originalfile_coords
+    else
+        mv originalfile originalfile_coords
+    fi
 
-	#restore "chr" prefix?
+    #restore "chr" prefix?
 
-	#move to outputfile
-	if [ ! -s annovarinput.invalid_input ]
-	then
-		echo "Congrats, your input file contained no invalid lines!" > annovarinput.invalid_input
-	fi
-	
-	cp originalfile_coords $outfile_all
-	cp annovarinput.invalid_input $outfile_invalid 2>&1
-	
-	sed -i 's/chrchr/chr/g' $outfile_all
-	sed -i 's/chrchr/chr/g' $outfile_invalid
-	
+    #move to outputfile
+    if [ ! -s annovarinput.invalid_input ]
+    then
+        echo "Congrats, your input file contained no invalid lines!" > annovarinput.invalid_input
+    fi
+
+    cp originalfile_coords $outfile_all
+    cp annovarinput.invalid_input $outfile_invalid 2>&1
+
+    sed -i 's/chrchr/chr/g' $outfile_all
+    sed -i 's/chrchr/chr/g' $outfile_invalid
+
 fi #if $dorunannovar
 
 
--- a/tools/annovar/annovar.xml	Tue Oct 27 11:01:10 2015 -0400
+++ b/tools/annovar/annovar.xml	Fri Mar 04 11:32:50 2016 -0500
@@ -1,233 +1,222 @@
-<tool id="AnnovarShed" name="ANNOVAR" version="2015oct">
-	<description> Annotate a file using ANNOVAR </description>
-	
-	<requirements>		
-		<requirement type="package" version="1.7">cgatools</requirement>
-	</requirements>
-	
-	<command interpreter="bash">
-		annovar.sh		
-		--esp ${esp}
-		--gonl ${gonl}
-		--exac03 ${exac03}
-		--spidex ${spidex}
-		--gerp ${gerp}
-		--cosmic61 ${cosmic61}
-		--cosmic63 ${cosmic63}	
-		--cosmic64 ${cosmic64}		
-		--cosmic65 ${cosmic65}
-		--cosmic67 ${cosmic67}
-		--cosmic68 ${cosmic68}
-		--outall ${annotated}		
-		--outinvalid ${invalid}
-		--dorunannovar ${dorun}
-		--inputfile ${infile}
-		--buildver ${reference.fields.dbkey}
-		--humandb ${reference.fields.ANNOVAR_humandb}
-		--scriptsdir ${reference.fields.ANNOVAR_scripts}	
-		--verdbsnp ${verdbsnp}
-		--geneanno ${geneanno}
-		--tfbs ${tfbs}
-		--mce ${mce}
-		--cytoband ${cytoband}
-		--segdup ${segdup}
-        --dgv ${dgv}
-		--gwas ${gwas}				
-		#if $filetype.type == "other"
-			--varfile N
-			--VCF N
-			--chrcol ${filetype.col_chr}
-			--startcol ${filetype.col_start}
-			--endcol ${filetype.col_end}
-			--obscol ${filetype.col_obs}
-			--refcol ${filetype.col_ref}
-		
-			#if $filetype.convertcoords.convert == "Y"
-				--vartypecol ${filetype.convertcoords.col_vartype}
-				--convertcoords Y
-			#else
-				--convertcoords N
-			#end if
-		#end if
-		#if $filetype.type == "vcf"
-			--varfile N
-			--VCF Y
-			--convertcoords N
-		#end if
-		#if $filetype.type == "varfile"
-			--varfile Y
-			--VCF N			
-		#end if			
-		--cg46 ${cgfortysix}
-		--cg69 ${cgsixtynine}
-		--ver1000g ${ver1000g}
-		--hgvs ${hgvs}
-		--otherinfo ${otherinfo}
-		--newimpactscores ${newimpactscores}
-		--clinvar ${clinvar}
-		
-	</command>
-		
-	<inputs>
-		<param name="dorun" type="hidden" value="Y"/> <!-- will add tool in future to filter on annovar columns, then will call annovar.sh with dorun==N -->
-		<param name="reference" type="select" label="Reference">			        
-			<options from_data_table="annovar_loc" />				
-			<filter type="data_meta" ref="infile" key="dbkey" column="0"/>			
-		</param>
-				
-		<param name="infile" type="data" label="Select file to annotate" help="Must be either a VCF file, or a CG varfile, or a tab-separated file with a 1 line header"/>
-		<conditional name="filetype">
-			<param name="type" type="select" label="Select filetype" >
-				<option value="vcf" selected="false"> VCF4 file </option>
-				<option value="varfile" selected="false"> CG varfile </option>
-				<option value="other" selected="false"> Other </option>
-			</param>
-			<when value="other">
-				<param name="col_chr"     type="data_column"   data_ref="infile" multiple="False" label="Chromosome Column"  /> 
-				<param name="col_start"   type="data_column"   data_ref="infile" multiple="False" label="Start Column"  /> 
-				<param name="col_end"     type="data_column"   data_ref="infile" multiple="False" label="End Column"  /> 
-				<param name="col_ref"     type="data_column"   data_ref="infile" multiple="False" label="Reference Allele Column"  /> 
-				<param name="col_obs"     type="data_column"   data_ref="infile" multiple="False" label="Observed Allele Column"  /> 	
-				<conditional name="convertcoords">
-					<param name="convert" type="select" label="Is this file using Complete Genomics (0-based half-open) cooridinates?" >
-						<option value="Y"> Yes </option>
-						<option value="N" selected="True"> No </option>
-					</param>
-					<when value="Y">
-						<param name="col_vartype" type="data_column"   data_ref="infile" multiple="False" label="varType Column"  /> 
-					</when>
-				</conditional>
-			</when>
-		</conditional>
+<tool id="AnnovarShed" name="ANNOVAR" version="2016march">
+    <description> Annotate a file using ANNOVAR </description>
+
+    <requirements>
+        <requirement type="package" version="1.7">cgatools</requirement>
+    </requirements>
+
+    <command interpreter="bash">
+        annovar.sh
+        --esp "${esp}"
+        --gonl "${gonl}"
+        --exac03 "${exac03}"
+        --exac03nonpsych "${exac03nonpsych}"
+        --exac03nontcga "${exac03nontcga}"
+        --spidex "${spidex}"
+        --gerp "${gerp}"
+        --cosmic61 "${cosmic61}"
+        --cosmic63 "${cosmic63}"
+        --cosmic64 "${cosmic64}"
+        --cosmic65 "${cosmic65}"
+        --cosmic67 "${cosmic67}"
+        --cosmic68 "${cosmic68}"
+        --outall "${annotated}"
+        --outinvalid "${invalid}"
+        --dorunannovar "${dorun}"
+        --inputfile "${infile}"
+        --buildver "${reference.fields.dbkey}"
+        --humandb "${reference.fields.ANNOVAR_humandb}"
+        --scriptsdir "${reference.fields.ANNOVAR_scripts}"
+        --verdbsnp "${verdbsnp}"
+        --geneanno "${geneanno}"
+        --tfbs "${tfbs}"
+        --mce "${mce}"
+        --cytoband "${cytoband}"
+        --segdup "${segdup}"
+        --dgv "${dgv}"
+        --gwas "${gwas}"
+        --dbscsnv11 "${dbscsnv11}"
+        --kaviar_20150923 "${kaviar_20150923}"
+        --hrcr1 "${hrcr1}"
+        --mitimpact2 "${mitimpact2}"
+        --mitimpact24 "${mitimpact24}"
+        --dbnsfp30a "${dbnsfp30a}"
+        #if $filetype.type == "other"
+            --varfile N
+            --VCF N
+            --chrcol "${filetype.col_chr}"
+            --startcol "${filetype.col_start}"
+            --endcol "${filetype.col_end}"
+            --obscol "${filetype.col_obs}"
+            --refcol "${filetype.col_ref}"
+            #if $filetype.convertcoords.convert == "Y"
+                --vartypecol "${filetype.convertcoords.col_vartype}"
+                --convertcoords Y
+            #else
+                --convertcoords N
+            #end if
+        #end if
+        #if $filetype.type == "vcf"
+            --varfile N
+            --VCF Y
+            --convertcoords N
+        #end if
+        #if $filetype.type == "varfile"
+            --varfile Y
+            --VCF N
+        #end if
+        --cg46 "${cgfortysix}"
+        --cg69 "${cgsixtynine}"
+        --ver1000g "${ver1000g}"
+        --hgvs "${hgvs}"
+        --otherinfo "${otherinfo}"
+        --newimpactscores "${newimpactscores}"
+        --clinvar "${clinvar}"
+    </command>
+
+    <inputs>
+        <param name="dorun" type="hidden" value="Y"/> <!-- will add tool in future to filter on annovar columns, then will call annovar.sh with dorun==N -->
+        <param name="reference" type="select" label="Reference">
+            <options from_data_table="annovar_loc" />
+            <filter type="data_meta" ref="infile" key="dbkey" column="0"/>
+        </param>
 
-
-
-		<param name="geneanno" type="select" label="Select Gene Annotation(s)" multiple="true" optional="true" display="checkboxes">			
-			<option value="refSeq" selected="true"  > RefSeq </option>
-			<option value="knowngene"> UCSC KnownGene </option>
-			<option value="ensgene"  > Ensembl </option>			
-		</param>	
-		<param name="hgvs" type="boolean" checked="False" truevalue="-hgvs" falsevalue="N" label="Use HGVS nomenclature for RefSeq annotation" help="if checked, cDNA level annotation is compatible with HGVS"/>
-		
+        <param name="infile" type="data" label="Select file to annotate" help="Must be either a VCF file, or a CG varfile, or a tab-separated file with a 1 line header"/>
+        <conditional name="filetype">
+            <param name="type" type="select" label="Select filetype" >
+                <option value="vcf" selected="false"> VCF4 file </option>
+                <option value="varfile" selected="false"> CG varfile </option>
+                <option value="other" selected="false"> Other </option>
+            </param>
+            <when value="other">
+                <param name="col_chr"     type="data_column"   data_ref="infile" multiple="False" label="Chromosome Column"  />
+                <param name="col_start"   type="data_column"   data_ref="infile" multiple="False" label="Start Column"  />
+                <param name="col_end"     type="data_column"   data_ref="infile" multiple="False" label="End Column"  />
+                <param name="col_ref"     type="data_column"   data_ref="infile" multiple="False" label="Reference Allele Column"  /> 
+                <param name="col_obs"     type="data_column"   data_ref="infile" multiple="False" label="Observed Allele Column"  />
+                <conditional name="convertcoords">
+                    <param name="convert" type="select" label="Is this file using Complete Genomics (0-based half-open) cooridinates?" >
+                        <option value="Y"> Yes </option>
+                        <option value="N" selected="True"> No </option>
+                    </param>
+                    <when value="Y">
+                        <param name="col_vartype" type="data_column"   data_ref="infile" multiple="False" label="varType Column"  />
+                    </when>
+                </conditional>
+            </when>
+        </conditional>
 
-		<!-- region-based annotation -->
-		<param name="cytoband" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Cytogenic band Annotation?" help="This option identifies Giemsa-stained chromosomes bands, (e.g. 1q21.1-q23.3)."/>
-		<param name="tfbs" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Transcription Factor Binding Site Annotation?"/>
-		<param name="mce" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Most Conserved Elements Annotation? (hg18/hg19)" help="This option phastCons 44-way alignments to annotate variants that fall within conserved genomic regions."/>
-		<param name="segdup" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Segmental Duplication Annotation?" help="Genetic variants that are mapped to segmental duplications are most likely sequence alignment errors and should be treated with extreme caution."/>
-		<param name="dgv" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="DGV (Database of Genomic Variants) Annotation?" help="Identify previously reported structural variants in DGV (Database of Genomic Variants) "/>
-		<param name="gwas" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="GWAS studies Annotation?" help="Identify variants reported in previously published GWAS (Genome-wide association studies) "/>
+        <!-- gene-based annotation -->
+        <param name="geneanno" type="select" label="Select Gene Annotation(s)" multiple="true" optional="true" display="checkboxes">
+            <option value="refSeq" selected="true"  > RefSeq </option>
+            <option value="knowngene"> UCSC KnownGene </option>
+            <option value="ensgene"  > Ensembl </option>
+        </param>    
+        <param name="hgvs" type="boolean" checked="False" truevalue="-hgvs" falsevalue="N" label="Use HGVS nomenclature for RefSeq annotation" help="if checked, cDNA level annotation is compatible with HGVS"/>
 
-
+        <!-- region-based annotation -->
+        <param name="cytoband" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Cytogenic band Annotation?" help="This option identifies Giemsa-stained chromosomes bands, (e.g. 1q21.1-q23.3)."/>
+        <param name="tfbs" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Transcription Factor Binding Site Annotation?"/>
+        <param name="mce" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Most Conserved Elements Annotation? (hg18/hg19)" help="This option phastCons 44-way alignments to annotate variants that fall within conserved genomic regions."/>
+        <param name="segdup" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Segmental Duplication Annotation?" help="Genetic variants that are mapped to segmental duplications are most likely sequence alignment errors and should be treated with extreme caution."/>
+        <param name="dgv" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="DGV (Database of Genomic Variants) Annotation?" help="Identify previously reported structural variants in DGV (Database of Genomic Variants) "/>
+        <param name="gwas" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="GWAS studies Annotation?" help="Identify variants reported in previously published GWAS (Genome-wide association studies) "/>
 
-		<!-- filter-based annotation -->
-		<param name="verdbsnp" type="select" label="Select dbSNP version(s) to annotate with" multiple="true" display="checkboxes"  optional="true" help="avSNP are reformatted dbSNP databases with one variant per line and left-normalized indels (for a more detailed discussion read this article: http://annovar.openbioinformatics.org/en/latest/articles/dbSNP/). Flagged SNPs include SNPs less than 1% minor allele frequency (MAF) (or unknown), mapping only once to reference assembly, flagged in dbSnp as clinically associated">			
-			<option value="snp128"          > 128            (hg18/hg19) </option>
-			<option value="snp128NonFlagged"> 128 NonFlagged  </option>
-			<option value="snp129"          > 129            (hg18/hg19) </option>
-			<option value="snp129NonFlagged"> 129 NonFlagged  </option>			
-			<option value="snp130"          > 130            (hg18/hg19) </option>
-			<option value="snp130NonFlagged"> 130 NonFlagged  </option>
-			<option value="snp131"          > 131            (hg18/hg19) </option>	
-			<option value="snp131NonFlagged"> 131 NonFlagged  </option>
-			<option value="snp132"          > 132            (hg18/hg19) </option>
-			<option value="snp132NonFlagged"> 132 NonFlagged  </option>
-			<option value="snp135"          > 135            (hg19 only) </option>	
-			<option value="snp135NonFlagged"> 135 NonFlagged  </option>
-			<option value="snp137"          > 137            (hg19 only) </option>				
-			<option value="snp137NonFlagged"> 137 NonFlagged  </option>
-			<option value="snp138"          > 138            (hg19 only) </option>				
-			<option value="snp138NonFlagged"> 138 NonFlagged  </option>				
-			<option value="avsnp138"          > 138            (avSNP, hg19 only) </option>
-			<option value="avsnp142"          > 142            (avSNP, hg19/hg38 ) </option>
-		</param>	
+        <!-- filter-based annotation -->
+        <param name="verdbsnp" type="select" label="Select dbSNP version(s) to annotate with" multiple="true" display="checkboxes"  optional="true" help="avSNP are reformatted dbSNP databases with one variant per line and left-normalized indels (for a more detailed discussion read this article: http://annovar.openbioinformatics.org/en/latest/articles/dbSNP/). Flagged SNPs include SNPs less than 1% minor allele frequency (MAF) (or unknown), mapping only once to reference assembly, flagged in dbSnp as clinically associated">
+            <option value="snp128"          > 128            (hg18/hg19) </option>
+            <option value="snp128NonFlagged"> 128 NonFlagged  </option>
+            <option value="snp129"          > 129            (hg18/hg19) </option>
+            <option value="snp129NonFlagged"> 129 NonFlagged  </option>
+            <option value="snp130"          > 130            (hg18/hg19) </option>
+            <option value="snp130NonFlagged"> 130 NonFlagged  </option>
+            <option value="snp131"          > 131            (hg18/hg19) </option>
+            <option value="snp131NonFlagged"> 131 NonFlagged  </option>
+            <option value="snp132"          > 132            (hg18/hg19) </option>
+            <option value="snp132NonFlagged"> 132 NonFlagged  </option>
+            <option value="snp135"          > 135            (hg19 only) </option>
+            <option value="snp135NonFlagged"> 135 NonFlagged  </option>
+            <option value="snp137"          > 137            (hg19 only) </option>
+            <option value="snp137NonFlagged"> 137 NonFlagged  </option>
+            <option value="snp138"          > 138            (hg19 only) </option>
+            <option value="snp138NonFlagged"> 138 NonFlagged  </option>
+            <option value="avsnp138"          > 138            (avSNP, hg19 only) </option>
+            <option value="avsnp142"          > 142            (avSNP, hg19/hg38 ) </option>
+            <option value="avsnp144"          > 144            (avSNP, hg19/hg38 ) </option>
+        </param>
 
-		<param name="ver1000g" type="select" label="Select 1000Genomes Annotation(s)" multiple="true" display="checkboxes"  optional="true" help="2012april database for ALL populations was converted to hg18 using the UCSC liftover program">			
-			<option value="1000g2015aug"> 2015aug (hg19/hg38) (6 populations: AMR,AFR,EUR,EAS,SAS,ALL) </option>			
-			<option value="1000g2014oct"> 2014oct (hg18/hg19/hg38) (6 populations: AMR,AFR,EUR,EAS,SAS,ALL) </option>
-			<option value="1000g2012apr"> 2012apr (hg18/hg19) (5 populations: AMR,AFR,ASN,CEU,ALL) </option>
-			<option value="1000g2012feb"> 2012feb (hg19) (1 population: ALL) </option>
-			<option value="1000g2010nov"> 2010nov (hg19) (1 population: ALL) </option>
-			<option value="1000g2010jul"> 2010jul (hg18) (4 populations: YRI,JPT,CHB,CEU)</option>			
-		</param>	
-		<!-- 
-		<param name="g1000" type="boolean" checked="True" truevalue="Y" falsevalue="N" label="Annotate with 1000genomes project? (version 2012april)"/>
-		-->
-
+        <param name="ver1000g" type="select" label="Select 1000Genomes Annotation(s)" multiple="true" display="checkboxes"  optional="true" help="2012april database for ALL populations was converted to hg18 using the UCSC liftover program">
+            <option value="1000g2015aug"> 2015aug (hg19/hg38) (6 populations: AMR,AFR,EUR,EAS,SAS,ALL) </option>
+            <option value="1000g2014oct"> 2014oct (hg18/hg19/hg38) (6 populations: AMR,AFR,EUR,EAS,SAS,ALL) </option>
+            <option value="1000g2012apr"> 2012apr (hg18/hg19) (5 populations: AMR,AFR,ASN,CEU,ALL) </option>
+            <option value="1000g2012feb"> 2012feb (hg19) (1 population: ALL) </option>
+            <option value="1000g2010nov"> 2010nov (hg19) (1 population: ALL) </option>
+            <option value="1000g2010jul"> 2010jul (hg18) (4 populations: YRI,JPT,CHB,CEU)</option>
+        </param>
 
-	<param name="esp" type="select" label="Select Exome Variant Server  version(s) to annotate with" multiple="true" display="checkboxes"  optional="true" help="si versions of databases contain indels and chrY calls">			
-			<option value="esp6500si_all"       > ESP6500si ALL  </option>
-			<option value="esp6500si_ea"        > ESP6500si European Americans  </option>
-			<option value="esp6500si_aa"        > ESP6500si African Americans  </option>
-			<option value="esp6500_all"         > ESP6500   ALL </option>
-			<option value="esp6500_ea"          > ESP6500   European Americans  </option>
-			<option value="esp6500_aa"          > ESP6500   African Americans   </option>			
-			<option value="esp5400_all"         > ESP5400   ALL  </option>
-			<option value="esp5400_ea"          > ESP5400   European Americans  </option>
-			<option value="esp5400_aa"          > ESP5400   African Americans  </option>			
-		</param>	
+        <param name="esp" type="select" label="Select Exome Variant Server  version(s) to annotate with" multiple="true" display="checkboxes"  optional="true" help="si versions of databases contain indels and chrY calls">
+            <option value="esp6500si_all"       > ESP6500si ALL  </option>
+            <option value="esp6500si_ea"        > ESP6500si European Americans  </option>
+            <option value="esp6500si_aa"        > ESP6500si African Americans  </option>
+            <option value="esp6500_all"         > ESP6500   ALL </option>
+            <option value="esp6500_ea"          > ESP6500   European Americans  </option>
+            <option value="esp6500_aa"          > ESP6500   African Americans   </option>
+            <option value="esp5400_all"         > ESP5400   ALL  </option>
+            <option value="esp5400_ea"          > ESP5400   European Americans  </option>
+            <option value="esp5400_aa"          > ESP5400   African Americans  </option>
+        </param>
 
-        <param name="exac03" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with ExAC 03? (The Exome Aggregation Consortium) (hg18/hg19/hg38)" help=" The Exome Aggregation Consortium (ExAC) is a coalition of investigators seeking to aggregate and harmonize exome sequencing data from a wide variety of large-scale sequencing projects, and to make summary data available for the wider scientific community. The data set provided on this website spans 60,706 unrelated individuals sequenced as part of various disease-specific and population genetic studies. See http://exac.broadinstitute.org/faq for more information."/> 
+        <param name="exac03" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with ExAC 03? (The Exome Aggregation Consortium) (hg18/hg19/hg38)" help=" The Exome Aggregation Consortium (ExAC) is a coalition of investigators seeking to aggregate and harmonize exome sequencing data from a wide variety of large-scale sequencing projects, and to make summary data available for the wider scientific community. The data set provided on this website spans 60,706 unrelated individuals sequenced as part of various disease-specific and population genetic studies. See http://exac.broadinstitute.org/faq for more information."/>
+        <param name="exac03nontcga" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with ExAC 03 non-TCGA? (The Exome Aggregation Consortium) (hg18/hg19/hg38)" help="non-TGCA samples"/>
+        <param name="exac03nonpsych" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with ExAC 03 non-Psych? (The Exome Aggregation Consortium) (hg18/hg19/hg38)" help=""/>
 
         <param name="gonl" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with GoNL (Genome of the Netherlands) data? (hg19 only)" help="This is a custom made annotation file, not available from the ANNOVAR website. The database file can be obtained from http://bioinf-galaxian.erasmusmc.nl/public/Data/hg19_gonl.txt "/> 
-        <param name="spidex" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with SPIDEX database? (hg19 only)" help="This dataset provides machine-learning prediction on how genetic variants affect RNA splicing. (Xiong et al, Science 2015)"/> 
-
-                
-		<param name="gerp" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="GERP++ Annotation?" help="GERP identifies constrained elements in multiple alignments by quantifying substitution deficits (see http://mendel.stanford.edu/SidowLab/downloads/gerp/ for details) This option annotates those variants having GERP++>2 in human genome, as this threshold is typically regarded as evolutionarily conserved and potentially functional"/>
-	
-		<param name="clinvar" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="CLINVAR Annotation? (hg19 only)" help="version 2014-02-11. Annotations include Variant Clinical Significance (unknown, untested, non-pathogenic, probable-non-pathogenic, probable-pathogenic, pathogenic, drug-response, histocompatibility, other) and Variant disease name."/>
-	
-		<param name="nci60" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with NCI60? (hg18/hg19/hg38)" help="NCI-60 exome allele frequency data"/>
-	
-		<param name="cgfortysix" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Complete Genomics 46 Genomes? (hg18/hg19)" help="Diversity Panel; 46 unrelated individuals"/>
-		<param name="cgsixtynine" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Complete Genomics 69 Genomes? (hg18/hg19)" help="Diversity Panel, Pedigree, YRI trio and PUR trio"/>
-	
-		<param name="cosmic61" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with COSMIC 61? (hg19 only)"/>
-		<param name="cosmic63" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with COSMIC 63? (hg19 only)"/>
-		<param name="cosmic64" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with COSMIC 64? (hg19 only)"/>
-		<param name="cosmic65" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with COSMIC 65? (hg19 only)"/>
-		<param name="cosmic67" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with COSMIC 67? (hg19 only)"/>
-		<param name="cosmic68" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with COSMIC 68? (hg19 only)"/>
-		<param name="cosmic70" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with COSMIC 70? (hg18/hg19/hg38)"/>
-		
-       
+        <param name="spidex" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with SPIDEX database? (hg19 only)" help="This dataset provides machine-learning prediction on how genetic variants affect RNA splicing. (Xiong et al, Science 2015)"/>
+        <param name="gerp" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="GERP++ Annotation?" help="GERP identifies constrained elements in multiple alignments by quantifying substitution deficits (see http://mendel.stanford.edu/SidowLab/downloads/gerp/ for details) This option annotates those variants having GERP++>2 in human genome, as this threshold is typically regarded as evolutionarily conserved and potentially functional"/>
+        <param name="clinvar" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="CLINVAR Annotation? (hg19 only)" help="version 2014-02-11. Annotations include Variant Clinical Significance (unknown, untested, non-pathogenic, probable-non-pathogenic, probable-pathogenic, pathogenic, drug-response, histocompatibility, other) and Variant disease name."/>
+        <param name="nci60" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with NCI60? (hg18/hg19/hg38)" help="NCI-60 exome allele frequency data"/>
+        <param name="cgfortysix" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Complete Genomics 46 Genomes? (hg18/hg19)" help="Diversity Panel; 46 unrelated individuals"/>
+        <param name="cgsixtynine" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Complete Genomics 69 Genomes? (hg18/hg19)" help="Diversity Panel, Pedigree, YRI trio and PUR trio"/>
+        <param name="cosmic61" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with COSMIC 61? (hg19 only)"/>
+        <param name="cosmic63" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with COSMIC 63? (hg19 only)"/>
+        <param name="cosmic64" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with COSMIC 64? (hg19 only)"/>
+        <param name="cosmic65" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with COSMIC 65? (hg19 only)"/>
+        <param name="cosmic67" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with COSMIC 67? (hg19 only)"/>
+        <param name="cosmic68" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with COSMIC 68? (hg19 only)"/>
+        <param name="cosmic70" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with COSMIC 70? (hg18/hg19/hg38)"/>
 
-		<param name="newimpactscores" type="select" label="Select functional impact scores (LJB2)" multiple="true" display="checkboxes" optional="true" help="LJB refers to Liu, Jian, Boerwinkle paper in Human Mutation, pubmed ID 21520341. ">						
-			<option value="ljb2_sift"> SIFT score </option>
-			<option value="ljb2_pp2hdiv"> PolyPhen2 HDIV score </option>
-			<option value="ljb2_pp2hvar" > PolyPhen2 HVAR score </option>
-			<option value="ljb2_mt" > MutationTaster score </option>
-			<option value="ljb2_ma" > MutationAssessor score </option>
-			<option value="ljb2_lrt"> LRT score (Likelihood Ratio Test) </option>			
-			<option value="ljb2_phylop"> PhyloP score </option>
-			<option value="ljb2_fathmm" > FATHMM score </option>
-			<option value="ljb2_gerp"> GERP++ score </option>			
-			<option value="ljb2_siphy"> SiPhy score </option>
-		</param>	
-		<param name="otherinfo" type="boolean" checked="False" truevalue="-otherinfo" falsevalue="N" label="Also get predictions where possible?" help="e.g. annotated as -score,damaging- or -score,benign- instead of just score"/>
-		
-		<!--  OBSOLETE impact scores, uncomment for backwards compatibility, add argument impactscores to command
-<param name="impactscores" type="select" label="Select functional impact scores annotate with (OBSOLETE)" multiple="true" display="checkboxes" optional="true" help="LJB refers to Liu, Jian, Boerwinkle paper in Human Mutation, pubmed ID 21520341.">			
-			<option value="avsift"> AV SIFT </option>
-			<option value="ljbsift"> LJB SIFT (corresponds to 1-SIFT)</option>
-			<option value="pp2"> PolyPhen2 </option>
-			<option value="mutationtaster" > MutationTaster </option>
-			<option value="lrt"> LRT (Likelihood Ratio Test) </option>			
-			<option value="phylop"> PhyloP </option>
-		</param>	
-			-->
+        <param name="newimpactscores" type="select" label="Select functional impact scores (LJB2)" multiple="true" display="checkboxes" optional="true" help="LJB refers to Liu, Jian, Boerwinkle paper in Human Mutation, pubmed ID 21520341. ">
+            <option value="ljb2_sift"> SIFT score </option>
+            <option value="ljb2_pp2hdiv"> PolyPhen2 HDIV score </option>
+            <option value="ljb2_pp2hvar" > PolyPhen2 HVAR score </option>
+            <option value="ljb2_mt" > MutationTaster score </option>
+            <option value="ljb2_ma" > MutationAssessor score </option>
+            <option value="ljb2_lrt"> LRT score (Likelihood Ratio Test) </option>
+            <option value="ljb2_phylop"> PhyloP score </option>
+            <option value="ljb2_fathmm" > FATHMM score </option>
+            <option value="ljb2_gerp"> GERP++ score </option>
+            <option value="ljb2_siphy"> SiPhy score </option>
+        </param>    
+        <param name="otherinfo" type="boolean" checked="False" truevalue="-otherinfo" falsevalue="N" label="Also get predictions where possible?" help="e.g. annotated as -score,damaging- or -score,benign- instead of just score"/>
+        
+          <param name="dbscsnv11" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with scSNV 1.1 ? (hg19/hg38)" help=" provides splice site effect prediction by AdaBoost and Random Forest"/>
+        <param name="kaviar_20150923" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with Kaviar (23-09-2015)? (hg19/hg38)" help="170 million variants from 34 projects (13K genomes and 64K exomes) "/>
+        <param name="hrcr1" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with hrcr1 ? (hg19/hg38)" help="40 million variants from 32K samples"/>
+         
+        <param name="mitimpact2" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with MITimpact 2 ? (hg19)" help="an exhaustive collection of pre-computed pathogenicity predictions of human mitochondrial non-synonymous variants"/>
+        <param name="mitimpact24" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with MITimpact 2.4 ? (hg19)" help="an exhaustive collection of pre-computed pathogenicity predictions of human mitochondrial non-synonymous variants"/>
+        <param name="dbnsfp30a" type="boolean" checked="False" truevalue="Y" falsevalue="N" label="Annotate with dbNSFP 3.0a ? (hg18/hg19/hg38)" help="provides whole-genome functional prediction scores on ~20 different algorithms. Now additions to the database include DANN, PROVEAN, fitConsPlease, etc."/>
 
-		<!-- prefix for output file so you dont have to manually rename history items -->
-		<param name="fname" type="text" value="" label="Prefix for your output file" help="Optional"/>		
-				
-	</inputs>
+        <!-- prefix for output file so you dont have to manually rename history items -->
+        <param name="fname" type="text" value="" label="Prefix for your output file" help="Optional"/>
+    </inputs>
 
-	<outputs>
-		<data format="tabular" name="invalid"   label="$fname ANNOVAR Invalid input on ${on_string}"/>	
-		<data format="tabular" name="annotated" label="$fname ANNOVAR Annotated variants on ${on_string}"/>
-	</outputs>
+    <outputs>
+        <data format="tabular" name="invalid"   label="$fname ANNOVAR Invalid input on ${on_string}"/>
+        <data format="tabular" name="annotated" label="$fname ANNOVAR Annotated variants on ${on_string}"/>
+    </outputs>
 
-	<help> 
+    <help> 
 **What it does**
 
 This tool will annotate a file using ANNOVAR.
@@ -241,15 +230,15 @@
 **Input Formats**
 
 Input Formats may be one of the following:
-	
+
 VCF file
 Complete Genomics varfile
 
-Custom tab-delimited file (specify chromosome, start, end, reference allele, observed allele columns)	
-	
+Custom tab-delimited file (specify chromosome, start, end, reference allele, observed allele columns)    
+
 Custom tab-delimited CG-derived file (specify chromosome, start, end, reference allele, observed allele, varType columns)
-		
-		
+
+
 **Database Notes**
 
 see ANNOVAR website for extensive documentation, a few notes on some of the databases:
@@ -258,10 +247,7 @@
 
 PolyPhen2 HVAR should be used for diagnostics of Mendelian diseases, which requires distinguishing mutations with drastic effects from all the remaining human variation, including abundant mildly deleterious alleles.The authors recommend calling probably damaging if the score is between 0.909 and 1, and possibly damaging if the score is between 0.447 and 0.908, and benign if the score is between 0 and 0.446.
 
-PolyPhen HDIV should be used when evaluating rare alleles at loci potentially involved in complex phenotypes, dense mapping of regions identified by genome-wide association studies, and analysis of natural selection from sequence data. The authors recommend calling probably damaging if the score is between 0.957 and 1, and possibly damaging if the score is between 0.453 and 0.956, and benign is the score is between 0 and 0.452. 		
-		
-	</help>
+PolyPhen HDIV should be used when evaluating rare alleles at loci potentially involved in complex phenotypes, dense mapping of regions identified by genome-wide association studies, and analysis of natural selection from sequence data. The authors recommend calling probably damaging if the score is between 0.957 and 1, and possibly damaging if the score is between 0.453 and 0.956, and benign is the score is between 0 and 0.452.
+    </help>
 
 </tool>
-
-