Created
May 9, 2018 19:06
-
-
Save wdecoster/cf99362f9a22882c765058cf59ec6fb4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from cyvcf2 import VCF | |
| import sys | |
| import matplotlib.pyplot as plt | |
| from matplotlib_venn import venn2 | |
| def is_variant(call): | |
| if call == 1 or call == 3: | |
| return True | |
| else: | |
| return False | |
| def main(vcf): | |
| identifiers = [[], []] | |
| for v in VCF(vcf): | |
| for index, call in enumerate(v.gt_types): | |
| if is_variant(call): | |
| identifiers[index].append(v.ID) | |
| venn2([set(i) for i in identifiers], set_labels=('NanoSV', 'Sniffles')) | |
| plt.savefig(sys.argv[1] + ".png") | |
| if __name__ == '__main__': | |
| main(sys.argv[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment