# HG changeset patch
# User waqas
# Date 1536756303 14400
# Node ID c9636a82704909f843c4beab1a72d4a62c400b2a
Uploaded
diff -r 000000000000 -r c9636a827049 MACARON-GenMed-LabEx/LICENSE.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/MACARON-GenMed-LabEx/LICENSE.txt Wed Sep 12 08:45:03 2018 -0400
@@ -0,0 +1,64 @@
+GNU LESSER GENERAL PUBLIC LICENSE
+Version 3, 29 June 2007
+
+Copyright (C) 2007 Free Software Foundation, Inc.
+
+Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below.
+0. Additional Definitions.
+
+As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License.
+
+"The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below.
+
+An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library.
+
+A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”.
+
+The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version.
+
+The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work.
+1. Exception to Section 3 of the GNU GPL.
+
+You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL.
+2. Conveying Modified Versions.
+
+If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version:
+
+ a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or
+ b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy.
+
+3. Object Code Incorporating Material from Library Header Files.
+
+The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License.
+ b) Accompany the object code with a copy of the GNU GPL and this license document.
+
+4. Combined Works.
+
+You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following:
+
+ a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License.
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license document.
+ c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document.
+ d) Do one of the following:
+ 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.
+ 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version.
+ e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.)
+
+5. Combined Libraries.
+
+You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License.
+ b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
+
+6. Revised Versions of the GNU Lesser General Public License.
+
+The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation.
+
+If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.
diff -r 000000000000 -r c9636a827049 MACARON-GenMed-LabEx/MACARON
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/MACARON-GenMed-LabEx/MACARON Wed Sep 12 08:45:03 2018 -0400
@@ -0,0 +1,560 @@
+#!/usr/bin/python
+
+#alpha version 0.7 (05/09/18)
+
+"""
+#Script to identify SNPs located within a genetic codon:
+
+Annotation of SNPs (including synonymous and non-synonymous variants) located within the same genetic codon requires attention. This idea conflicts with the annotations observed by traditional annotation software widely used now a days. While looking at the combined effect within the framework of genetic codon, we have new / altered codons that code for new amino acid that can be predicted by using this MACARON python script.
+
+#####------How to run quickly run MACARON-------
+
+# python MACARON -i yourinputfile.vcf
+
+# python MACARON -i /path/to/yourinputfile.vcf -o /path/to/MACARON_output.txt -f (INFO)_FIELD_HEADER --GATK /path/to/GenomeAnalysisTK.jar --HG_REF /path/to/hg.fasta --SNPEFF /path/to/snpeff.jar --SNPEFF_HG hg19
+
+# python MACARON -i yourinputfile.vcf -o MACARON_output.txt --gatk4 (when using gatk versions >= 4.0)
+
+"""
+
+import sys, os, time
+import itertools
+import multiprocessing
+import re
+import subprocess
+from argparse import ArgumentParser
+
+## GLOBAL VARIABLES (IMPORTANT: You can set the default values here)
+GATK="/home/wuk/software/GenomeAnalysisTK.jar"
+#GATK="/home/wuk/software/gatk-4.0.1.2/gatk-package-4.0.1.2-local.jar"
+HG_REF="/home/wuk/Working/gnme_refrnces/Homo_sapiens_assembly19.fasta"
+SNPEFF="/home/wuk/software/snpEff/snpEff.jar"
+SNPEFF_HG="GRCh37.75" ## SnpEff human genome annotation database version
+
+## PRINTINGS, AESTHETICS
+str_progress_list = ["\tIndexing VCF file",
+ "\tIdentifying SnpClusters",
+ "\tExtracting SnpClusters",
+ "\tAnnotating SnpClusters",
+ "\tExcluding InDels",
+ "\tGenerating a SnpCluster Table",
+ "\tRe-annotating Codons",
+ "\tRemoving SnpCluster if AA_Change_pcSNV == (AA1 or AA2)",
+ "\tExtracting established SnpClusters - for which two (or three) SNPs are reference heterozygous (or non-reference homozygous)"]
+header = ("\n" +
+ "(###############)\n" +
+ "@@@@ MACARON @@@@\n" +
+ "(###############)\n\n" +
+ "Starting....\n")
+footer = "\nMACARON Run Completed. Bon Courage with Analysis ...,,,!!!!\n"
+
+def animate(keep_anim, idx):
+ c = "|/-\\"
+ i=0
+ while keep_anim.is_set():
+ i += 1
+ sys.stdout.write("\r>" + str_progress_list[idx] + ": " + c[i % len(c)] +"\r")
+ sys.stdout.flush()
+ time.sleep(0.1)
+ sys.stdout.write("\r " + str_progress_list[idx] + ": Done!\n")
+def print_step(keep_anim, idx):
+ if not(ECO):
+ keep_anim.set()
+ anim_thread = multiprocessing.Process(target=animate, args=(keep_anim, idx))
+ anim_thread.start()
+ return anim_thread
+ else:
+ sys.stdout.write(">" + str_progress_list[idx] + ": in progress...\r" )
+ sys.stdout.flush()
+ return None
+def end_print_step(keep_anim, anim_thread, idx):
+ if not(ECO):
+ keep_anim.clear(); anim_thread.join()
+ else:
+ sys.stdout.write(" " + str_progress_list[idx] + ": Done! \n")
+ sys.stdout.flush()
+
+
+## CLASS DEFINITIONS
+
+class fileHandler:
+ def __init__(self):
+ self.data = [];
+ def open_file(self, readfl):
+ self.rfile = open(readfl, 'r').readlines()
+ return self.rfile
+ def write_file(self, writefl):
+ self.wfile = open(writefl, 'w')
+ return self.wfile
+
+class SearchDB(fileHandler):
+ def __init__(self):
+ self.data = []
+ from collections import defaultdict
+ self.ident_ranges_HMBM = defaultdict(list)
+ def Search_CODON(self, vcf_input, workdir, FIELDS):
+ """
+ Calling SNPClusters
+
+ USAGE INSTRUCTIONS: Full path to the software directories should be set before compiling.
+ """
+
+ #######################
+ Fld_Len = int(len(FIELDS.split(",")))
+ FldwithF = " ".join(["-F " + str(x) for x in FIELDS.split(",")])
+
+ ## Options compatible with GATK versions >= 4.0: add option --gatk4 when calling MACARON
+ if GATK4:
+ GATK_v, SNPeff_v = (" ", " -v ") if VERBOSE else (" --QUIET true --verbosity ERROR ", " ")
+ cmd0 = "java -Xmx12g -jar " + GATK + " IndexFeatureFile -F " + vcf_input + GATK_v
+ cmd1 = "java -Xmx12g -jar " + GATK + " VariantFiltration -R " + HG_REF + " -V "+ vcf_input +" -O " + workdir + "snp_clsters2_ws3.vcf --cluster-size 2 --cluster-window-size 3" + GATK_v
+ cmd2 = "java -Xmx12g -jar " + GATK + " SelectVariants -R " + HG_REF + " -V " + workdir + "snp_clsters2_ws3.vcf -O " + workdir + "snp_clsters2_ws3_clstronly.vcf -select 'FILTER == SnpCluster'" + GATK_v
+ cmd3 = "java -Xmx12g -jar " + SNPEFF + SNPeff_v + SNPEFF_HG + " -formatEff -lof -classic " + workdir + "snp_clsters2_ws3_clstronly.vcf > " + workdir + "snp_clsters2_ws3_clstronly_annt.vcf"
+ cmd4 = "java -Xmx12g -jar " + GATK + " SelectVariants -R " + HG_REF + " -V " + workdir + "snp_clsters2_ws3_clstronly_annt.vcf -O " + workdir + "snp_clsters2_ws3_clstronly_annt_snv.vcf --select-type-to-include SNP" + GATK_v
+ cmd5 = "java -Xmx12g -jar " + GATK + " VariantsToTable -R " + HG_REF + " -V " + workdir + "snp_clsters2_ws3_clstronly_annt_snv.vcf -F CHROM -F POS -F ID -F REF -F ALT -F EFF " + FldwithF + " -GF GT --error-if-missing-data --show-filtered -O " + workdir + "snp_clsters2_ws3_clstronly_annt_snv_clstronly.table" + GATK_v
+ ## GATK4 needs to index the VCF upfront
+ thread = print_step(keep_anim, 0)
+ subprocess.check_output(cmd0, shell=True)
+ end_print_step(keep_anim, thread, 0)
+
+ else: ## Options comptatible with GATK versions < 4
+ GATK_v, SNPeff_v = (" ", " -v ") if VERBOSE else (" --logging_level ERROR ", " ")
+ cmd1 = "java -Xmx4g -jar " + GATK + " -T VariantFiltration -R " + HG_REF + " -V " + vcf_input + " -o " + workdir + "snp_clsters2_ws3.vcf --clusterSize 2 --clusterWindowSize 3" + GATK_v
+ cmd2 = "java -Xmx4g -jar " + GATK + " -T SelectVariants -R " + HG_REF + " -V " + workdir + "snp_clsters2_ws3.vcf -o " + workdir + "snp_clsters2_ws3_clstronly.vcf -select 'FILTER == SnpCluster'" + GATK_v
+ cmd3 = "java -Xmx4g -jar " + SNPEFF + SNPeff_v + SNPEFF_HG + " -formatEff -lof -classic " + workdir + "snp_clsters2_ws3_clstronly.vcf > " + workdir + "snp_clsters2_ws3_clstronly_annt.vcf"
+ cmd4 = "java -Xmx4g -jar " + GATK + " -T SelectVariants -R " + HG_REF + " -V " + workdir + "snp_clsters2_ws3_clstronly_annt.vcf -o " + workdir + "snp_clsters2_ws3_clstronly_annt_snv.vcf --selectTypeToInclude SNP" + GATK_v
+ cmd5 = "java -Xmx4g -jar " + GATK + " -T VariantsToTable -R " + HG_REF + " -V " + workdir + "snp_clsters2_ws3_clstronly_annt_snv.vcf -F CHROM -F POS -F ID -F REF -F ALT -F EFF " + FldwithF + " -GF GT --showFiltered -o " + workdir + "snp_clsters2_ws3_clstronly_annt_snv_clstronly.table" + GATK_v
+
+ thread = print_step(keep_anim, 1)
+ subprocess.check_output(cmd1, shell=True)
+ end_print_step(keep_anim, thread, 1)
+ thread = print_step(keep_anim, 2)
+ subprocess.check_output(cmd2, shell=True)
+ end_print_step(keep_anim, thread, 2)
+ thread = print_step(keep_anim, 3)
+ subprocess.check_output(cmd3, shell=True)
+ end_print_step(keep_anim, thread, 3)
+ thread = print_step(keep_anim, 4)
+ subprocess.check_output(cmd4, shell=True)
+ end_print_step(keep_anim, thread, 4)
+ thread = print_step(keep_anim, 5)
+ subprocess.check_output(cmd5, shell=True)
+ end_print_step(keep_anim, thread, 5)
+
+ subprocess.check_output("rm snpEff_genes.txt", shell=True)
+ subprocess.check_output("rm snpEff_summary.html", shell=True)
+
+ ####--------------------------------------
+
+ def Change_zygo(ref, alt, zyg):
+ """
+ program to convert zygosity code ref/alt to 0/1.
+ Input Variables:
+
+ ref = "A";alt = "G"
+ zyg = ['A/G', 'G/A', 'G/G', 'A/A', './.', 'G/.', './G', './A', 'A/.']
+ chzyg = ['0/1', '1/0', '1/1', '0/0', './.', '1/.', './1', './0', '0/.']
+ InputUsage Variables:
+ chgz = Change_zygo(ref, alt, zyg)
+
+ """
+ import re
+ chg_zyg = {}; i = 1
+ for cs in zyg:
+ csp = re.split('[|/]', cs)
+ if ((ref == csp[0]) and (ref == csp[1]) and ((csp[0] != ".") and (csp[1] != "."))):
+ chg_zyg[i] = "0/0"
+ elif ((ref != csp[0]) and (ref == csp[1]) and ((csp[0] != ".") and (csp[1] != "."))):
+ chg_zyg[i] = "1/0"
+ elif ((ref == csp[0]) and (ref != csp[1]) and ((csp[0] != ".") and (csp[1] != "."))):
+ chg_zyg[i] = "0/1"
+ elif ((ref != csp[0]) and (ref != csp[1]) and ((csp[0] != ".") and (csp[1] != "."))):
+ chg_zyg[i] = "1/1"
+ elif ((csp[0] == ".") and (csp[1] == ".")):
+ chg_zyg[i] = cs
+ elif ((csp[1] == ".")):
+ if (ref == csp[0]):
+ chg_zyg[i] = "0/."
+ elif (ref != csp[0]):
+ chg_zyg[i] = "1/."
+ elif ((csp[0] == ".")):
+ if (ref == csp[1]):
+ chg_zyg[i] = "./0"
+ elif (ref != csp[1]):
+ chg_zyg[i] = "./1"
+ i += 1
+ return list(chg_zyg.values())
+ ####--------------------------------------
+
+ with open(workdir + "snp_clsters2_ws3_clstronly_annt_snv_clstronly.table", 'r') as f1, open(workdir + "temp_file1", 'w') as output:
+ first_line = f1.readline().strip()
+ zyg_head = '\t'.join(first_line.split()[6+Fld_Len:])
+ output.write(first_line + "\t" + zyg_head + "\t" + str("Protein_coding_EFF AA-Change REF-codon ALT-codon") + "\n")
+ for line in f1:
+ line1 = line.strip()
+ line_TAB = line1.split("\t")
+ line_EFF = line_TAB[5].split("|")
+ if (len(line_EFF) > 1):
+ if ((line_EFF[1] == "SILENT") or (line_EFF[1] == "MISSENSE") or (line_EFF[1] == "NONSENSE")):
+ True
+ linesp = line_EFF[2].split("/")
+ ref = line_TAB[3]
+ alt = line_TAB[4]
+ zyg = line_TAB[6+Fld_Len:]
+ chgz = Change_zygo(ref, alt, zyg)
+ chgz_out = '\t'.join(chgz)
+ wrt = str(line_EFF[1] + "\t" + line_EFF[3] + "\t" + linesp[0] + "\t" + linesp[1])
+ output.write(line1 + "\t" + chgz_out + "\t" + wrt + "\n")
+ return None
+
+ ##-------------------------------
+ import string
+ gencode = {'ATA':'I', 'ATC':'I', 'ATT':'I', 'ATG':'M', 'ACA':'T', 'ACC':'T', 'ACG':'T', 'ACT':'T','AAC':'N', 'AAT':'N', 'AAA':'K', 'AAG':'K', 'AGC':'S', 'AGT':'S', 'AGA':'R', 'AGG':'R','CTA':'L', 'CTC':'L', 'CTG':'L', 'CTT':'L', 'CCA':'P', 'CCC':'P', 'CCG':'P', 'CCT':'P','CAC':'H', 'CAT':'H', 'CAA':'Q', 'CAG':'Q', 'CGA':'R', 'CGC':'R', 'CGG':'R', 'CGT':'R','GTA':'V', 'GTC':'V', 'GTG':'V', 'GTT':'V', 'GCA':'A', 'GCC':'A', 'GCG':'A', 'GCT':'A','GAC':'D', 'GAT':'D', 'GAA':'E', 'GAG':'E', 'GGA':'G', 'GGC':'G', 'GGG':'G', 'GGT':'G','TCA':'S', 'TCC':'S', 'TCG':'S', 'TCT':'S', 'TTC':'F', 'TTT':'F', 'TTA':'L', 'TTG':'L','TAC':'Y', 'TAT':'Y', 'TAA':'_', 'TAG':'_', 'TGC':'C', 'TGT':'C', 'TGA':'_', 'TGG':'W'}
+
+ # a function to translate a single codon
+ def translate_codon(self, codon):
+ return self.gencode.get(codon.upper(), '#')
+ # a function to split a sequence into codons
+ def split_into_codons(self, dna, frame):
+ codons = []
+ for i in range(frame-1, len(dna)-2, 3):
+ codon = dna[i:i+3]
+ codons.append(codon)
+ return codons
+ # a function to translate a dna sequence in a single frame
+ def translate_dna_single(self, dna, frame=1):
+ codons = self.split_into_codons(dna, frame)
+ amino_acids = ''
+ for codon in codons:
+ amino_acids = amino_acids + self.translate_codon(codon)
+ return amino_acids
+
+ def TWO_VAR(self, workdir):
+ """
+ ###---Two variants (2VAR) codon changes---
+ ##----------------------------------
+ """
+ lines = open(workdir + "temp_file1", "r").read().splitlines()
+ writ2 = self.write_file(workdir + "temp_file2")
+ #---
+ midline_head = lines[0].strip().split("\t")
+ try:
+ midline_headcrp = '\t'.join([w.replace(midline_head[5], 'Gene_Name') for w in midline_head])
+ except ValueError:
+ pass
+ writ2.write(str(midline_headcrp + "\t" + "ALT-codon_merge-2VAR" + "\t" + "AA-Change-2VAR") + "\n")
+ #---
+
+ i=0; TRcode =""; protcode = ""; midline_crpit = ""
+ for i in range(len(lines)):
+ #---
+ midline_crp = lines[i].strip().split("\t")
+ try:
+ if len(midline_crp[5].split("|")) != 1:
+ GeneName = midline_crp[5].split("|")[5]
+ midline_crpit = '\t'.join([w.replace(midline_crp[5], GeneName) for w in midline_crp])
+ except ValueError:
+ pass
+ #---
+ try:
+ beforeline = lines[i-1].strip()
+ line0 = beforeline.split("\t")[-3]
+ beforeline1 = re.findall("\d+", line0)
+
+ midline = lines[i].strip()
+ line1 = midline.split("\t")[-3]
+ midline1 = re.findall("\d+", line1)
+
+ nextline = lines[i+1].strip()
+ line2 = nextline.split("\t")[-3]
+ nextline1 = re.findall("\d+", line2)
+ #----Condition to replace empty list ([] to ['000']) produced from the header column "AA-Change".
+ if (line0 == "AA-Change"):
+ beforeline1.append('000')
+ elif (line1 == "AA-Change"):
+ midline1.append('000')
+ elif (line2 == "AA-Change"):
+ nextline1.append('000')
+ #----
+ REFbf=[]; line22=""
+ if ((beforeline1[0] == midline1[0]) or (midline1[0] == nextline1[0])):
+ spREFbf=[]; lscod1=[]; lscod2=[]
+ REF= lines[i].strip().split("\t")[-2]
+ if (midline1[0] == beforeline1[0]):
+ REFbf = lines[i-1].strip().split("\t")[-2]
+
+ line11 = lines[i].strip().split("\t")[-1]
+ if (midline1[0] == nextline1[0]):
+ line22 = lines[i+1].strip().split("\t")[-1]
+ if REFbf != []:
+ for cod in REFbf:
+ spREFbf.append(cod)
+ for cod in line11:
+ lscod1.append(cod)
+ for cod in line22:
+ lscod2.append(cod)
+
+ if (((lscod1[0].islower()==True and lscod2[0].islower()==True) or (lscod1[1].islower()==True and lscod2[1].islower()==True) or (lscod1[2].islower()==True and lscod2[2].islower()==True)) and ((lscod1[0] == lscod2[0]) or (lscod1[1] == lscod2[1]) or (lscod1[2] == lscod2[2]))):
+ threeltr_code = []
+ if ((lscod1[0].isupper()==True and lscod2[0].islower()==True) or (lscod1[0] == lscod2[0])):
+ threeltr_code.append(lscod1[0])
+ elif((lscod1[0].islower()==True and lscod2[0].isupper()==True) or (lscod1[0] == lscod2[0])):
+ threeltr_code.append(lscod2[0])
+
+ if((lscod1[1].isupper()==True and lscod2[1].islower()==True) or (lscod1[1] == lscod2[1])):
+ threeltr_code.append(lscod1[1])
+ elif((lscod1[1].islower()==True and lscod2[1].isupper()==True) or (lscod1[1] == lscod2[1])):
+ threeltr_code.append(lscod2[1])
+
+ if((lscod1[2].isupper()==True and lscod2[2].islower()==True) or (lscod1[2] == lscod2[2])):
+ threeltr_code.append(lscod1[2])
+ elif((lscod1[2].islower()==True and lscod2[2].isupper()==True) or (lscod1[2] == lscod2[2])):
+ threeltr_code.append(lscod2[2])
+ #-----------------------
+ if(len(threeltr_code)==3):
+ TRcode = ''.join(threeltr_code)
+ else:
+ TRcode = 'Multiallelic-t1'
+ #-----------------------
+ else:
+ TRcode = '...'
+
+ if(TRcode != line22):
+ protcode = self.translate_dna_single(TRcode)
+ else:
+ TRcode = "."
+
+ if (REF == REFbf):
+ protcode = "#####";TRcode = "Multiallelic-t2"
+ writ2.write(str(midline_crpit + "\t" + TRcode + "\t" + protcode) + "\n")
+
+ except IndexError:
+ if not midline_crpit.split("\t")[0] == "CHROM":
+ writ2.write(str(midline_crpit + "\t" + "." + "\t" + protcode) + "\n")
+ pass
+ return None
+
+ def THREE_VAR(self, workdir):
+ """
+ ###---Three variants (3VAR) codon changes---
+ ##----------------------------------
+ """
+ lines = open(workdir + "temp_file2", "r").read().splitlines()
+ writ3 = self.write_file(workdir + "temp_file3")
+ #---
+ midline_head =lines[0].strip()
+ writ3.write(str(midline_head + "\t" + "ALT-codon_merge-3VAR" + "\t" + "AA-Change-3VAR") + "\n")
+ #---
+ i = 0; TRcode = ""; protcode = ""
+ for i in range(len(lines)):
+ try:
+ #---
+ midline_crp = lines[i].strip()
+ #---
+ beforeline = lines[i-1].strip()
+ line0 = beforeline.split("\t")[-5]
+ beforeline1 = re.findall("\d+", line0)
+ midline = lines[i].strip()
+ line1 = midline.split("\t")[-5]
+ midline1 = re.findall("\d+", line1)
+ nextline = lines[i+1].strip()
+ line2 = nextline.split("\t")[-5]
+ nextline1 = re.findall("\d+", line2)
+
+ line11=[]; line22=[]; writelst= []
+ if ((beforeline1[0] == midline1[0]) or (midline1[0] == nextline1[0])):
+ lscod1=[]; lscod2=[]
+ line11 = lines[i].strip().split("\t")[-2]
+ if (midline1[0] == nextline1[0]):
+ line22 = lines[i+1].strip().split("\t")[-2]
+ for cod in line11:
+ lscod1.append(cod)
+ for cod in line22:
+ lscod2.append(cod)
+ #-----------------------
+ if(len(lscod1) == 3 and len(lscod2) == 3):
+ threeltr_code = [];
+
+ if ((lscod1[0].isupper()==True) and (lscod2[0].islower()==True) or
+ (lscod1[0].isupper()==True and lscod2[0].isupper()==True)):
+ threeltr_code.append(lscod1[0])
+ elif ((lscod1[0].islower()==True) and (lscod2[0].isupper()==True)):
+ threeltr_code.append(lscod2[0])
+
+ if ((lscod1[1].isupper()==True) and (lscod2[1].islower()==True) or
+ (lscod1[1].isupper()==True and lscod2[1].isupper()==True)):
+ threeltr_code.append(lscod1[1])
+ elif ((lscod1[1].islower()==True) and (lscod2[1].isupper()==True)):
+ threeltr_code.append(lscod2[1])
+
+ if ((lscod1[2].isupper()==True) and (lscod2[2].islower()==True) or
+ (lscod1[2].isupper()==True and lscod2[2].isupper()==True)):
+ threeltr_code.append(lscod1[2])
+ elif ((lscod1[2].islower()==True) and (lscod2[2].isupper()==True)):
+ threeltr_code.append(lscod2[2])
+ #-----------------------
+ if(len(threeltr_code) == 3):
+ TRcode = ''.join(threeltr_code)
+ else:
+ TRcode = 'Multiallelic-t1'
+ #-----------------------
+ else:
+ TRcode = '.'
+
+ if(TRcode != line22):
+ protcode = self.translate_dna_single(TRcode)
+ if len(protcode) == 0:
+ protcode = "."; TRcode = "."
+ else:
+ TRcode = "."
+
+ if protcode == "" or TRcode == "":
+ protcode = "."; TRcode = "."
+ #-----------------------
+ writ3.write(str(midline_crp + "\t" + TRcode + "\t" + protcode) + "\n")
+
+ ##----------------------
+ except IndexError:
+ if not midline_crp.split("\t")[0] == "CHROM":
+ if len(protcode) ==0:
+ protcode = "."; TRcode = "."
+ writ3.write(str(midline_crp + "\t" + TRcode + "\t" + protcode) + "\n")
+ else:
+ protcode = "."; TRcode = "."
+ writ3.write(str(midline_crp + "\t" + TRcode + "\t" + protcode) + "\n")
+ pass
+ return None
+
+ def PARS_OUT_VAR(self, workdir):
+ """
+ ###---Pars variants (2VAR _ 3VAR) based on change of protein codons ---
+ ##----------------------------------
+ """
+ #This first records the ones that do match and saves the value in column 3 (less the final matching amino acid residue).
+ subprocess.check_output("awk 'index($(NF-6), $(NF-2)) {print}' " + workdir + "temp_file3 | awk '{print $(NF-6)}' | sed s'/.$//' > " + workdir + "matches.list", shell=True)
+
+ #This then searches for the ones that do not match, and then also eliminates any value recorded in matches.list
+ subprocess.check_output("awk '!index($(NF-6), $(NF-2)) { print }' " + workdir + "temp_file3 | grep -w -v -f " + workdir + "matches.list | awk -F'\t' '{ print }' > " + workdir + "temp_file4", shell=True)
+
+ return None
+
+ def ZYGO_PAIR(self, macaron_output, workdir, FIELDS):
+ """
+ ###---Pair of zygosity check: remove pair of codons for which one SNP is reference homozygous ---
+ ##----------------------------------
+ """
+
+ Fld_Len = int(len(FIELDS.split(",")))
+ lines = open(workdir + "temp_file4", "r").read().splitlines()
+ writ4 = self.write_file(macaron_output)
+ #---
+ midline_head = lines[0].strip()
+ writ4.write(str(midline_head) + "\n")
+ #---
+ nextline_pos_lst = []
+
+ for i in range(len(lines)):
+ #---
+ midline_crp = lines[i].strip()
+ #---
+ beforeline = lines[i-1].strip()
+ beforeline_pos = re.findall("\d+", beforeline.split("\t")[-7])
+ midline = lines[i].strip()
+ midline_pos = re.findall("\d+", midline.split("\t")[-7])
+ try:
+ nextline = lines[i+1].strip()
+ nextline_pos =re.findall("\d+", nextline.split("\t")[-7])
+ ##-------
+ if (midline_pos[0] == nextline_pos[0]):
+ Start_lns = int(6) + Fld_Len
+ End_lns = int(8)
+ Start_zyg_lns = int(len(midline.split("\t")) - int(Start_lns))
+ midline_zyg = midline.split("\t")[-int(Start_zyg_lns):-int(End_lns)]
+ nextline_zyg = nextline.split("\t")[-int(Start_zyg_lns):-int(End_lns)]
+ checkList = list(['0/1:1/0', '1/0:0/1', '1/0:1/0', '0/1:0/1', '1/0:1/1', '1/1:1/0', '0/1:1/1', '1/1:0/1', '1/1:1/1'])
+ Mergetwozyg = ','.join([str(a) + ":" + b for a,b in zip(midline_zyg, nextline_zyg)])
+ Mergetwozygsp = Mergetwozyg.split(",")
+ if set(Mergetwozygsp).intersection(checkList) != set([]):
+ if ((midline_pos[0] == nextline_pos[0]) and (midline_pos[0] == beforeline_pos[0])):
+ writ4.write(str(nextline)+"\n")
+ else:
+ writ4.write(str(midline+"\n"+nextline)+"\n")
+ ##-------
+ except IndexError:
+ #Condition to remove the duplicated line at the end and prints only paired lines.
+ nextline_pos_lst.append(nextline_pos[0])
+ result = dict((i, nextline_pos_lst.count(i)) for i in nextline_pos_lst)
+ if len(result) == 1:
+ writ4.write(str(nextline) + "\n")
+
+ return None
+ ###------
+
+
+## MACARON MAIN
+if __name__ == "__main__":
+ ## Parsing arguments
+ parser = ArgumentParser(description="-Script to identify SnpClusters (SNPs within the same genetic codon)")
+ parser.add_argument("-i", "--infile", dest="INPUTFile",default=False, required=True, help="Full path of the input VCF file.")
+ parser.add_argument("-o", "--outfile", dest="OUTPUTFile",default="./MACARON_output.txt", required=False, help="Path of the output txt file (Default Output file: MACARON_output.txt)")
+ parser.add_argument("-f", "--fields", dest="Fields", default="QUAL", required=False, help=" Single field name or comma-seperated ',' multiple field names can be given. Field name should be given according to the (INFO) field header of the input vcf file. Example: -f Func.refGene,ExonicFunc.refGene,Gene.refGene,1000g2015aug_all,ExAC_ALL,ExAC_EAS,clinvar_20161128,gnomAD_exome_ALL,gnomAD_genome_ALL,EFF,CSQ")
+ parser.add_argument("--GATK", dest="GATK_path", default=GATK, required=False, help="Indicate the full path to GATK jar file")
+ parser.add_argument("--HG_REF", dest="HG_REF_path", default=HG_REF, required=False, help="Indicate the full path to the reference genome fasta file")
+ parser.add_argument("--SNPEFF", dest="SNPEFF_path", default=SNPEFF, required=False, help="Indicate the full path to SnpEff jar file")
+ parser.add_argument("--SNPEFF_HG", dest="SNPEFF_HG_version", default=SNPEFF_HG, required=False, help="Indicate SnpEff human genome annotation database version")
+ parser.add_argument("--gatk4", dest="GATK4", default=False, required=False, action='store_true', help="Add this option when using GATK versions >= 4.0")
+ parser.add_argument("-v", "--verbosity", dest="Verbosity", default=False, required=False, action='store_true', help="Use to print verbosity (Mostly GATK/SNPEFF output)")
+ parser.add_argument("-c", "--eco_friendly", dest="ECO", default=False, required=False, action='store_true', help="Save a thread, but you won't be able to stare at the fabulous animation while waiting ...")
+
+ ## Assign arguments to global variables
+ args = parser.parse_args()
+ FIELDS = args.Fields
+ GATK4 = args.GATK4
+ VERBOSE = args.Verbosity
+ GATK = args.GATK_path
+ HG_REF = args.HG_REF_path
+ SNPEFF = args.SNPEFF_path
+ SNPEFF_HG = args.SNPEFF_HG_version
+ ECO = args.ECO
+
+ ## Inputs / Outputs path & names
+ INF = args.INPUTFile
+ OUTF = args.OUTPUTFile
+ TMPDIR = os.path.dirname(os.path.abspath(OUTF)) + "/macaron_tmp/"
+ subprocess.check_output("mkdir -p " + TMPDIR, shell=True)
+
+ ########################
+ ## MAIN PROCESS ##
+ ########################
+ print(header)
+
+ ## Check if global variables point to existing files:
+ INF_check = os.path.exists(INF)
+ GATK_check = os.path.exists(GATK)
+ HG_REF_check = os.path.exists(HG_REF)
+ SNPEFF_check = os.path.exists(SNPEFF)
+ SNPEFF_HG_non_empty = (SNPEFF_HG != "")
+ if not(INF_check and GATK_check and HG_REF_check and SNPEFF_check and SNPEFF_HG_non_empty):
+ print(">ERROR : One or several global variable: \n VCF={} > {}\n GATK={} > {}\n HG_REF={} > {}\n SNPEFF={} > {}\n SNPEFF_HG={} > {}\n>Please correct and try again!".format(INF, INF_check, GATK, GATK_check, HG_REF, HG_REF_check, SNPEFF, SNPEFF_check, SNPEFF_HG, SNPEFF_HG_non_empty))
+ sys.exit(1)
+ else: ## If everything checks out, start MACARON
+ ## Animation event initialization
+ keep_anim = multiprocessing.Event()
+
+ ## 1)VARIANTS FILTERING, ANNOTATION (GATK,SNPEff)
+ clF1 = SearchDB().Search_CODON(INF, TMPDIR, FIELDS)
+ ## 2)SEARCH MULTI-SNPS CODONS
+ thread = print_step(keep_anim, 6)
+ clF2 = SearchDB().TWO_VAR(TMPDIR)
+ clF3 = SearchDB().THREE_VAR(TMPDIR)
+ end_print_step(keep_anim, thread, 6)
+ ## 3)CHECK IF SNPCLUSTERS IMPACT CODON
+ thread = print_step(keep_anim, 7)
+ clF4 = SearchDB().PARS_OUT_VAR(TMPDIR)
+ end_print_step(keep_anim, thread, 7)
+ ## 4) EXTRACT SNPCLUSTERS (Keeping SnpCluster if >=1 sample is Ref-Heterozygous or nonRef-Homozygous)
+ thread = print_step(keep_anim, 8)
+ clF5 = SearchDB().ZYGO_PAIR(OUTF, TMPDIR, FIELDS)
+ end_print_step(keep_anim, thread, 8)
+ print(footer)
+ subprocess.check_output("rm -r " + TMPDIR, shell=True)
diff -r 000000000000 -r c9636a827049 MACARON-GenMed-LabEx/MACARON_validate.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/MACARON-GenMed-LabEx/MACARON_validate.sh Wed Sep 12 08:45:03 2018 -0400
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+#sub1.chr22_21349676-21349677.sample02.bam
+
+bam=$1;
+name=$(echo $bam | cut -d'.' -f1)
+region=$(echo $bam | cut -d'.' -f2)
+sample=$(echo $bam | cut -d'.' -f3)
+
+chr=$(echo $region | cut -d'_' -f1)
+pos=$(echo $region | cut -d'_' -f2)
+
+beg=$(echo $pos | cut -d'-' -f1)
+end=$(echo $pos | cut -d'-' -f2)
+
+#beg=$(($beg+50))
+#end=$((end-50))
+
+#echo "name $name"
+#echo "region $region"
+#echo "sample $sample"
+
+echo "$name $chr:$beg-$end $sample"
+echo "$name $chr:$beg-$end $sample" >> MACARON_validate.txt
+
+samtools view $bam | awk -v start=$beg -v stop=$end '
+{
+ pos=$4;
+ if(pos < start){
+ cstart=1+start-pos;
+ cstop=1+stop-pos;
+ print cstart"."cstop"."$10;
+ }
+}' > tmp
+
+while read line;
+do
+ cb=$(echo $line | cut -d'.' -f1);
+ ce=$(echo $line | cut -d'.' -f2);
+ seq=$(echo $line | cut -d'.' -f3);
+ echo $seq | cut -c$cb-$ce;
+done > MACARON_validate.txt
+rm tmp
+
+
+
+
+exit 0
+
diff -r 000000000000 -r c9636a827049 MACARON-GenMed-LabEx/README.md
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/MACARON-GenMed-LabEx/README.md Wed Sep 12 08:45:03 2018 -0400
@@ -0,0 +1,286 @@
+MACARON User Guide
+================
+
+# Table of Contents
+
+[//]: # (BEGIN automated TOC section, any edits will be overwritten on next source refresh)
+
+* [Introduction](#introduction)
+* [Installation](#installation)
+ * [Operating System Guidelines](#operating-system-guidelines)
+ * [Runtime Pre-requisite](#runtime-pre-requisite)
+ * [Software Dependencies](#software-dependencies)
+ * [Downloading the Source Code](#downloading-the-source-code)
+ * [Contents of the Folder MACARON_GenMed](#contents-of-the-folder-macaron_genmed)
+* [Running the MACARON](#running-the-macaron)
+ * [Input Requirements](#input-requirements)
+ * [Default Options](#default-options)
+ * [demo Folder](#demo-folder)
+ * [Advanced Options](#advanced-options)
+* [MACARON Reporting Format](#macaron-reporting-format)
+* [Validating SNVs Existed on the Same Reads](#validating-snvs-existed-on-the-same-reads)
+* [References](#references)
+* [Citation](#citation)
+
+[//]: # (END automated TOC section, any edits will be overwritten on next source refresh)
+
+# Introduction
+
+MACARON (Multi-bAse Codon-Associated variant Re-annotatiON) is a python framework to identify and re-annotate multi-base affected codons in whole genome/exome sequence data. Starting from a standard VCF file, MACARON identifies, re-annotates and predicts the amino acid change resulting from multiple single nucleotide variants (SNVs) within the same genetic codon.
+
+The information below includes how to install and run MACARON to filter a list of variant records (from VCF file) called by any existing SNP-based variant caller to identify SNVs with the same genetic codon and correct their corresponding amino acid change.
+
+See latest [News](https://github.com/waqasuddinkhan/MACARON-GenMed-LabEx/wiki/News???) and [Updates](https://github.com/waqasuddinkhan/MACARON-GenMed-LabEx/wiki#updates) on [MACARON-GenMed-LabEx Wiki page](https://github.com/waqasuddinkhan/MACARON-GenMed-LabEx/wiki).
+
+# Installation
+
+### Operating System Guidelines
+
+MACARON is know to run on LINUX UBUNTU 16.04 LTS. However, MACARON can be run on any other LINUX version.
+
+### Runtime Pre-requisite
+
+__1.__ MACARON is executable in __PYTHON v2.7 or later__. If the user has multiple PYTHON versions, please make sure that your running environment is set to the required version of PYTHON.
+
+__2.__ Check your __JAVA__ version as MACARON is tested with:
+
+ java -version
+ openjdk version __"1.8.0_151"__
+ OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12)
+ OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)
+
+### Software Dependencies
+
+Before running MACARON, please make sure that following software are installed properly:
+
+__1.__ __Genome-Analysis Toolkit__ (https://software.broadinstitute.org/gatk/download/).
+
+__2.__ __SnpEff__ (tested with __v4.3__ (build 2017-05-05 18:41). However, MACARON can also run with any older or newer version (http://snpeff.sourceforge.net/download.html).
+
+__3.__ __SAMTools__ (tested with version __0.1.19__), however any version can be used.
+
+__4.__ __Human Reference Genome__: Depends on user’s input.
+
+__5.__ __SnpEff’s Human Annotation Database__: Depends on user’s input.
+
+For __1__ and __2__, as long as they are compatible with JAVA, MACARON has no issues.
+
+### Downloading the Source Code
+
+The most prefered way to use the lastest version of MACARON is:
+
+ git clone https://github.com/waqasuddinkhan/MACARON-GenMed-LabEx.git
+
+or download the ZIP folder.
+
+MACARON source code can also be downloaded from http://www.genmed.fr/images/publications/data/MACARON_GenMed.zip
+
+After acquiring a release distribution of the source code, the build procedure is to unpack the zip file:
+
+ unzip MACARON_GenMed.zip
+
+### Contents of the folder MACARON_GenMed
+
+* *MACARON* – The MACARON python code
+* *MACARON_validate.sh* – a BASH-shell script to validate multi-SNVs located on the same read that affect the same genetic codon
+
+# Running the MACARON
+
+### Input Requirements
+
+Before running MACARON, check these __input technical notes__ as the following limitations exist for either the input VCF file, or the required software dependencines:
+
+* Chromosome (chr) notation should be compatible with both input VCF file and Human Reference Genome file, or vice versa,
+
+* Sequence dictionaries of input VCF file and Human Reference Genome file should be the same,
+
+* Input VCF file (should) suitably be annotated with ANNOVAR, and additionally with any other annotation software, e.g, VEP (https://www.ensembl.org/info/docs/tools/vep/index.html) if the user has a desire to get the full functionality of -f option (see [Advanced Options](#advanced-options) below),
+
+* Same Human Reference Genome file should be used for MACARON which is practiced earlier for alignemnt and (or) to call variant sets,
+
+* Versions of input VCF file, Human Reference Genome file and SnpEff database file should be the same (hg19 / GRCh37 = SnpEff GRCh37.75) or (hg38 / GRCh38 = SnpEff GRCh38.86).
+
+### Default Options
+
+For a full list of MACARON executable options, run:
+
+ python MACARON -h
+
+By default, MACARON depends on the `GLOBAL VARIABLES` set in the script before run:
+
+ ## GLOBAL VARIABLES (IMPORTANT: You can set the default values here)
+ GATK="/home/wuk/software/GenomeAnalysisTK.jar"
+ #GATK="/home/wuk/software/gatk-4.0.1.2/gatk-package-4.0.1.2-local.jar"
+ HG_REF="/home/wuk/Working/gnme_refrnces/Homo_sapiens_assembly19.fasta"
+ SNPEFF="/home/wuk/software/snpEff/snpEff.jar"
+ SNPEFF_HG="GRCh37.75" ## SnpEff genome version
+
+To run MACARON with __GATK <4.0__ versions, simply type:
+
+ python MACARON -i test_input.vcf
+
+If running with __GATK >= 4.0__ versions, make following changes:
+
+ #GATK="/home/wuk/software/GenomeAnalysisTK.jar"
+ GATK="/home/wuk/software/gatk-4.0.1.2/gatk-package-4.0.1.2-local.jar"
+ HG_REF="/home/wuk/Working/gnme_refrnces/Homo_sapiens_assembly19.fasta"
+ SNPEFF="/home/wuk/software/snpEff/snpEff.jar"
+ SNPEFF_HG="GRCh37.75" ## SnpEff genome version
+
+and run with:
+
+ python MACARON -i test_input.vcf --gatk4
+
+### demo Folder
+
+To help verify a successful installation, MACARON includes a small demo data set:
+
+* *variants_of_interest.vcf* – a test VCF file to check the functionality of MACARON
+* *MACARON_output.txt* – The output file generated by running the MACARON
+* *sub1.chr22_21349676-21349677.sample02.bam* – a subset of BAM file used as input for MACARON_validate.sh
+* *MACARON_validate.txt* – The output file with read count information of concerned pcSNV in sample02 (in this case).
+(All files are referenced with hg19)
+
+`cd` to `demo` folder and run:
+
+ python ../MACARON -i variants_of_interest.vcf
+
+MACARON_output.txt is the default output file name of MACARON. User can change it with `-o` option.
+
+ python ../MACARON -i variants_of_interest.vcf -o variants_of_interest.txt
+
+### Advanced Options
+
+MACARON can be run by invoking paths directly set from the command-line:
+
+```bash
+python ../MACARON -i variants_of_interest.vcf --GATK /home/wuk/software/GenomeAnalysisTK.jar --HG_REF /home/wuk/Working/gnme_refrnces/Homo_sapiens_assembly19.fasta --SNPEFF /home/wuk/software/snpEff/snpEff.jar --SNPEFF_HG GRCh37.75
+```
+* For __GATK >= 4.0__ versions:
+
+```bash
+python ../MACARON -i variants_of_interest.vcf --gatk4 --GATK /home/wuk/software/ --HG_REF /home/wuk/Working/gnme_refrnces/Homo_sapiens_assembly19.fasta --SNPEFF /home/wuk/software/snpEff/snpEff.jar --SNPEFF_HG GRCh37.75
+```
+MACARON can add additional fields, besdies the dafault (see [MACARON Reporting Format](#macaron-reporting-format)) by using `-f` option:
+
+* `-f CSQ` (if input VCF file is additionally annotated with VEP, the output txt file also has the same complete annotation for each variant record)
+
+* `-f EFF` (if user wants to output SnpEff annotations in output txt file), or -f ANN (if SnpEff is used without -formatEff option)
+
+* `-f QUAL,DP,AF,Func.refGene,Gene.refGene,GeneDetail.refGene` (this will keep any other default annotations of input VCF file and of ANNOVAR to output txt file)
+
+-f can be used multiple times, e.g.,
+
+* `-f CSQ,DP,Func.refGene`
+or
+* `-f FILTER,EFF,CSQ,AF`
+
+The order of the fields in the output txt file depends on the order of INFO field headers used in `-f`.
+
+```bash
+python ../MACARON -i variants_of_interest.vcf --gatk4 --GATK /home/wuk/software/ --HG_REF /home/wuk/Working/gnme_refrnces/Homo_sapiens_assembly19.fasta --SNPEFF /home/wuk/software/snpEff/snpEff.jar --SNPEFF_HG GRCh37.75 -f QUAL,FILTER,SIFT_pred
+```
+Without `-f` option, `QUAL` field is outputted as default.If user wants to keep `QUAL` along with any other field, `-f` should mentiond `QUAL` in addition to other field headers: `-f QUAL,FILTER,SIFT_pred`. If only `-f SIFT_pred` is used, `QUAL` field is over-written by `SIFT_pred` field.
+
+# MACARON Reporting Format
+
+MACARON outputs a table text file with the following format specifications:
+
+```
+chr22 21349676 rs412470 T A LZTR1 423 T/T T/A T/T 0/0 0/1 0/0 MISSENSE S92T Tct Act ATt I 0 0
+chr22 21349677 rs376419 C T LZTR1 423 C/C C/T C/C 0/0 0/1 0/0 MISSENSE S92F tCt tTt 0 I 0 0
+```
+Field Number | Field Name | Description
+--- | --- | ---
+1 |CHROM | Chromosome number
+2 | POS | Chromosomal position / coordinates of SNV
+3 | ID | dbSNP rsID
+4 | REF | Reference base
+5 | ALT | Alternate base
+6 | Gene_Name | Name of a gene in which SnpCluster is located
+7 | QUAL | Quality of the ALT base called
+8 | [SAMPLE NAME].GT | Genotype of samples as base conventions as well as binary conventions
+9 | Protein_coding_EFF | Functional Effect of Variant on protein
+10 | AA-Change | Amino acid change by individual SNV
+11 | REF-codon | Reference Codon
+12 | ALT-codon | Alternate Codon
+13 | ALT-codon_merge-2VAR | A new codon formed by the combination of two Alt-codons (pcSNV codon; see [MACARON](https://academic.oup.com/bioinformatics/advance-article-abstract/doi/10.1093/bioinformatics/bty382/4992149?redirectedFrom=fulltext))
+14 | AA-Change-2VAR | Re-annotated amino acid formed by pcSNV codon
+15 | ALT-codon_merge-3VAR | A new codon formed by the combination of three Alt-codons
+16 | AA-Change-3VAR | Re-annotated amino acid formed by the combination of three Alt-codons
+
+This default's MACARON output can be changed by using `-f` option. For example, if MACARON run with `-f QUAL,FILTER,SIFT_pred`, the new output looks like:
+
+Field Number | Field Name | Description
+--- | --- | ---
+1 |CHROM | Chromosome number
+2 | POS | Chromosomal position / coordinates of SNV
+3 | ID | dbSNP rsID
+4 | REF | Reference base
+5 | ALT | Alternate base
+6 | Gene_Name | Name of a gene in which SnpCluster is located
+7 | QUAL | Quality of the ALT base called
+8 | FILTER | Filter (PASS) tag
+9 | SIFT_pred | Functional effect prediction of SNV on protien
+10 | [SAMPLE NAME].GT | Genotype of samples as base conventions as well as binary conventions
+11 | Protein_coding_EFF | Functional Effect of Variant on protein
+12 | AA-Change | Amino acid change by individual SNV
+13 | REF-codon | Reference Codon
+14 | ALT-codon | Alternate Codon
+15 | ALT-codon_merge-2VAR | A new codon formed by the combination of two Alt-codons (pcSNV codon; see [MACARON](https://academic.oup.com/bioinformatics/advance-article-abstract/doi/10.1093/bioinformatics/bty382/4992149?redirectedFrom=fulltext))
+16 | AA-Change-2VAR | Re-annotated amino acid formed by pcSNV codon
+17 | ALT-codon_merge-3VAR | A new codon formed by the combination of three Alt-codons
+18 | AA-Change-3VAR | Re-annotated amino acid formed by the combination of three Alt-codons
+
+# Validating SNVs Existed on the Same Reads
+
+**NB: You do not need to run this step if you already used phased VCF file to run MACARON**
+
+To confirm the existence of multi-SNVs within the same genetic codon, an accessory BASH-shell script [MACARON_validate.sh](MACARON_validate.sh) calculates the read count information of affected bases. This script requires as an input subset of BAM files (should be the same that used to generate the input VCF file) covering 50 bps over each SnpCluster.
+
+Subset of any BAM file can be generated by using the following command:
+
+`
+samtools view –hb –L sub1.bed sample02.bam > sub1.chr22_21349676-21349677.sample02.bam
+`
+
+In this case, our big BAM file `sample02.bam` (not provided here, obviously!!!) is subsetted as `sub1.chr22_21349676-21349677.sample02.bam` (see [demo](demo) folder) for the position `chr22:21349676`. The naming format of output BAM file should be the same. The `sub1.bed` file has 1 tab-seperated line:
+
+`chr22 21349676`
+
+representing the first position of SnpCluster (SNV1 only).
+
+Once subset BAM file(s) are generated, run MACARON_validate.sh:
+
+`MACARON_validate.sh sub1.chr22_21349676-21349677.sample02.bam`
+
+This will generate an output text file (`MACARON_validate.txt`) allowing the user for further analysis.
+
+ sub1 chr22:21349676-21349677 sample02
+ 1 AA
+ 1 T
+ 11 AT
+ 14 TC
+
+See [MACARON-GenMed-LabEx Wiki page](https://github.com/waqasuddinkhan/MACARON-GenMed-LabEx/wiki) for more details, and interpretations of the [demo](demo) data.
+
+# References
+
+__1.__ [Van der Auwera G.A., et al. (2013) From FastQ Data to High-Confidence Variant Calls: The Genome Analysis Toolkit Best Practices Pipeline, Curr Protoc Bioinformatics, 43:11.10.1-11.10.33](https://currentprotocols.onlinelibrary.wiley.com/doi/abs/10.1002/0471250953.bi1110s43).
+
+__2.__ [Cingolani, P., et al. (2012) A program for annotating and predicting the effects of single nucleotide polymorphisms, SnpEff: SNPs in the genome of Drosophila melanogaster strain w1118; iso-2; iso-3, Fly, 6, 80-92](https://www.tandfonline.com/doi/full/10.4161/fly.19695).
+
+__3.__ [McLaren, W., et al. (2010) Deriving the consequences of genomic variants with the Ensembl API and SNP Effect Predictor, Bioinformatics, 26, 2069-2070](https://academic.oup.com/bioinformatics/article/26/16/2069/217748).
+
+__4.__ [Wang, K., Li, M. and Hakonarson, H. (2010) ANNOVAR: functional annotation of genetic variants from high-throughput sequencing data, Nucleic Acids Res, 38, e164](https://academic.oup.com/nar/article/38/16/e164/1749458).
+
+# Citation
+
+If you use [MACARON](https://academic.oup.com/bioinformatics/advance-article-abstract/doi/10.1093/bioinformatics/bty382/4992149?redirectedFrom=fulltext) in your research, please cite:
+
+*Khan W. et al. MACARON: a python framework to identify and re-annotate multi-base affected codons in whole genome/exome sequence data, Bioinformatics 2018*
+
+*CONTACT: david-alexandre.tregouet@inserm.fr; waqasnayab@gmail.com*
+
+*VERSION: 0.7*
+*VERSION DATE: September 5, 2018*
diff -r 000000000000 -r c9636a827049 MACARON-GenMed-LabEx/_config.yml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/MACARON-GenMed-LabEx/_config.yml Wed Sep 12 08:45:03 2018 -0400
@@ -0,0 +1,15 @@
+plugins:
+ - jekyll-seo-tag
+
+title: macaron
+username: waqasuddinkhan
+url: https://github.com/waqasuddinkhan/MACARON-GenMed-LabEx
+
+webmaster_verifications:
+ google: 1234
+ bing: 1234
+ alexa: 1234
+ yandex: 1234
+ baidu: 1234
+
+theme: jekyll-theme-cayman
diff -r 000000000000 -r c9636a827049 MACARON-GenMed-LabEx/demo/MACARON_output.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/MACARON-GenMed-LabEx/demo/MACARON_output.txt Wed Sep 12 08:45:03 2018 -0400
@@ -0,0 +1,5 @@
+CHROM POS ID REF ALT Gene_Name QUAL sample01.GT sample02.GT sample03.GT sample01.GT sample02.GT sample03.GT Protein_coding_Gene_Name AA-Change REF-codon ALT-codon ALT-codon_merge-2VAR AA-Change-2VAR ALT-codon_merge-3VAR AA-Change-3VAR
+chr22 21349676 rs412470 T A LZTR1 423.0 T/T T/A T/T 0/0 0/1 0/0 MISSENSE S92T Tct Act ATt I . .
+chr22 21349677 rs376419 C T LZTR1 423.0 C/C C/T C/C 0/0 0/1 0/0 MISSENSE S92F tCt tTt . I . .
+chr22 23247169 rs527511481 T G IGLJ3 719.0 T/T T/G T/T 0/0 0/1 0/0 MISSENSE W39G Tgg Ggg GTg V . .
+chr22 23247170 rs540954398 G T IGLJ3 716.0 G/G G/T G/G 0/0 0/1 0/0 MISSENSE W39L tGg tTg . V . .
diff -r 000000000000 -r c9636a827049 MACARON-GenMed-LabEx/demo/MACARON_validate.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/MACARON-GenMed-LabEx/demo/MACARON_validate.txt Wed Sep 12 08:45:03 2018 -0400
@@ -0,0 +1,5 @@
+sub1 chr22:21349676-21349677 sample02
+ 1 AA
+ 1 T
+ 11 AT
+ 14 TC
diff -r 000000000000 -r c9636a827049 MACARON-GenMed-LabEx/demo/sub1.chr22_21349676-21349677.sample02.bam
Binary file MACARON-GenMed-LabEx/demo/sub1.chr22_21349676-21349677.sample02.bam has changed
diff -r 000000000000 -r c9636a827049 MACARON-GenMed-LabEx/demo/variants_of_interest.vcf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/MACARON-GenMed-LabEx/demo/variants_of_interest.vcf Wed Sep 12 08:45:03 2018 -0400
@@ -0,0 +1,395 @@
+##fileformat=VCFv4.2
+##ALT=
+##FILTER=
+##FILTER=
+##FILTER=
+##FILTER=
+##FILTER=
+##FILTER=
+##FORMAT=
+##FORMAT=
+##FORMAT=
+##FORMAT=
+##FORMAT=
+##FORMAT=
+##FORMAT=
+##FORMAT=
+##FORMAT=
+##FORMAT=
+##GVCFBlock0-1=minGQ=0(inclusive),maxGQ=1(exclusive)
+##GVCFBlock1-2=minGQ=1(inclusive),maxGQ=2(exclusive)
+##GVCFBlock10-11=minGQ=10(inclusive),maxGQ=11(exclusive)
+##GVCFBlock11-12=minGQ=11(inclusive),maxGQ=12(exclusive)
+##GVCFBlock12-13=minGQ=12(inclusive),maxGQ=13(exclusive)
+##GVCFBlock13-14=minGQ=13(inclusive),maxGQ=14(exclusive)
+##GVCFBlock14-15=minGQ=14(inclusive),maxGQ=15(exclusive)
+##GVCFBlock15-16=minGQ=15(inclusive),maxGQ=16(exclusive)
+##GVCFBlock16-17=minGQ=16(inclusive),maxGQ=17(exclusive)
+##GVCFBlock17-18=minGQ=17(inclusive),maxGQ=18(exclusive)
+##GVCFBlock18-19=minGQ=18(inclusive),maxGQ=19(exclusive)
+##GVCFBlock19-20=minGQ=19(inclusive),maxGQ=20(exclusive)
+##GVCFBlock2-3=minGQ=2(inclusive),maxGQ=3(exclusive)
+##GVCFBlock20-21=minGQ=20(inclusive),maxGQ=21(exclusive)
+##GVCFBlock21-22=minGQ=21(inclusive),maxGQ=22(exclusive)
+##GVCFBlock22-23=minGQ=22(inclusive),maxGQ=23(exclusive)
+##GVCFBlock23-24=minGQ=23(inclusive),maxGQ=24(exclusive)
+##GVCFBlock24-25=minGQ=24(inclusive),maxGQ=25(exclusive)
+##GVCFBlock25-26=minGQ=25(inclusive),maxGQ=26(exclusive)
+##GVCFBlock26-27=minGQ=26(inclusive),maxGQ=27(exclusive)
+##GVCFBlock27-28=minGQ=27(inclusive),maxGQ=28(exclusive)
+##GVCFBlock28-29=minGQ=28(inclusive),maxGQ=29(exclusive)
+##GVCFBlock29-30=minGQ=29(inclusive),maxGQ=30(exclusive)
+##GVCFBlock3-4=minGQ=3(inclusive),maxGQ=4(exclusive)
+##GVCFBlock30-31=minGQ=30(inclusive),maxGQ=31(exclusive)
+##GVCFBlock31-32=minGQ=31(inclusive),maxGQ=32(exclusive)
+##GVCFBlock32-33=minGQ=32(inclusive),maxGQ=33(exclusive)
+##GVCFBlock33-34=minGQ=33(inclusive),maxGQ=34(exclusive)
+##GVCFBlock34-35=minGQ=34(inclusive),maxGQ=35(exclusive)
+##GVCFBlock35-36=minGQ=35(inclusive),maxGQ=36(exclusive)
+##GVCFBlock36-37=minGQ=36(inclusive),maxGQ=37(exclusive)
+##GVCFBlock37-38=minGQ=37(inclusive),maxGQ=38(exclusive)
+##GVCFBlock38-39=minGQ=38(inclusive),maxGQ=39(exclusive)
+##GVCFBlock39-40=minGQ=39(inclusive),maxGQ=40(exclusive)
+##GVCFBlock4-5=minGQ=4(inclusive),maxGQ=5(exclusive)
+##GVCFBlock40-41=minGQ=40(inclusive),maxGQ=41(exclusive)
+##GVCFBlock41-42=minGQ=41(inclusive),maxGQ=42(exclusive)
+##GVCFBlock42-43=minGQ=42(inclusive),maxGQ=43(exclusive)
+##GVCFBlock43-44=minGQ=43(inclusive),maxGQ=44(exclusive)
+##GVCFBlock44-45=minGQ=44(inclusive),maxGQ=45(exclusive)
+##GVCFBlock45-46=minGQ=45(inclusive),maxGQ=46(exclusive)
+##GVCFBlock46-47=minGQ=46(inclusive),maxGQ=47(exclusive)
+##GVCFBlock47-48=minGQ=47(inclusive),maxGQ=48(exclusive)
+##GVCFBlock48-49=minGQ=48(inclusive),maxGQ=49(exclusive)
+##GVCFBlock49-50=minGQ=49(inclusive),maxGQ=50(exclusive)
+##GVCFBlock5-6=minGQ=5(inclusive),maxGQ=6(exclusive)
+##GVCFBlock50-51=minGQ=50(inclusive),maxGQ=51(exclusive)
+##GVCFBlock51-52=minGQ=51(inclusive),maxGQ=52(exclusive)
+##GVCFBlock52-53=minGQ=52(inclusive),maxGQ=53(exclusive)
+##GVCFBlock53-54=minGQ=53(inclusive),maxGQ=54(exclusive)
+##GVCFBlock54-55=minGQ=54(inclusive),maxGQ=55(exclusive)
+##GVCFBlock55-56=minGQ=55(inclusive),maxGQ=56(exclusive)
+##GVCFBlock56-57=minGQ=56(inclusive),maxGQ=57(exclusive)
+##GVCFBlock57-58=minGQ=57(inclusive),maxGQ=58(exclusive)
+##GVCFBlock58-59=minGQ=58(inclusive),maxGQ=59(exclusive)
+##GVCFBlock59-60=minGQ=59(inclusive),maxGQ=60(exclusive)
+##GVCFBlock6-7=minGQ=6(inclusive),maxGQ=7(exclusive)
+##GVCFBlock60-70=minGQ=60(inclusive),maxGQ=70(exclusive)
+##GVCFBlock7-8=minGQ=7(inclusive),maxGQ=8(exclusive)
+##GVCFBlock70-80=minGQ=70(inclusive),maxGQ=80(exclusive)
+##GVCFBlock8-9=minGQ=8(inclusive),maxGQ=9(exclusive)
+##GVCFBlock80-90=minGQ=80(inclusive),maxGQ=90(exclusive)
+##GVCFBlock9-10=minGQ=9(inclusive),maxGQ=10(exclusive)
+##GVCFBlock90-99=minGQ=90(inclusive),maxGQ=99(exclusive)
+##GVCFBlock99-2147483647=minGQ=99(inclusive),maxGQ=2147483647(exclusive)
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##contig=
+##reference=file:///home/wuk/Working/gnme_refrnces/Homo_sapiens_assembly19.fasta
+##source=SelectVariants
+##SnpEffVersion="4.3m (build 2017-05-05 18:41), by Pablo Cingolani"
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=
+##INFO=