def test_parse_coordinates_indel(): variant = CyvcfVariant(alt="ACCC", end=80003) coordinates = parse_coordinates(variant, "snv") assert coordinates["position"] == variant.POS assert coordinates["end"] == variant.end
def test_parse_coordinates_indel(): variant = CyvcfVariant(alt='ACCC', end=80003) coordinates = parse_coordinates(variant, 'snv') assert coordinates['position'] == variant.POS assert coordinates['end'] == variant.end
def test_parse_coordinates_indel(): variant = CyvcfVariant(alt='ACCC', end=80003) coordinates = parse_coordinates(variant, 'snv') assert coordinates['position'] == variant.POS assert coordinates['end'] == variant.end
def _is_managed( self, variant, category="snv", build="37", ): """Check if variant is on the managaged list. All variants on the list will be loaded regardless of the kind of relevance. Arguments: variant(cyvcf2.Variant) category(str): snv, sv, str, cancer, cancer_sv build(str): "37" or "38" Returns: is_managed(boolean) """ coordinates = parse_coordinates(variant, category, build) return (self.find_managed_variant( parse_managed_variant_id( coordinates["chrom"], coordinates["position"], coordinates["ref"], coordinates["alt"], category, coordinates["sub_category"], build, )) is not None)
def test_parse_coordinates_indel(mock_variant): """Test to parse the coordinates for an indel""" mock_variant.ALT = "ACCC" mock_variant.end = 80003 variant = mock_variant coordinates = parse_coordinates(variant, "snv") assert coordinates["position"] == variant.POS assert coordinates["end"] == variant.end assert coordinates["sub_category"] == "indel" assert coordinates["length"] == len(variant.ALT[0])
def test_parse_coordinates_translocation(mock_variant): """Test to parse the coordinates for a translocation""" mock_variant.INFO = {"SVTYPE": "BND"} mock_variant.REF = "N" mock_variant.ALT = "N[hs37d5:12060532[" mock_variant.POS = 724779 mock_variant.end = 724779 mock_variant.var_type = "sv" variant = mock_variant coordinates = parse_coordinates(variant, "sv") assert coordinates["position"] == variant.POS assert coordinates["end"] == 12060532 assert coordinates["end_chrom"] == "hs37d5" assert coordinates["length"] == 10e10 assert coordinates["sub_category"] == "bnd"
def test_parse_coordinates_snv(mock_variant): """Test to parse the coordinates for a simple snv""" # GIVEN a cyvcf2 variant variant = mock_variant # WHEN parsing the coordinate info coordinates = parse_coordinates(variant, "snv") # THEN assert that they are correctly parsed assert coordinates["position"] == variant.POS assert coordinates["end"] == variant.end assert coordinates["length"] == len(variant.ALT) assert coordinates["sub_category"] == "snv" assert coordinates["mate_id"] is None assert (coordinates["cytoband_start"] == coordinates["cytoband_end"] == get_cytoband_coordinates(variant.CHROM, variant.POS, "37")) assert coordinates["end_chrom"] == variant.CHROM
def test_parse_coordinates_translocation_2(): info_dict = {"SVTYPE": "BND"} variant = CyvcfVariant( ref="N", alt="N[GL000232.1:25141[", pos=724779, end=724779, var_type="sv", info_dict=info_dict, ) coordinates = parse_coordinates(variant, "sv") assert coordinates["position"] == variant.POS assert coordinates["end"] == 25141 assert coordinates["end_chrom"] == "GL000232.1" assert coordinates["length"] == 10e10 assert coordinates["sub_category"] == "bnd"
def test_parse_coordinates_translocation(): info_dict = {"SVTYPE": "BND"} variant = CyvcfVariant( ref="N", alt="N[hs37d5:12060532[", pos=724779, end=724779, var_type="sv", info_dict=info_dict, ) coordinates = parse_coordinates(variant, "sv") assert coordinates["position"] == variant.POS assert coordinates["end"] == 12060532 assert coordinates["end_chrom"] == "hs37d5" assert coordinates["length"] == 10e10 assert coordinates["sub_category"] == "bnd"
def test_parse_coordinates_translocation_2(): info_dict = { 'SVTYPE': 'BND', } variant = CyvcfVariant( ref='N', alt='N[GL000232.1:25141[', pos=724779, end=724779, var_type='sv', info_dict=info_dict, ) coordinates = parse_coordinates(variant, 'sv') assert coordinates['position'] == variant.POS assert coordinates['end'] == 25141 assert coordinates['end_chrom'] == 'GL000232.1' assert coordinates['length'] == 10e10 assert coordinates['sub_category'] == 'bnd'
def test_parse_coordinates_translocation(): info_dict = { 'SVTYPE': 'BND', } variant = CyvcfVariant( ref='N', alt='N[hs37d5:12060532[', pos=724779, end=724779, var_type='sv', info_dict=info_dict, ) coordinates = parse_coordinates(variant, 'sv') assert coordinates['position'] == variant.POS assert coordinates['end'] == 12060532 assert coordinates['end_chrom'] == 'hs37d5' assert coordinates['length'] == 10e10 assert coordinates['sub_category'] == 'bnd'
def test_parse_coordinates_translocation_2(): info_dict = { 'SVTYPE': 'BND', } variant = CyvcfVariant( ref='N', alt='N[GL000232.1:25141[', pos=724779, end=724779, var_type='sv', info_dict=info_dict, ) coordinates = parse_coordinates(variant, 'sv') assert coordinates['position'] == variant.POS assert coordinates['end'] == 25141 assert coordinates['end_chrom'] == 'GL000232.1' assert coordinates['length'] == 10e10 assert coordinates['sub_category'] == 'bnd'
def test_parse_coordinates_translocation(): info_dict = { 'SVTYPE': 'BND', } variant = CyvcfVariant( ref='N', alt='N[hs37d5:12060532[', pos=724779, end=724779, var_type='sv', info_dict=info_dict, ) coordinates = parse_coordinates(variant, 'sv') assert coordinates['position'] == variant.POS assert coordinates['end'] == 12060532 assert coordinates['end_chrom'] == 'hs37d5' assert coordinates['length'] == 10e10 assert coordinates['sub_category'] == 'bnd'
def test_parse_coordinates_snv(): variant = CyvcfVariant() coordinates = parse_coordinates(variant, "snv") assert coordinates["position"] == variant.POS
def test_parse_coordinates_snv(): variant = CyvcfVariant() coordinates = parse_coordinates(variant, 'snv') assert coordinates['position'] == variant.POS
def test_parse_coordinates_snv(): variant = CyvcfVariant() coordinates = parse_coordinates(variant, 'snv') assert coordinates['position'] == variant.POS