Esempio n. 1
0
 def __get_translated_reference_allele(
         cls, call: SimpleCall, panel: Panel,
         call_reference_assembly: ReferenceAssembly) -> Optional[str]:
     if panel.contains_rs_id_matching_call(call, call_reference_assembly):
         rs_id_info = panel.get_matching_rs_id_info(
             call.start_coordinate, call.reference_allele,
             call_reference_assembly)
         cls.__assert_rs_id_call_matches_info(call.rs_ids,
                                              (rs_id_info.rs_id, ))
         return rs_id_info.get_reference_allele(
             call_reference_assembly.opposite())
     else:
         # unknown variant
         return None
Esempio n. 2
0
 def __fill_in_rs_ids_if_needed(
         cls, call: SimpleCall, panel: Panel,
         reference_assembly: ReferenceAssembly) -> SimpleCall:
     rs_ids: Tuple[str, ...]
     if call.rs_ids == (".", ) and panel.contains_rs_id_matching_call(
             call, reference_assembly):
         rs_id_info = panel.get_matching_rs_id_info(call.start_coordinate,
                                                    call.reference_allele,
                                                    reference_assembly)
         rs_ids = (rs_id_info.rs_id, )
         new_simple_call = SimpleCall(
             call.start_coordinate,
             call.reference_allele,
             call.alleles,
             call.gene,
             rs_ids,
             call.variant_annotation,
             call.filter,
         )
         return new_simple_call
     else:
         return call