def create_vcf(vcf_file_path, include_status): """Create a VCF file of CIViC variants""" with open(vcf_file_path, "w") as fh: writer = VCFWriter(fh) for variant in civic.get_all_variants(include_status=include_status): if variant.is_valid_for_vcf(): writer.addrecord(variant) writer.writerecords()
def setup_module(): try: civic.load_cache() except FileNotFoundError: pass civic.get_all_variants()
def test_get_non_rejected(self): variants = civic.get_all_variants( include_status=['accepted', 'submitted']) assert len(variants) >= 2374
def test_get_all(self): variants = civic.get_all_variants() assert len(variants) >= 2396
def test_get_all_ids(self): variant_ids = civic.get_all_variant_ids() assert len(variant_ids) >= len(civic.get_all_variants())
def test_get_accepted_only(self): variants = civic.get_all_variants(include_status=['accepted']) assert len(variants) >= 1333
def export_all_variants_to_vcf(file): w = exports.VCFWriter(file) all_variants = civic.get_all_variants() w.addrecords(all_variants) w.writerecords()