How to use call_safe method in localstack

Best Python code snippet using localstack_python

variant.py

Source:variant.py Github

copy

Full Screen

...110 parsed_variant["genetic_models"] = parse_genetic_models(111 variant.INFO.get("GeneticModels"), genmod_key112 )113 ################# Add autozygosity calls if present #################114 parsed_variant["azlength"] = call_safe(int, variant.INFO.get("AZLENGTH"))115 parsed_variant["azqual"] = call_safe(float, variant.INFO.get("AZQUAL"))116 ################ Add STR info if present ################117 # repeat id generally corresponds to gene symbol118 parsed_variant["str_repid"] = call_safe(str, variant.INFO.get("REPID"))119 # repeat unit - used e g in PanelApp naming of STRs120 parsed_variant["str_ru"] = call_safe(str, variant.INFO.get("RU"))121 # repeat unit - used e g in PanelApp naming of STRs122 parsed_variant["str_display_ru"] = call_safe(str, variant.INFO.get("DisplayRU"))123 # repeat ref - reference copy number124 parsed_variant["str_ref"] = call_safe(int, variant.INFO.get("REF"))125 # repeat len - number of repeats found in case126 parsed_variant["str_len"] = call_safe(int, variant.INFO.get("RL"))127 # str status - this indicates the severity of the expansion level128 parsed_variant["str_status"] = call_safe(str, variant.INFO.get("STR_STATUS"))129 # str normal max - max number of repeats to call an STR variant normal130 parsed_variant["str_normal_max"] = call_safe(int, variant.INFO.get("STR_NORMAL_MAX"))131 # str pathological min - min number of repeats to call an STR variant pathologic132 parsed_variant["str_pathologic_min"] = call_safe(int, variant.INFO.get("STR_PATHOLOGIC_MIN"))133 # str disease - disease name annotation134 parsed_variant["str_disease"] = call_safe(str, variant.INFO.get("Disease"))135 # str disease inheritance mode string annotation136 parsed_variant["str_inheritance_mode"] = call_safe(str, variant.INFO.get("InheritanceMode"))137 # str source dict with display string, source type and entry id138 set_source(parsed_variant, variant)139 parsed_variant["str_swegen_mean"] = call_safe(float, variant.INFO.get("SweGenMean"))140 parsed_variant["str_swegen_std"] = call_safe(float, variant.INFO.get("SweGenStd"))141 ################# Add somatic info ##################142 parsed_variant["somatic_score"] = call_safe(int, variant.INFO.get("SOMATICSCORE"))143 ################# Add mitomap info, from HmtNote #################144 set_mitomap_associated_diseases(parsed_variant, variant)145 ################# Add HmtVar variant id, from HmtNote #################146 add_hmtvar(parsed_variant, variant)147 ### Add custom info148 parsed_variant["custom"] = parse_custom_data(variant.INFO.get("SCOUT_CUSTOM"))149 ### Add gene and transcript information150 parsed_transcripts = add_gene_and_transcript_info(parsed_variant, variant, vep_header)151 ################# Add clinsig prediction #################152 set_clnsig(parsed_variant, variant, parsed_transcripts)153 ################# Add the frequencies #################154 frequencies = parse_frequencies(variant, parsed_transcripts)155 parsed_variant["frequencies"] = frequencies156 # SNVs contain INFO field Obs, SVs contain clinical_genomics_loqusObs157 local_obs_old = variant.INFO.get("Obs") or variant.INFO.get("clinical_genomics_loqusObs")158 if local_obs_old:159 parsed_variant["local_obs_old"] = int(local_obs_old)160 # SNVs only161 parsed_variant["local_obs_hom_old"] = call_safe(int, variant.INFO.get("Hom"))162 # SVs only163 parsed_variant["local_obs_old_freq"] = call_safe(164 float, variant.INFO.get("clinical_genomics_loqusFrq")165 )166 set_local_archive_info(parsed_variant, local_archive_info)167 if local_archive_info and "Date" in local_archive_info:168 parsed_variant["local_obs_old_date"] = local_archive_info.get("Date")169 if local_archive_info and "NrCases" in local_archive_info:170 parsed_variant["local_obs_old_nr_cases"] = local_archive_info.get("NrCases")171 if local_archive_info and "Description" in local_archive_info:172 parsed_variant["local_obs_old_desc"] = local_archive_info.get("Description")173 ###################### Add severity predictions ######################174 parsed_variant["cadd_score"] = parse_cadd(variant, parsed_transcripts)175 parsed_variant["spidex"] = call_safe(float, variant.INFO.get("SPIDEX"))176 if len(parsed_transcripts) > 0:177 parsed_variant["revel_score"] = parsed_transcripts[0].get(178 "revel"179 ) # This is actually the value of REVEL_rankscore180 parsed_variant["revel"] = parsed_transcripts[0].get(181 "revel_score"182 ) # This is actually the value of REVEL_score183 ###################### Add conservation ######################184 parsed_variant["conservation"] = parse_conservations(variant, parsed_transcripts)185 parsed_variant["callers"] = parse_callers(variant, category=category)186 set_rank_result(parsed_variant, variant, rank_results_header)187 ###################### Add SV specific annotations ######################188 sv_frequencies = parse_sv_frequencies(variant)189 for key in sv_frequencies:...

Full Screen

Full Screen

internal.py

Source:internal.py Github

copy

Full Screen

...115 def on_get(self, request):116 from localstack.utils import diagnose117 return {118 "version": {119 "image-version": call_safe(diagnose.get_docker_image_details),120 "localstack-version": call_safe(diagnose.get_localstack_version),121 "host": {122 "kernel": call_safe(diagnose.get_host_kernel_version),123 },124 },125 "services": call_safe(diagnose.get_service_stats),126 "config": call_safe(diagnose.get_localstack_config),127 "docker-inspect": call_safe(diagnose.inspect_main_container),128 "docker-dependent-image-hashes": call_safe(diagnose.get_important_image_hashes),129 "file-tree": call_safe(diagnose.get_file_tree),130 "important-endpoints": call_safe(diagnose.resolve_endpoints),131 "logs": call_safe(diagnose.get_localstack_logs),132 }133class LocalstackResources(Router):134 """135 Router for localstack-internal HTTP resources.136 """137 def __init__(self):138 super().__init__(dispatcher=resource_dispatcher(pass_response=False))139 self.add_default_routes()140 # TODO: load routes as plugins141 def add_default_routes(self):142 from localstack.services.plugins import SERVICE_PLUGINS143 health_resource = HealthResource(SERVICE_PLUGINS)144 graph_resource = ResourceGraph()145 # two special routes for legacy support (before `/_localstack` was introduced)...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run localstack automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful