示例#1
0
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()
示例#2
0
def setup_module():
    try:
        civic.load_cache()
    except FileNotFoundError:
        pass
    civic.get_all_variants()
示例#3
0
 def test_get_non_rejected(self):
     variants = civic.get_all_variants(
         include_status=['accepted', 'submitted'])
     assert len(variants) >= 2374
示例#4
0
 def test_get_all(self):
     variants = civic.get_all_variants()
     assert len(variants) >= 2396
示例#5
0
 def test_get_all_ids(self):
     variant_ids = civic.get_all_variant_ids()
     assert len(variant_ids) >= len(civic.get_all_variants())
示例#6
0
 def test_get_accepted_only(self):
     variants = civic.get_all_variants(include_status=['accepted'])
     assert len(variants) >= 1333
示例#7
0
def export_all_variants_to_vcf(file):
    w = exports.VCFWriter(file)
    all_variants = civic.get_all_variants()
    w.addrecords(all_variants)
    w.writerecords()