From fd86f09cf4d157cbbfad9eb8f86a878be3bbb90a Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Fri, 15 Dec 2023 14:08:27 +0000 Subject: [PATCH 01/29] Parsing populations from VCF --- common/file_model/populations.json | 35 ++++ common/file_model/variant_allele.py | 173 +++++++++++++++--- .../population_allele_frequency.graphql | 10 +- 3 files changed, 190 insertions(+), 28 deletions(-) create mode 100644 common/file_model/populations.json diff --git a/common/file_model/populations.json b/common/file_model/populations.json new file mode 100644 index 0000000..752a009 --- /dev/null +++ b/common/file_model/populations.json @@ -0,0 +1,35 @@ +{ + "1000_genomes": { + "AF": "1000GENOMES:phase_3:ALL", + "AFR_AF": "1000GENOMES:phase_3:AFR", + "AMR_AF": "1000GENOMES:phase_3:AMR", + "EAS_AF": "1000GENOMES:phase_3:EAS", + "EUR_AF": "1000GENOMES:phase_3:EUR", + "SAS_AF": "1000GENOMES:phase_3:SAS" + }, + "gnomAD_exomes": { + "ALL": "gnomADe:ALL", + "afr": "gnomADe:afr", + "amr": "gnomADe:amr", + "asj": "gnomADe:asj", + "eas": "gnomADe:eas", + "fin": "gnomADe:fin", + "nfe": "gnomADe:nfe", + "oth": "gnomADe:oth", + "sas": "gnomADe:sas" + }, + "gnomAD_genomes": { + "ALL": "gnomADg:ALL", + "afr": "gnomADg:afr", + "ami": "gnomADg:ami", + "amr": "gnomADg:amr", + "asj": "gnomADg:asj", + "eas": "gnomADg:eas", + "fin": "gnomADg:fin", + "mid": "gnomADg:mid", + "nfe": "gnomADg:nfe", + "oth": "gnomADg:oth", + "sas": "gnomADg:sas" + + } +} diff --git a/common/file_model/variant_allele.py b/common/file_model/variant_allele.py index 013e2db..e4f9fd6 100644 --- a/common/file_model/variant_allele.py +++ b/common/file_model/variant_allele.py @@ -41,7 +41,12 @@ def get_prediction_results(self): min_alt = self.minimise_allele(self.alt) return self.info_map[min_alt]["prediction_results"] if min_alt in self.info_map else [] - + def get_population_allele_frequencies(self): + min_alt = self.minimise_allele(self.alt) + print("Hi") + population_map = self.traverse_population_info() + return population_map[min_alt] if min_alt in population_map else [] + def traverse_csq_info(self) -> Mapping: """ This function is to traverse the CSQ record and extract columns @@ -70,7 +75,127 @@ def traverse_csq_info(self) -> Mapping: current_prediction_results = info_map[csq_record_list[prediction_index_map["allele"]]]["prediction_results"] info_map[csq_record_list[prediction_index_map["allele"]]]["prediction_results"] += self.create_allele_prediction_results(current_prediction_results, csq_record_list, prediction_index_map) return info_map + + def traverse_population_info(self) -> Mapping: + directory = os.path.dirname(__file__) + with open(os.path.join(directory,'populations.json')) as pop_file: + pop_names = json.load(pop_file) + + kg_column_list = ["AF","AFR_AF","AMR_AF","EAS_AF","EUR_AF","SAS_AF"] + + gnomADe_column_map = { + "ALL": ["gnomAD_exomes_AF","gnomAD_exomes_AC","gnomAD_exomes_AN"], + "afr": ["gnomAD_exomes_AF_afr","gnomAD_exomes_AC_afr","gnomAD_exomes_AN_afr"], + "amr": ["gnomAD_exomes_AF_amr","gnomAD_exomes_AC_amr","gnomAD_exomes_AN_amr"], + "asj": ["gnomAD_exomes_AF_asj","gnomAD_exomes_AC_asj","gnomAD_exomes_AN_asj"], + "eas": ["gnomAD_exomes_AF_eas","gnomAD_exomes_AC_eas","gnomAD_exomes_AN_eas"], + "fin": ["gnomAD_exomes_AF_fin","gnomAD_exomes_AC_fin","gnomAD_exomes_AN_fin"], + "nfe": ["gnomAD_exomes_AF_nfe","gnomAD_exomes_AC_nfe","gnomAD_exomes_AN_nfe"], + "oth": ["gnomAD_exomes_AF_oth","gnomAD_exomes_AC_oth","gnomAD_exomes_AN_oth"], + "sas": ["gnomAD_exomes_AF_sas","gnomAD_exomes_AC_sas","gnomAD_exomes_AN_sas"] + } + + gnomADg_column_map = { + "ALL": ["gnomAD_genomes_AF","gnomAD_genomes_AC","gnomAD_genomes_AN"], + "afr": ["gnomAD_genomes_AF_afr","gnomAD_genomes_AC_afr","gnomAD_genomes_AN_afr"], + "ami": ["gnomAD_genomes_AF_ami","gnomAD_genomes_AC_ami","gnomAD_genomes_AN_ami"], + "amr": ["gnomAD_genomes_AF_amr","gnomAD_genomes_AC_amr","gnomAD_genomes_AN_amr"], + "asj": ["gnomAD_genomes_AF_asj","gnomAD_genomes_AC_asj","gnomAD_genomes_AN_asj"], + "eas": ["gnomAD_genomes_AF_eas","gnomAD_genomes_AC_eas,gnomAD_genomes_AN_eas"], + "fin": ["gnomAD_genomes_AF_fin","gnomAD_genomes_AC_fin","gnomAD_genomes_AN_fin"], + "mid": ["gnomAD_genomes_AF_mid","gnomAD_genomes_AC_mid","gnomAD_genomes_AN_mid"], + "nfe": ["gnomAD_genomes_AF_nfe","gnomAD_genomes_AC_nfe","gnomAD_genomes_AN_nfe"], + "oth": ["gnomAD_genomes_AF_oth","gnomAD_genomes_AC_oth","gnomAD_genomes_AN_oth"], + "sas": ["gnomAD_genomes_AF_sas","gnomAD_genomes_AC_sas","gnomAD_genomes_AN_sas"] + } + + population_frequency_map = {} + frequency_stats = {} + + for csq_record in self.variant.info["CSQ"]: + csq_record_list = csq_record.split("|") + allele_index = self.variant.get_info_key_index("Allele") + if allele_index is not None and csq_record_list[allele_index] is not None: + if csq_record_list[allele_index] not in population_frequency_map.keys(): + population_frequency_map[csq_record_list[allele_index]] = [] + for col in kg_column_list: + col_index = self.variant.get_info_key_index(col) + if col_index is not None and csq_record_list[col_index] is not None: + if pop_names[col] not in frequency_stats.keys(): + frequency_stats[pop_names[col]] = {} + frequency_stats[pop_names[col]][csq_record_list[allele_index]] = csq_record_list[col_index] + print(csq_record_list[col_index]) + if csq_record_list[col_index]: + print(csq_record_list[col_index]) + population_frequency = { + "population": pop_names[col], + "allele_frequency": csq_record_list[col_index], + "is_minor_allele": False, + "is_hpmaf": False + } + if population_frequency_map[csq_record_list[allele_index]] + population_frequency_map[csq_record_list[allele_index]].append(population_frequency) + + for key,gnomADe_column_list in gnomADe_column_map.items(): + for col in gnomADe_column_list: + population_frequency_key = col.split("_")[2] + allele_count = allele_number = allele_frequency = None + col_index = self.variant.get_info_key_index(col) + if col_index and csq_record_list[col_index]: + if population_frequency_key == "AF": + allele_frequency = csq_record_list[col_index] + elif population_frequency_key == "AN": + allele_number = csq_record_list[col_index] + elif population_frequency_key == "AC": + allele_count = csq_record_list[col_index] + else: + raise Exception('gnomAD exomes column is not recognised') + + if allele_frequency is not None: + if pop_names["gnomAD_exomes"][key] not in frequency_stats.keys(): + frequency_stats[pop_names["gnomAD_exomes"][key]] = {} + frequency_stats[pop_names["gnomAD_exomes"][key]][csq_record_list[allele_index]] = allele_frequency + population_frequency = { + "population": pop_names["gnomAD_exomes"][key], + "allele_frequency": allele_frequency, + "allele_count": allele_count, + "allele_number": allele_number, + "is_minor_allele": False, + "is_hpmaf": False + } + population_frequency_map[csq_record_list[allele_index]].append(population_frequency) + + for key,gnomADg_column_list in gnomADg_column_map.items(): + for col in gnomADg_column_list: + allele_count = allele_number = allele_frequency = None + population_frequency_key = col.split("_")[2] + col_index = self.variant.get_info_key_index(col) + if col_index is not None: + if population_frequency_key == "AF": + allele_frequency = csq_record_list[col_index] or None + elif population_frequency_key == "AN": + allele_number = csq_record_list[col_index] or None + elif population_frequency_key == "AC": + allele_count = csq_record_list[col_index] or None + else: + raise Exception('gnomAD genomes column is not recognised') + if allele_frequency is not None: + if pop_names["gnomAD_genomes"][key] not in frequency_stats.keys(): + frequency_stats[pop_names["gnomAD_genomes"][key]] = {} + frequency_stats[pop_names["gnomAD_genomes"][key]][csq_record_list[allele_index]] = allele_frequency + population_frequency = { + "population": pop_names["gnomAD_genomes"][key], + "allele_frequency": allele_frequency, + "allele_count": allele_count, + "allele_number": allele_number, + "is_minor_allele": False, + "is_hpmaf": False + } + population_frequency_map[csq_record_list[allele_index]].append(population_frequency) + print(frequency_stats) + return population_frequency_map + def create_allele_prediction_results(self, current_prediction_results: Mapping, csq_record: List, prediction_index_map: dict) -> list: prediction_results = [] if "cadd_phred" in prediction_index_map.keys(): @@ -220,29 +345,29 @@ def minimise_allele(self, alt: str): minimised_allele = "-" return minimised_allele - def format_frequency(self, raw_frequency_list: List) -> Mapping: - freq_map = {} - for freq in raw_frequency_list: - key = freq.split(":")[0] - freq_list = freq.split(":")[1].split(",") - freq_map[key] = freq_list - return freq_map + # def format_frequency(self, raw_frequency_list: List) -> Mapping: + # freq_map = {} + # for freq in raw_frequency_list: + # key = freq.split(":")[0] + # freq_list = freq.split(":")[1].split(",") + # freq_map[key] = freq_list + # return freq_map - def get_population_allele_frequencies(self) -> List: - frequency_map = {} - if "FREQ" in self.variant.info: - frequency_map = self.format_frequency(",".join(map(str,self.variant.info["FREQ"])).split("|")) - population_allele_frequencies = [] - for key, pop_list in frequency_map.items(): - ## Adding only GnomAD population - if key == "GnomAD": - if pop_list[self.allele_index] not in ["None", "."]: - population_allele_frequencies.append({ - "population": key, - "allele_frequency": pop_list[self.allele_index], - "is_minor_allele": False, - "is_hpmaf": False - }) - return population_allele_frequencies + # def get_population_allele_frequencies(self) -> List: + # frequency_map = {} + # if "FREQ" in self.variant.info: + # frequency_map = self.format_frequency(",".join(map(str,self.variant.info["FREQ"])).split("|")) + # population_allele_frequencies = [] + # for key, pop_list in frequency_map.items(): + # ## Adding only GnomAD population + # if key == "GnomAD": + # if pop_list[self.allele_index] not in ["None", "."]: + # population_allele_frequencies.append({ + # "population": key, + # "allele_frequency": pop_list[self.allele_index], + # "is_minor_allele": False, + # "is_hpmaf": False + # }) + # return population_allele_frequencies diff --git a/common/schemas/population_allele_frequency.graphql b/common/schemas/population_allele_frequency.graphql index 0d01607..1cad2d6 100644 --- a/common/schemas/population_allele_frequency.graphql +++ b/common/schemas/population_allele_frequency.graphql @@ -2,8 +2,10 @@ type PopulationAlleleFrequency{ """ Population Allele Frequency """ - population: String - allele_frequency: Float - is_minor_allele: Boolean - is_hpmaf: Boolean + population: String! + allele_frequency: Float! + allele_count: Int + allele_number: Int + is_minor_allele: Boolean! + is_hpmaf: Boolean! } \ No newline at end of file From ae26a089db5c0dcfcf6a752c76915e0cd30c8177 Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Wed, 17 Jan 2024 13:50:56 +0000 Subject: [PATCH 02/29] Logic to compute ref allele frequency, maf, hpmaf --- common/file_model/populations.json | 65 +++++----- common/file_model/variant.py | 122 ++++++++++++++---- common/file_model/variant_allele.py | 189 +++++++--------------------- 3 files changed, 169 insertions(+), 207 deletions(-) diff --git a/common/file_model/populations.json b/common/file_model/populations.json index 752a009..ad93467 100644 --- a/common/file_model/populations.json +++ b/common/file_model/populations.json @@ -1,35 +1,34 @@ { - "1000_genomes": { - "AF": "1000GENOMES:phase_3:ALL", - "AFR_AF": "1000GENOMES:phase_3:AFR", - "AMR_AF": "1000GENOMES:phase_3:AMR", - "EAS_AF": "1000GENOMES:phase_3:EAS", - "EUR_AF": "1000GENOMES:phase_3:EUR", - "SAS_AF": "1000GENOMES:phase_3:SAS" - }, - "gnomAD_exomes": { - "ALL": "gnomADe:ALL", - "afr": "gnomADe:afr", - "amr": "gnomADe:amr", - "asj": "gnomADe:asj", - "eas": "gnomADe:eas", - "fin": "gnomADe:fin", - "nfe": "gnomADe:nfe", - "oth": "gnomADe:oth", - "sas": "gnomADe:sas" - }, - "gnomAD_genomes": { - "ALL": "gnomADg:ALL", - "afr": "gnomADg:afr", - "ami": "gnomADg:ami", - "amr": "gnomADg:amr", - "asj": "gnomADg:asj", - "eas": "gnomADg:eas", - "fin": "gnomADg:fin", - "mid": "gnomADg:mid", - "nfe": "gnomADg:nfe", - "oth": "gnomADg:oth", - "sas": "gnomADg:sas" - - } + "1000_genomes": [ + {"name": "1000GENOMES:phase_3:ALL", "frequencies": {"af": "AF"}}, + {"name": "1000GENOMES:phase_3:AFR", "frequencies": {"af": "AFR_AF"}}, + {"name": "1000GENOMES:phase_3:AMR", "frequencies": {"af": "AMR_AF"}}, + {"name": "1000GENOMES:phase_3:EAS", "frequencies": {"af": "EAS_AF"}}, + {"name": "1000GENOMES:phase_3:EUR", "frequencies": {"af": "EUR_AF"}}, + {"name": "1000GENOMES:phase_3:SAS", "frequencies": {"af": "SAS_AF" }} + ], + "gnomAD_exomes": [ + {"name": "gnomADe:ALL", "frequencies": {"af": "gnomAD_exomes_AF", "ac": "gnomAD_exomes_AC", "an": "gnomAD_exomes_AN"}}, + {"name": "gnomADe:afr", "frequencies": {"af": "gnomAD_exomes_AF_afr", "ac": "gnomAD_exomes_AC_afr", "an": "gnomAD_exomes_AN_afr"}}, + {"name": "gnomADe:amr", "frequencies": {"af": "gnomAD_exomes_AF_amr", "ac": "gnomAD_exomes_AC_amr", "an": "gnomAD_exomes_AN_amr"}}, + {"name": "gnomADe:asj", "frequencies": {"af": "gnomAD_exomes_AF_asj", "ac": "gnomAD_exomes_AC_asj", "an": "gnomAD_exomes_AN_asj"}}, + {"name": "gnomADe:eas", "frequencies": {"af": "gnomAD_exomes_AF_eas", "ac": "gnomAD_exomes_AC_eas", "an": "gnomAD_exomes_AN_eas"}}, + {"name": "gnomADe:fin", "frequencies": {"af": "gnomAD_exomes_AF_fin", "ac": "gnomAD_exomes_AC_fin", "an": "gnomAD_exomes_AN_fin"}}, + {"name": "gnomADe:nfe", "frequencies": {"af": "gnomAD_exomes_AF_nfe", "ac": "gnomAD_exomes_AC_nfe", "an": "gnomAD_exomes_AN_nfe"}}, + {"name": "gnomADe:oth", "frequencies": {"af": "gnomAD_exomes_AF_oth", "ac": "gnomAD_exomes_AC_oth", "an": "gnomAD_exomes_AN_oth"}}, + {"name": "gnomADe:sas", "frequencies": {"af": "gnomAD_exomes_AF_sas", "ac": "gnomAD_exomes_AC_sas", "an": "gnomAD_exomes_AN_sas"}} + ], + "gnomAD_genomes": [ + {"name": "gnomADg:ALL", "frequencies": {"af": "gnomAD_genomes_AF", "ac": "gnomAD_genomes_AC", "an": "gnomAD_genomes_AN"}}, + {"name": "gnomADg:afr", "frequencies": {"af": "gnomAD_genomes_AF_afr", "ac": "gnomAD_genomes_AC_afr", "an": "gnomAD_genomes_AN_afr"}}, + {"name": "gnomADg:ami", "frequencies": {"af": "gnomAD_genomes_AF_ami", "ac": "gnomAD_genomes_AC_ami", "an": "gnomAD_genomes_AN_ami"}}, + {"name": "gnomADg:amr", "frequencies": {"af": "gnomAD_genomes_AF_amr", "ac": "gnomAD_genomes_AC_amr", "an": "gnomAD_genomes_AN_amr"}}, + {"name": "gnomADg:asj", "frequencies": {"af": "gnomAD_genomes_AF_asj", "ac": "gnomAD_genomes_AC_asj", "an": "gnomAD_genomes_AN_asj"}}, + {"name": "gnomADg:eas", "frequencies": {"af": "gnomAD_genomes_AF_eas", "ac": "gnomAD_genomes_AC_eas", "an": "gnomAD_genomes_AN_eas"}}, + {"name": "gnomADg:fin", "frequencies": {"af": "gnomAD_genomes_AF_fin", "ac": "gnomAD_genomes_AC_fin", "an": "gnomAD_genomes_AN_fin"}}, + {"name": "gnomADg:mid", "frequencies": {"af": "gnomAD_genomes_AF_mid", "ac": "gnomAD_genomes_AC_mid", "an": "gnomAD_genomes_AN_mid"}}, + {"name": "gnomADg:nfe", "frequencies": {"af": "gnomAD_genomes_AF_nfe", "ac": "gnomAD_genomes_AC_nfe", "an": "gnomAD_genomes_AN_nfe"}}, + {"name": "gnomADg:oth", "frequencies": {"af": "gnomAD_genomes_AF_oth", "ac": "gnomAD_genomes_AC_oth", "an": "gnomAD_genomes_AN_oth"}}, + {"name": "gnomADg:sas", "frequencies": {"af": "gnomAD_genomes_AF_sas", "ac": "gnomAD_genomes_AC_sas", "an": "gnomAD_genomes_AN_sas"}} + ] } diff --git a/common/file_model/variant.py b/common/file_model/variant.py index ab95e25..2966a3f 100644 --- a/common/file_model/variant.py +++ b/common/file_model/variant.py @@ -27,6 +27,7 @@ def __init__(self, record: Any, header: Any) -> None: self.info = record.INFO self.type = "Variant" self.vep_version = re.search("v\d+", self.header.get_lines("VEP")[0].value).group() + self.population_map = {} def get_alternative_names(self) -> List: return [] @@ -196,7 +197,7 @@ def get_most_severe_consequence(self) -> Mapping: csq_record_list = csq_record.split("|") for cons in csq_record_list[consequence_index].split("&"): rank = consequence_rank[cons] - consequence_map[rank] = cons + consequence_map[int(rank)] = cons return{ "result": consequence_map[min(consequence_map.keys())] , "analysis_method": { @@ -240,34 +241,101 @@ def get_info_key_index(self, key: str, info_id: str ="CSQ") -> int: for index, value in enumerate(csq_list): if value == key: return index + + def traverse_population_info(self) -> Mapping: + directory = os.path.dirname(__file__) + with open(os.path.join(directory,'populations.json')) as pop_file: + pop_mapping = json.load(pop_file) + population_frequency_map = {} + for csq_record in self.info["CSQ"]: + csq_record_list = csq_record.split("|") + allele_index = self.get_info_key_index("Allele") + if csq_record_list[allele_index] is not None: + if csq_record_list[allele_index] not in population_frequency_map.keys(): + population_frequency_map[csq_record_list[allele_index]] = {} + for pop_key, pop in pop_mapping.items(): + for sub_pop in pop: + if sub_pop["name"] in population_frequency_map[csq_record_list[allele_index]]: + continue + allele_count = allele_number = allele_frequency = None + for freq_key, freq_val in sub_pop["frequencies"].items(): + col_index = self.get_info_key_index(freq_val) + if col_index is not None and csq_record_list[col_index] is not None: + if freq_key == "af": + allele_frequency = csq_record_list[col_index] + elif freq_key == "an": + allele_number = csq_record_list[col_index] or None + elif freq_key == "ac": + allele_count = csq_record_list[col_index] or None + else: + raise Exception('Frequency metric is not recognised') + population_frequency = { + "population": sub_pop["name"], + "allele_frequency": allele_frequency or -1, + "allele_count": allele_count, + "allele_number": allele_number, + "is_minor_allele": False, + "is_hpmaf": False + } + + population_frequency_map[csq_record_list[allele_index]][sub_pop["name"]] = population_frequency + return population_frequency_map - def set_frequency_flags(self, allele_list: List): + def set_frequency_flags(self): """ - Calculates minor allele frequency by iterating through each allele - Assumption: Considers that population is only gnomAD (genomes) for now - Sets the maf as hpmaf as gnomAD is the only population at the moment + Calculates MAF (minor allele frequency) and HPMAF by iterating through each allele """ - maf_frequency = -1 - maf_index = -1 - highest_frequency = -1 - highest_frequency_index = -1 - highest_maf_frequency = -1 - highest_maf_frequency_index = -1 - maf_map = {} - for allele_index, allele in enumerate(allele_list): - if(len(allele["population_frequencies"]) > 0): - pop = allele["population_frequencies"][0] - pop_allele_frequency = float(pop["allele_frequency"]) - if ( pop_allele_frequency > maf_frequency and pop_allele_frequency < highest_frequency ): - maf_frequency = pop_allele_frequency - maf_index = allele_index - elif ( pop_allele_frequency > highest_frequency ): - maf_frequency = highest_frequency - maf_index = highest_frequency_index - highest_frequency = pop_allele_frequency - highest_frequency_index = allele_index + allele_list = self.get_alleles() + directory = os.path.dirname(__file__) + with open(os.path.join(directory,'populations.json')) as pop_file: + pop_mapping = json.load(pop_file) + pop_names = [] + for pop in pop_mapping.values(): + pop_names.extend([sub_pop["name"] for sub_pop in pop]) + hpmaf = [] + pop_frequency_map = self.traverse_population_info() + + for pop_name in pop_names: + by_population = [] + for allele in allele_list: + if allele.minimise_allele(allele.alt) in pop_frequency_map: + pop_freqs = pop_frequency_map[allele.minimise_allele(allele.alt)].values() + # Calculate reference allele from parsed frequency info of all alleles + if allele.get_allele_type()["accession_id"] == "biological_region" and len(by_population)>0 : + allele_frequency_ref = 1 - sum(list(zip(*by_population))[0]) + if allele_frequency_ref <= 1 and allele_frequency_ref >= 0: + population_frequency_ref = { + "population": pop_name, + "allele_frequency": allele_frequency_ref , + "allele_count": None, + "allele_number": None, + "is_minor_allele": False, + "is_hpmaf": False + } + minimised_allele = allele.minimise_allele(allele.alt) + if minimised_allele not in pop_frequency_map: + pop_frequency_map[minimised_allele] = {} + pop_frequency_map[minimised_allele][pop_name] = population_frequency_ref + by_population.append([allele_frequency_ref,minimised_allele,pop_name]) + + else: + for pop_freq in pop_freqs: + if pop_name == pop_freq["population"] and float(pop_freq["allele_frequency"]) > -1: + minimised_allele = allele.minimise_allele(allele.alt) + by_population.append([float(pop_freq["allele_frequency"]),minimised_allele, pop_name]) + + + + by_population_sorted = sorted(by_population, key=lambda item: item[0]) + if len(by_population_sorted) >= 2: + maf_frequency, maf_allele, maf_population = by_population_sorted[-2] + pop_frequency_map[maf_allele][maf_population]["is_minor_allele"] = True + hpmaf.append([maf_frequency,maf_allele,maf_population]) + if len(hpmaf) > 0: + hpmaf_sorted = sorted(hpmaf, key=lambda item: item[0]) + _, hpmaf_allele, hpmaf_population = hpmaf_sorted[-1] + pop_frequency_map[hpmaf_allele][hpmaf_population]["is_hpmaf"] = True + return pop_frequency_map + - if maf_frequency>=0: - allele_list[maf_index]["population_frequencies"][0]["is_minor_allele"] = True - allele_list[maf_index]["population_frequencies"][0]["is_hpmaf"] = True diff --git a/common/file_model/variant_allele.py b/common/file_model/variant_allele.py index e4f9fd6..a414e69 100644 --- a/common/file_model/variant_allele.py +++ b/common/file_model/variant_allele.py @@ -15,6 +15,7 @@ def __init__(self, allele_index: str, alt: str, variant:dict) -> None: self.type = "VariantAllele" self.allele_sequence = alt self.reference_sequence = variant.ref + self.population_map = [] self.info_map = self.traverse_csq_info() def get_allele_type(self): @@ -43,9 +44,9 @@ def get_prediction_results(self): def get_population_allele_frequencies(self): min_alt = self.minimise_allele(self.alt) - print("Hi") - population_map = self.traverse_population_info() - return population_map[min_alt] if min_alt in population_map else [] + population_map = self.variant.set_frequency_flags() + return population_map[min_alt].values() if min_alt in population_map else [] + def traverse_csq_info(self) -> Mapping: """ @@ -76,125 +77,45 @@ def traverse_csq_info(self) -> Mapping: info_map[csq_record_list[prediction_index_map["allele"]]]["prediction_results"] += self.create_allele_prediction_results(current_prediction_results, csq_record_list, prediction_index_map) return info_map - def traverse_population_info(self) -> Mapping: - directory = os.path.dirname(__file__) - with open(os.path.join(directory,'populations.json')) as pop_file: - pop_names = json.load(pop_file) - - kg_column_list = ["AF","AFR_AF","AMR_AF","EAS_AF","EUR_AF","SAS_AF"] - - gnomADe_column_map = { - "ALL": ["gnomAD_exomes_AF","gnomAD_exomes_AC","gnomAD_exomes_AN"], - "afr": ["gnomAD_exomes_AF_afr","gnomAD_exomes_AC_afr","gnomAD_exomes_AN_afr"], - "amr": ["gnomAD_exomes_AF_amr","gnomAD_exomes_AC_amr","gnomAD_exomes_AN_amr"], - "asj": ["gnomAD_exomes_AF_asj","gnomAD_exomes_AC_asj","gnomAD_exomes_AN_asj"], - "eas": ["gnomAD_exomes_AF_eas","gnomAD_exomes_AC_eas","gnomAD_exomes_AN_eas"], - "fin": ["gnomAD_exomes_AF_fin","gnomAD_exomes_AC_fin","gnomAD_exomes_AN_fin"], - "nfe": ["gnomAD_exomes_AF_nfe","gnomAD_exomes_AC_nfe","gnomAD_exomes_AN_nfe"], - "oth": ["gnomAD_exomes_AF_oth","gnomAD_exomes_AC_oth","gnomAD_exomes_AN_oth"], - "sas": ["gnomAD_exomes_AF_sas","gnomAD_exomes_AC_sas","gnomAD_exomes_AN_sas"] - } - - gnomADg_column_map = { - "ALL": ["gnomAD_genomes_AF","gnomAD_genomes_AC","gnomAD_genomes_AN"], - "afr": ["gnomAD_genomes_AF_afr","gnomAD_genomes_AC_afr","gnomAD_genomes_AN_afr"], - "ami": ["gnomAD_genomes_AF_ami","gnomAD_genomes_AC_ami","gnomAD_genomes_AN_ami"], - "amr": ["gnomAD_genomes_AF_amr","gnomAD_genomes_AC_amr","gnomAD_genomes_AN_amr"], - "asj": ["gnomAD_genomes_AF_asj","gnomAD_genomes_AC_asj","gnomAD_genomes_AN_asj"], - "eas": ["gnomAD_genomes_AF_eas","gnomAD_genomes_AC_eas,gnomAD_genomes_AN_eas"], - "fin": ["gnomAD_genomes_AF_fin","gnomAD_genomes_AC_fin","gnomAD_genomes_AN_fin"], - "mid": ["gnomAD_genomes_AF_mid","gnomAD_genomes_AC_mid","gnomAD_genomes_AN_mid"], - "nfe": ["gnomAD_genomes_AF_nfe","gnomAD_genomes_AC_nfe","gnomAD_genomes_AN_nfe"], - "oth": ["gnomAD_genomes_AF_oth","gnomAD_genomes_AC_oth","gnomAD_genomes_AN_oth"], - "sas": ["gnomAD_genomes_AF_sas","gnomAD_genomes_AC_sas","gnomAD_genomes_AN_sas"] - } - - population_frequency_map = {} - frequency_stats = {} - - for csq_record in self.variant.info["CSQ"]: - csq_record_list = csq_record.split("|") - allele_index = self.variant.get_info_key_index("Allele") - if allele_index is not None and csq_record_list[allele_index] is not None: - if csq_record_list[allele_index] not in population_frequency_map.keys(): - population_frequency_map[csq_record_list[allele_index]] = [] - for col in kg_column_list: - col_index = self.variant.get_info_key_index(col) - if col_index is not None and csq_record_list[col_index] is not None: - if pop_names[col] not in frequency_stats.keys(): - frequency_stats[pop_names[col]] = {} - frequency_stats[pop_names[col]][csq_record_list[allele_index]] = csq_record_list[col_index] - print(csq_record_list[col_index]) - if csq_record_list[col_index]: - print(csq_record_list[col_index]) - population_frequency = { - "population": pop_names[col], - "allele_frequency": csq_record_list[col_index], - "is_minor_allele": False, - "is_hpmaf": False - } - if population_frequency_map[csq_record_list[allele_index]] - population_frequency_map[csq_record_list[allele_index]].append(population_frequency) - - for key,gnomADe_column_list in gnomADe_column_map.items(): - for col in gnomADe_column_list: - population_frequency_key = col.split("_")[2] - allele_count = allele_number = allele_frequency = None - col_index = self.variant.get_info_key_index(col) - if col_index and csq_record_list[col_index]: - if population_frequency_key == "AF": - allele_frequency = csq_record_list[col_index] - elif population_frequency_key == "AN": - allele_number = csq_record_list[col_index] - elif population_frequency_key == "AC": - allele_count = csq_record_list[col_index] - else: - raise Exception('gnomAD exomes column is not recognised') + # def traverse_population_info(self) -> Mapping: + # directory = os.path.dirname(__file__) + # with open(os.path.join(directory,'populations.json')) as pop_file: + # pop_mapping = json.load(pop_file) + # population_frequency_map = {} + # for csq_record in self.variant.info["CSQ"]: + # csq_record_list = csq_record.split("|") + # allele_index = self.variant.get_info_key_index("Allele") + # if csq_record_list[allele_index] is not None: + # if csq_record_list[allele_index] not in population_frequency_map.keys(): + # population_frequency_map[csq_record_list[allele_index]] = {} + # for pop_key, pop in pop_mapping.items(): + # for sub_pop in pop: + # if sub_pop["name"] in population_frequency_map[csq_record_list[allele_index]]: + # continue + # allele_count = allele_number = allele_frequency = None + # for freq_key, freq_val in sub_pop["frequencies"].items(): + # col_index = self.variant.get_info_key_index(freq_val) + # if col_index is not None and csq_record_list[col_index] is not None: + # if freq_key == "af": + # allele_frequency = csq_record_list[col_index] + # elif freq_key == "an": + # allele_number = csq_record_list[col_index] or None + # elif freq_key == "ac": + # allele_count = csq_record_list[col_index] or None + # else: + # raise Exception('Frequency metric is not recognised') + # population_frequency = { + # "population": sub_pop["name"], + # "allele_frequency": allele_frequency or -1, + # "allele_count": allele_count, + # "allele_number": allele_number, + # "is_minor_allele": False, + # "is_hpmaf": False + # } - if allele_frequency is not None: - if pop_names["gnomAD_exomes"][key] not in frequency_stats.keys(): - frequency_stats[pop_names["gnomAD_exomes"][key]] = {} - frequency_stats[pop_names["gnomAD_exomes"][key]][csq_record_list[allele_index]] = allele_frequency - population_frequency = { - "population": pop_names["gnomAD_exomes"][key], - "allele_frequency": allele_frequency, - "allele_count": allele_count, - "allele_number": allele_number, - "is_minor_allele": False, - "is_hpmaf": False - } - population_frequency_map[csq_record_list[allele_index]].append(population_frequency) - - for key,gnomADg_column_list in gnomADg_column_map.items(): - for col in gnomADg_column_list: - allele_count = allele_number = allele_frequency = None - population_frequency_key = col.split("_")[2] - col_index = self.variant.get_info_key_index(col) - if col_index is not None: - if population_frequency_key == "AF": - allele_frequency = csq_record_list[col_index] or None - elif population_frequency_key == "AN": - allele_number = csq_record_list[col_index] or None - elif population_frequency_key == "AC": - allele_count = csq_record_list[col_index] or None - else: - raise Exception('gnomAD genomes column is not recognised') + # population_frequency_map[csq_record_list[allele_index]][sub_pop["name"]] = population_frequency + # return population_frequency_map - if allele_frequency is not None: - if pop_names["gnomAD_genomes"][key] not in frequency_stats.keys(): - frequency_stats[pop_names["gnomAD_genomes"][key]] = {} - frequency_stats[pop_names["gnomAD_genomes"][key]][csq_record_list[allele_index]] = allele_frequency - population_frequency = { - "population": pop_names["gnomAD_genomes"][key], - "allele_frequency": allele_frequency, - "allele_count": allele_count, - "allele_number": allele_number, - "is_minor_allele": False, - "is_hpmaf": False - } - population_frequency_map[csq_record_list[allele_index]].append(population_frequency) - print(frequency_stats) - return population_frequency_map def create_allele_prediction_results(self, current_prediction_results: Mapping, csq_record: List, prediction_index_map: dict) -> list: prediction_results = [] @@ -344,30 +265,4 @@ def minimise_allele(self, alt: str): elif len(alt) < len(self.variant.ref): minimised_allele = "-" return minimised_allele - - # def format_frequency(self, raw_frequency_list: List) -> Mapping: - # freq_map = {} - # for freq in raw_frequency_list: - # key = freq.split(":")[0] - # freq_list = freq.split(":")[1].split(",") - # freq_map[key] = freq_list - # return freq_map - - # def get_population_allele_frequencies(self) -> List: - # frequency_map = {} - # if "FREQ" in self.variant.info: - # frequency_map = self.format_frequency(",".join(map(str,self.variant.info["FREQ"])).split("|")) - # population_allele_frequencies = [] - # for key, pop_list in frequency_map.items(): - # ## Adding only GnomAD population - # if key == "GnomAD": - # if pop_list[self.allele_index] not in ["None", "."]: - # population_allele_frequencies.append({ - # "population": key, - # "allele_frequency": pop_list[self.allele_index], - # "is_minor_allele": False, - # "is_hpmaf": False - # }) - # return population_allele_frequencies - - + \ No newline at end of file From 6a384ac4673c0a391a0c233777da92eea29204ac Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Tue, 23 Jan 2024 11:06:52 +0000 Subject: [PATCH 03/29] Added endpoint to return population object --- common/file_model/population_metadata.json | 485 ++++++++++++++++++ common/file_model/variant.py | 6 +- .../population_allele_frequency.graphql | 2 +- graphql_service/resolver/variant_model.py | 11 +- 4 files changed, 499 insertions(+), 5 deletions(-) create mode 100644 common/file_model/population_metadata.json diff --git a/common/file_model/population_metadata.json b/common/file_model/population_metadata.json new file mode 100644 index 0000000..b31a2fd --- /dev/null +++ b/common/file_model/population_metadata.json @@ -0,0 +1,485 @@ +{ + "a7335667-93e7-11ec-a39d-005056b38ce3": + [ + { + "name": "1000GENOMES:phase_3:ALL", + "description": "All phase 3 individuals", + "type": "regional", + "is_global": "True", + "super_population": null, + "sub_populations": [ + { + "name": "1000GENOMES:phase_3:AFR" + }, + { + "name": "1000GENOMES:phase_3:AMR" + }, + { + "name": "1000GENOMES:phase_3:EAS" + }, + { + "name": "1000GENOMES:phase_3:EUR" + }, + { + "name": "1000GENOMES:phase_3:SAS" + } + ] + }, + { + "name": "1000GENOMES:phase_3:AFR", + "description": "African", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:ALL" + }, + "sub_populations": [ + { + "name": "1000GENOMES:phase_3:ACB" + }, + { + "name": "1000GENOMES:phase_3:ASW" + }, + { + "name": "1000GENOMES:phase_3:ESN" + }, + { + "name": "1000GENOMES:phase_3:GWD" + }, + { + "name": "1000GENOMES:phase_3:LWK" + }, + { + "name": "1000GENOMES:phase_3:MSL" + } + ] + }, + { + "name": "1000GENOMES:phase_3:AMR", + "description": "American", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:ALL" + }, + "sub_populations": [ + { + "name": "1000GENOMES:phase_3:CLM" + }, + { + "name": "1000GENOMES:phase_3:MXL" + }, + { + "name": "1000GENOMES:phase_3:PEL" + }, + { + "name": "1000GENOMES:phase_3:PUR" + } + ] + }, + { + "name": "1000GENOMES:phase_3:EAS", + "description": "East Asian", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:ALL" + }, + "sub_populations": [ + { + "name": "1000GENOMES:phase_3:CDX" + }, + { + "name": "1000GENOMES:phase_3:CHB" + }, + { + "name": "1000GENOMES:phase_3:CHS" + }, + { + "name": "1000GENOMES:phase_3:JPT" + }, + { + "name": "1000GENOMES:phase_3:KHV" + } + ] + }, + { + "name": "1000GENOMES:phase_3:EUR", + "description": "European", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:ALL" + }, + "sub_populations": [ + { + "name": "1000GENOMES:phase_3:CEU" + }, + { + "name": "1000GENOMES:phase_3:FIN" + }, + { + "name": "1000GENOMES:phase_3:GBR" + }, + { + "name": "1000GENOMES:phase_3:IBS" + }, + { + "name": "1000GENOMES:phase_3:TSI" + } + ] + }, + { + "name": "1000GENOMES:phase_3:SAS", + "description": "South Asian", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:ALL" + }, + "sub_populations": [ + { + "name": "1000GENOMES:phase_3:BEB" + }, + { + "name": "1000GENOMES:phase_3:GIH" + }, + { + "name": "1000GENOMES:phase_3:ITU" + }, + { + "name": "1000GENOMES:phase_3:PJL" + }, + { + "name": "1000GENOMES:phase_3:STU" + } + ] + }, + { + "name": "1000GENOMES:phase_3:ACB", + "description": "African Caribbean in Barbados", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:AFR" + }, + "sub_populations": [ + ] + }, + { + "name": "1000GENOMES:phase_3:ASW", + "description": "African Ancestry in Southwest US", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:AFR" + }, + "sub_populations": [ + + ] + }, + { + "name": "1000GENOMES:phase_3:ESN", + "description": "Esan in Nigeria", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:AFR" + }, + "sub_populations": [ + + ] + }, + { + "name": "1000GENOMES:phase_3:GWD", + "description": "Gambian in Western Division, The Gambia", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:AFR" + }, + "sub_populations": [ + + ] + }, + { + "name": "1000GENOMES:phase_3:LWK", + "description": "Luhya in Webuye, Kenya", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:AFR" + }, + "sub_populations": [ + + ] + }, + { + "name": "1000GENOMES:phase_3:MSL", + "description": "Mende in Sierra Leone", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:AFR" + }, + "sub_populations": [ + + ] + }, + { + "name": "1000GENOMES:phase_3:CLM", + "description": "Colombian in Medellin, Colombia", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:AMR" + }, + "sub_populations": [ + + ] + }, + { + "name": "1000GENOMES:phase_3:MXL", + "description": "Colombian in Medellin, Colombia", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:AMR" + }, + "sub_populations": [ + + ] + }, + { + "name": "1000GENOMES:phase_3:PEL", + "description": "Peruvian in Lima, Peru", + "type": "regional", + "is_global": "True", + "super_population": { + "name": "1000GENOMES:phase_3:AMR" + }, + "sub_populations": [ + + ] + }, + { + "name": "1000GENOMES:phase_3:PUR", + "description": "Puerto Rican in Puerto Rico", + "type": "regional", + "is_global": "True", + "super_population": { + "name": "1000GENOMES:phase_3:AMR" + }, + "sub_populations": [ + + ] + }, + { + "name": "1000GENOMES:phase_3:CDX", + "description": "Chinese Dai in Xishuangbanna, China", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:EAS" + }, + "sub_populations": [ + + ] + }, + { + "name": "1000GENOMES:phase_3:CHB", + "description": "Han Chinese in Bejing, China", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:EAS" + }, + "sub_populations": [ + + ] + }, + { + "name": "1000GENOMES:phase_3:CHS", + "description": "Southern Han Chinese, China", + "type": "regional", + "is_global": "True", + "super_population": { + "name": "1000GENOMES:phase_3:EAS" + }, + "sub_populations": [ + + ] + }, + { + "name": "1000GENOMES:phase_3:JPT", + "description": "Japanese in Tokyo, Japan", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:EAS" + }, + "sub_populations": [ + + ] + }, + { + "name": "1000GENOMES:phase_3:KHV", + "description": "Kinh in Ho Chi Minh City, Vietnam", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:EAS" + }, + "sub_populations": [ + + ] + }, + { + "name": "1000GENOMES:phase_3:CEU", + "description": " Utah residents with Northern and Western European ancestry", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:EUR" + }, + "sub_populations": [ + + ] + }, + { + "name": "1000GENOMES:phase_3:FIN", + "description": "Finnish in Finland", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:EUR" + }, + "sub_populations": [ + + ] + }, + { + "name": "1000GENOMES:phase_3:GBR", + "description": "British in England and Scotland", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:EUR" + }, + "sub_populations": [ + + ] + }, + { + "name": "1000GENOMES:phase_3:IBS", + "description": "Iberian populations in Spain", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:EUR" + }, + "sub_populations": [ + + ] + }, + { + "name": "1000GENOMES:phase_3:TSI", + "description": "Toscani in Italy", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:EUR" + }, + "sub_populations": [ + + ] + }, + { + "name": "1000GENOMES:phase_3:BEB", + "description": "Bengali in Bangladesh", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:SAS" + }, + "sub_populations": [ + + ] + }, + { + "name": "1000GENOMES:phase_3:GIH", + "description": "Gujarati Indian in Houston, TX", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:SAS" + }, + "sub_populations": [ + + ] + }, + { + "name": "1000GENOMES:phase_3:ITU", + "description": "Indian Telugu in the UK", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:SAS" + }, + "sub_populations": [ + + ] + }, + { + "name": "1000GENOMES:phase_3:PJL", + "description": "Punjabi in Lahore, Pakistan", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:SAS" + }, + "sub_populations": [ + + ] + }, + { + "name": "1000GENOMES:phase_3:STU", + "description": "Sri Lankan Tamil in the UK", + "type": "regional", + "is_global": "True", + "super_population": + { + "name": "1000GENOMES:phase_3:SAS" + }, + "sub_populations": [ + + ] + } + ] +} \ No newline at end of file diff --git a/common/file_model/variant.py b/common/file_model/variant.py index 2966a3f..a77b665 100644 --- a/common/file_model/variant.py +++ b/common/file_model/variant.py @@ -270,7 +270,7 @@ def traverse_population_info(self) -> Mapping: else: raise Exception('Frequency metric is not recognised') population_frequency = { - "population": sub_pop["name"], + "population_name": sub_pop["name"], "allele_frequency": allele_frequency or -1, "allele_count": allele_count, "allele_number": allele_number, @@ -305,7 +305,7 @@ def set_frequency_flags(self): allele_frequency_ref = 1 - sum(list(zip(*by_population))[0]) if allele_frequency_ref <= 1 and allele_frequency_ref >= 0: population_frequency_ref = { - "population": pop_name, + "population_name": pop_name, "allele_frequency": allele_frequency_ref , "allele_count": None, "allele_number": None, @@ -320,7 +320,7 @@ def set_frequency_flags(self): else: for pop_freq in pop_freqs: - if pop_name == pop_freq["population"] and float(pop_freq["allele_frequency"]) > -1: + if pop_name == pop_freq["population_name"] and float(pop_freq["allele_frequency"]) > -1: minimised_allele = allele.minimise_allele(allele.alt) by_population.append([float(pop_freq["allele_frequency"]),minimised_allele, pop_name]) diff --git a/common/schemas/population_allele_frequency.graphql b/common/schemas/population_allele_frequency.graphql index 1cad2d6..f3f2d53 100644 --- a/common/schemas/population_allele_frequency.graphql +++ b/common/schemas/population_allele_frequency.graphql @@ -2,7 +2,7 @@ type PopulationAlleleFrequency{ """ Population Allele Frequency """ - population: String! + population_name: String! allele_frequency: Float! allele_count: Int allele_number: Int diff --git a/graphql_service/resolver/variant_model.py b/graphql_service/resolver/variant_model.py index 17fb428..3da595c 100644 --- a/graphql_service/resolver/variant_model.py +++ b/graphql_service/resolver/variant_model.py @@ -13,10 +13,11 @@ """ from typing import Dict, Optional, List, Any -import json +import json, os from ariadne import QueryType, ObjectType from graphql import GraphQLResolveInfo import subprocess +import json from graphql_service.resolver.exceptions import ( VariantNotFoundError @@ -161,3 +162,11 @@ def resolve_api( ): # the second argument must be named `info` to avoid a NameError return {"api": {"major": "0", "minor": "1", "patch": "0-beta"}} + +@QUERY_TYPE.field("population") +def resolve_population(_: None, info: GraphQLResolveInfo, genome_id: str = None) -> List: + current_directory = os.path.dirname(__file__) + population_metadata_file = f"{current_directory}/../../common/file_model/population_metadata.json" + with open(population_metadata_file) as pop_file: + population_metadata = json.load(pop_file) + return population_metadata[genome_id] \ No newline at end of file From eae1b9a07a0788bd348b9c318114344c8a5630c7 Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Tue, 23 Jan 2024 14:58:36 +0000 Subject: [PATCH 04/29] Adding Population schema --- common/schemas/population.graphql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 common/schemas/population.graphql diff --git a/common/schemas/population.graphql b/common/schemas/population.graphql new file mode 100644 index 0000000..4bbbd2d --- /dev/null +++ b/common/schemas/population.graphql @@ -0,0 +1,14 @@ +type Population{ +""" + Population +""" + name: String! + size: Int! + description: String! + type: String + is_global: Boolean + is_from_genotypes: Boolean + display_group_name: String + super_population: Population + sub_populations: [Population] +} \ No newline at end of file From 0247d132ab9f8e509feda8912d3b2ca70f3175f2 Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Wed, 24 Jan 2024 10:31:47 +0000 Subject: [PATCH 05/29] Fixed a bug in population frequencies --- common/file_model/variant.py | 36 ++++++++++++++++++------------------ common/schemas/query.graphql | 1 + 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/common/file_model/variant.py b/common/file_model/variant.py index a77b665..a866fcf 100644 --- a/common/file_model/variant.py +++ b/common/file_model/variant.py @@ -260,25 +260,25 @@ def traverse_population_info(self) -> Mapping: allele_count = allele_number = allele_frequency = None for freq_key, freq_val in sub_pop["frequencies"].items(): col_index = self.get_info_key_index(freq_val) - if col_index is not None and csq_record_list[col_index] is not None: - if freq_key == "af": - allele_frequency = csq_record_list[col_index] - elif freq_key == "an": - allele_number = csq_record_list[col_index] or None - elif freq_key == "ac": - allele_count = csq_record_list[col_index] or None - else: - raise Exception('Frequency metric is not recognised') - population_frequency = { - "population_name": sub_pop["name"], - "allele_frequency": allele_frequency or -1, - "allele_count": allele_count, - "allele_number": allele_number, - "is_minor_allele": False, - "is_hpmaf": False - } + if col_index and csq_record_list[col_index] is not None: + if freq_key == "af": + allele_frequency = csq_record_list[col_index] + elif freq_key == "an": + allele_number = csq_record_list[col_index] or None + elif freq_key == "ac": + allele_count = csq_record_list[col_index] or None + else: + raise Exception('Frequency metric is not recognised') + population_frequency = { + "population_name": sub_pop["name"], + "allele_frequency": allele_frequency or -1, + "allele_count": allele_count, + "allele_number": allele_number, + "is_minor_allele": False, + "is_hpmaf": False + } - population_frequency_map[csq_record_list[allele_index]][sub_pop["name"]] = population_frequency + population_frequency_map[csq_record_list[allele_index]][sub_pop["name"]] = population_frequency return population_frequency_map def set_frequency_flags(self): diff --git a/common/schemas/query.graphql b/common/schemas/query.graphql index b8ff867..ebc0a12 100644 --- a/common/schemas/query.graphql +++ b/common/schemas/query.graphql @@ -1,6 +1,7 @@ type Query { version: Version variant(by_id: IdInput): Variant + population(genome_id: String!): [Population] } input IdInput { From 6865f779f109e724b38e7eb44d3382ff475bb6e5 Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Wed, 24 Jan 2024 13:40:10 +0000 Subject: [PATCH 06/29] Making allele_frequency nullable --- common/file_model/variant.py | 4 ++-- common/schemas/population_allele_frequency.graphql | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/file_model/variant.py b/common/file_model/variant.py index a866fcf..87486e0 100644 --- a/common/file_model/variant.py +++ b/common/file_model/variant.py @@ -271,7 +271,7 @@ def traverse_population_info(self) -> Mapping: raise Exception('Frequency metric is not recognised') population_frequency = { "population_name": sub_pop["name"], - "allele_frequency": allele_frequency or -1, + "allele_frequency": allele_frequency, "allele_count": allele_count, "allele_number": allele_number, "is_minor_allele": False, @@ -320,7 +320,7 @@ def set_frequency_flags(self): else: for pop_freq in pop_freqs: - if pop_name == pop_freq["population_name"] and float(pop_freq["allele_frequency"]) > -1: + if pop_name == pop_freq["population_name"] and pop_freq["allele_frequency"] : minimised_allele = allele.minimise_allele(allele.alt) by_population.append([float(pop_freq["allele_frequency"]),minimised_allele, pop_name]) diff --git a/common/schemas/population_allele_frequency.graphql b/common/schemas/population_allele_frequency.graphql index f3f2d53..1d611d9 100644 --- a/common/schemas/population_allele_frequency.graphql +++ b/common/schemas/population_allele_frequency.graphql @@ -3,7 +3,7 @@ type PopulationAlleleFrequency{ Population Allele Frequency """ population_name: String! - allele_frequency: Float! + allele_frequency: Float allele_count: Int allele_number: Int is_minor_allele: Boolean! From 22308a17c2bfca6cbad340ef1f3f83dae34a71dc Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Wed, 24 Jan 2024 14:13:28 +0000 Subject: [PATCH 07/29] Reverting nullable allele_frequency for now --- common/file_model/variant.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/file_model/variant.py b/common/file_model/variant.py index 87486e0..a866fcf 100644 --- a/common/file_model/variant.py +++ b/common/file_model/variant.py @@ -271,7 +271,7 @@ def traverse_population_info(self) -> Mapping: raise Exception('Frequency metric is not recognised') population_frequency = { "population_name": sub_pop["name"], - "allele_frequency": allele_frequency, + "allele_frequency": allele_frequency or -1, "allele_count": allele_count, "allele_number": allele_number, "is_minor_allele": False, @@ -320,7 +320,7 @@ def set_frequency_flags(self): else: for pop_freq in pop_freqs: - if pop_name == pop_freq["population_name"] and pop_freq["allele_frequency"] : + if pop_name == pop_freq["population_name"] and float(pop_freq["allele_frequency"]) > -1: minimised_allele = allele.minimise_allele(allele.alt) by_population.append([float(pop_freq["allele_frequency"]),minimised_allele, pop_name]) From 91699ceeaab043232448c13ebfb6908f902332a3 Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Wed, 24 Jan 2024 14:17:49 +0000 Subject: [PATCH 08/29] Reverting nullable allele_frequency for now --- common/schemas/population_allele_frequency.graphql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/schemas/population_allele_frequency.graphql b/common/schemas/population_allele_frequency.graphql index 1d611d9..21bfe62 100644 --- a/common/schemas/population_allele_frequency.graphql +++ b/common/schemas/population_allele_frequency.graphql @@ -3,9 +3,9 @@ type PopulationAlleleFrequency{ Population Allele Frequency """ population_name: String! - allele_frequency: Float + allele_frequency: Float! allele_count: Int allele_number: Int is_minor_allele: Boolean! is_hpmaf: Boolean! -} \ No newline at end of file +} From 36e7723cba62928c3b101c8bd85f32800f54c560 Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Wed, 24 Jan 2024 15:23:53 +0000 Subject: [PATCH 09/29] Added population metadata for gnomadg and gnomade --- common/file_model/population_metadata.json | 380 +++++++++++++++++++-- 1 file changed, 348 insertions(+), 32 deletions(-) diff --git a/common/file_model/population_metadata.json b/common/file_model/population_metadata.json index b31a2fd..3ea3559 100644 --- a/common/file_model/population_metadata.json +++ b/common/file_model/population_metadata.json @@ -5,7 +5,7 @@ "name": "1000GENOMES:phase_3:ALL", "description": "All phase 3 individuals", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": null, "sub_populations": [ { @@ -29,7 +29,7 @@ "name": "1000GENOMES:phase_3:AFR", "description": "African", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:ALL" @@ -59,7 +59,7 @@ "name": "1000GENOMES:phase_3:AMR", "description": "American", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:ALL" @@ -83,7 +83,7 @@ "name": "1000GENOMES:phase_3:EAS", "description": "East Asian", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:ALL" @@ -110,7 +110,7 @@ "name": "1000GENOMES:phase_3:EUR", "description": "European", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:ALL" @@ -137,7 +137,7 @@ "name": "1000GENOMES:phase_3:SAS", "description": "South Asian", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:ALL" @@ -164,7 +164,7 @@ "name": "1000GENOMES:phase_3:ACB", "description": "African Caribbean in Barbados", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:AFR" @@ -176,7 +176,7 @@ "name": "1000GENOMES:phase_3:ASW", "description": "African Ancestry in Southwest US", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:AFR" @@ -189,7 +189,7 @@ "name": "1000GENOMES:phase_3:ESN", "description": "Esan in Nigeria", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:AFR" @@ -202,7 +202,7 @@ "name": "1000GENOMES:phase_3:GWD", "description": "Gambian in Western Division, The Gambia", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:AFR" @@ -215,7 +215,7 @@ "name": "1000GENOMES:phase_3:LWK", "description": "Luhya in Webuye, Kenya", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:AFR" @@ -228,7 +228,7 @@ "name": "1000GENOMES:phase_3:MSL", "description": "Mende in Sierra Leone", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:AFR" @@ -241,7 +241,7 @@ "name": "1000GENOMES:phase_3:CLM", "description": "Colombian in Medellin, Colombia", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:AMR" @@ -254,7 +254,7 @@ "name": "1000GENOMES:phase_3:MXL", "description": "Colombian in Medellin, Colombia", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:AMR" @@ -267,7 +267,7 @@ "name": "1000GENOMES:phase_3:PEL", "description": "Peruvian in Lima, Peru", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:AMR" }, @@ -279,7 +279,7 @@ "name": "1000GENOMES:phase_3:PUR", "description": "Puerto Rican in Puerto Rico", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:AMR" }, @@ -291,7 +291,7 @@ "name": "1000GENOMES:phase_3:CDX", "description": "Chinese Dai in Xishuangbanna, China", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:EAS" @@ -304,7 +304,7 @@ "name": "1000GENOMES:phase_3:CHB", "description": "Han Chinese in Bejing, China", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:EAS" @@ -317,7 +317,7 @@ "name": "1000GENOMES:phase_3:CHS", "description": "Southern Han Chinese, China", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:EAS" }, @@ -329,7 +329,7 @@ "name": "1000GENOMES:phase_3:JPT", "description": "Japanese in Tokyo, Japan", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:EAS" @@ -342,7 +342,7 @@ "name": "1000GENOMES:phase_3:KHV", "description": "Kinh in Ho Chi Minh City, Vietnam", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:EAS" @@ -355,7 +355,7 @@ "name": "1000GENOMES:phase_3:CEU", "description": " Utah residents with Northern and Western European ancestry", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:EUR" @@ -368,7 +368,7 @@ "name": "1000GENOMES:phase_3:FIN", "description": "Finnish in Finland", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:EUR" @@ -381,7 +381,7 @@ "name": "1000GENOMES:phase_3:GBR", "description": "British in England and Scotland", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:EUR" @@ -394,7 +394,7 @@ "name": "1000GENOMES:phase_3:IBS", "description": "Iberian populations in Spain", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:EUR" @@ -407,7 +407,7 @@ "name": "1000GENOMES:phase_3:TSI", "description": "Toscani in Italy", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:EUR" @@ -420,7 +420,7 @@ "name": "1000GENOMES:phase_3:BEB", "description": "Bengali in Bangladesh", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:SAS" @@ -433,7 +433,7 @@ "name": "1000GENOMES:phase_3:GIH", "description": "Gujarati Indian in Houston, TX", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:SAS" @@ -446,7 +446,7 @@ "name": "1000GENOMES:phase_3:ITU", "description": "Indian Telugu in the UK", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:SAS" @@ -459,7 +459,7 @@ "name": "1000GENOMES:phase_3:PJL", "description": "Punjabi in Lahore, Pakistan", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:SAS" @@ -472,7 +472,7 @@ "name": "1000GENOMES:phase_3:STU", "description": "Sri Lankan Tamil in the UK", "type": "regional", - "is_global": "True", + "is_global": true, "super_population": { "name": "1000GENOMES:phase_3:SAS" @@ -480,6 +480,322 @@ "sub_populations": [ ] - } + }, + { + "name": "gnomADg:ALL", + "description": "All gnomAD genomes individuals", + "type": "regional", + "is_global": true, + "super_population": + { + "name": null + }, + "sub_populations": [ + { + "name": "gnomADg:afr" + }, + { + "name": "gnomADg:ami" + }, + { + "name": "gnomADg:amr" + }, + { + "name": "gnomADg:asj" + }, + { + "name": "gnomADg:eas" + }, + { + "name": "gnomADg:fin" + }, + { + "name": "gnomADg:mid" + }, + { + "name": "gnomADg:nfe" + }, + { + "name": "gnomADg:oth" + }, + { + "name": "gnomADg:sas" + } + + ] + }, + { + "name": "gnomADg:afr", + "description": "African/African American", + "type": "regional", + "is_global": true, + "super_population": + { + "name": "gnomADg:ALL" + }, + "sub_populations": [ + + ] + }, + { + "name": "gnomADg:ami", + "description": "Amish", + "type": "regional", + "is_global": true, + "super_population": + { + "name": "gnomADg:ALL" + }, + "sub_populations": [ + + ] + }, + { + "name": "gnomADg:amr", + "description": "Latino", + "type": "regional", + "is_global": true, + "super_population": + { + "name": "gnomADg:ALL" + }, + "sub_populations": [ + + ] + }, + { + "name": "gnomADg:asj", + "description": "Ashkenazi Jewish", + "type": "regional", + "is_global": true, + "super_population": + { + "name": "gnomADg:ALL" + }, + "sub_populations": [ + + ] + }, + { + "name": "gnomADg:eas", + "description": "East Asian", + "type": "regional", + "is_global": true, + "super_population": + { + "name": "gnomADg:ALL" + }, + "sub_populations": [ + + ] + }, + { + "name": "gnomADg:fin", + "description": "Finnish", + "type": "regional", + "is_global": true, + "super_population": + { + "name": "gnomADg:ALL" + }, + "sub_populations": [ + + ] + + }, + { + "name": "gnomADg:mid", + "description": "Middle Eastern", + "type": "regional", + "is_global": true, + "super_population": + { + "name": "gnomADg:ALL" + }, + "sub_populations": [ + + ] + }, + { + "name": "gnomADg:nfe", + "description": "Non-Finnish European", + "type": "regional", + "is_global": true, + "super_population": + { + "name": "gnomADg:ALL" + }, + "sub_populations": [ + + ] + }, + { + "name": "gnomADg:oth", + "description": "Other", + "type": "regional", + "is_global": true, + "super_population": + { + "name": "gnomADg:ALL" + }, + "sub_populations": [ + + ] + }, + { + "name": "gnomADg:sas", + "description": "South Asian", + "type": "regional", + "is_global": true, + "super_population": + { + "name": "gnomADg:ALL" + }, + "sub_populations": [ + + ] + }, + { + "name": "gnomADe:ALL", + "description": "All gnomAD exomes individuals", + "type": "regional", + "is_global": true, + "super_population": + { + "name": null + }, + "sub_populations": [ + { + "name": "gnomADe:afr" + }, + { + "name": "gnomADe:amr" + }, + { + "name": "gnomADe:asj" + }, + { + "name": "gnomADe:eas" + }, + { + "name": "gnomADg:fin" + }, + { + "name": "gnomADe:nfe" + }, + { + "name": "gnomADe:oth" + }, + { + "name": "gnomADe:sas" + } + + ] + }, + { + "name": "gnomADe:afr", + "description": "African/African American", + "type": "regional", + "is_global": true, + "super_population": + { + "name": "gnomADe:ALL" + }, + "sub_populations": [ + + ] + }, + { + "name": "gnomADe:amr", + "description": "Latino", + "type": "regional", + "is_global": true, + "super_population": + { + "name": "gnomADe:ALL" + }, + "sub_populations": [ + + ] + }, + { + "name": "gnomADe:asj", + "description": "Ashkenazi Jewish", + "type": "regional", + "is_global": true, + "super_population": + { + "name": "gnomADe:ALL" + }, + "sub_populations": [ + + ] + }, + { + "name": "gnomADe:eas", + "description": "East Asian", + "type": "regional", + "is_global": true, + "super_population": + { + "name": "gnomADe:ALL" + }, + "sub_populations": [ + + ] + }, + { + "name": "gnomADe:fin", + "description": "Finnish", + "type": "regional", + "is_global": true, + "super_population": + { + "name": "gnomADe:ALL" + }, + "sub_populations": [ + + ] + + }, + { + "name": "gnomADe:nfe", + "description": "Non-Finnish European", + "type": "regional", + "is_global": true, + "super_population": + { + "name": "gnomADe:ALL" + }, + "sub_populations": [ + + ] + }, + { + "name": "gnomADe:oth", + "description": "Other", + "type": "regional", + "is_global": true, + "super_population": + { + "name": "gnomADe:ALL" + }, + "sub_populations": [ + + ] + }, + { + "name": "gnomADe:sas", + "description": "South Asian", + "type": "regional", + "is_global": true, + "super_population": + { + "name": "gnomADe:ALL" + }, + "sub_populations": [ + + ] + } ] } \ No newline at end of file From 940ccf89bb7e4b219cb9dcbf6aa3996f08b058ad Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Wed, 24 Jan 2024 15:30:22 +0000 Subject: [PATCH 10/29] Added population metadata for gnomadg and gnomade --- common/schemas/population.graphql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/schemas/population.graphql b/common/schemas/population.graphql index 4bbbd2d..62aa1b2 100644 --- a/common/schemas/population.graphql +++ b/common/schemas/population.graphql @@ -2,7 +2,7 @@ type Population{ """ Population """ - name: String! + name: String ## Requires to be nullable as super-population can be a null field size: Int! description: String! type: String From f6a2d273fa0fc48b9c53edf60dff3be9459626be Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Wed, 24 Jan 2024 13:56:16 +0000 Subject: [PATCH 11/29] Added examples for population and population_allele_frequencies --- examples/population/query.graphql | 13 + examples/population/response.json | 260 ++++++ .../query.graphql | 21 + .../reponse.json | 800 ++++++++++++++++++ 4 files changed, 1094 insertions(+) create mode 100644 examples/population/query.graphql create mode 100644 examples/population/response.json create mode 100644 examples/population_allele_frequencies/query.graphql create mode 100644 examples/population_allele_frequencies/reponse.json diff --git a/examples/population/query.graphql b/examples/population/query.graphql new file mode 100644 index 0000000..96093b9 --- /dev/null +++ b/examples/population/query.graphql @@ -0,0 +1,13 @@ +query pop_example { + population(genome_id: "a7335667-93e7-11ec-a39d-005056b38ce3") + { + + name + description + sub_populations + { + name + } + + } +} diff --git a/examples/population/response.json b/examples/population/response.json new file mode 100644 index 0000000..edb5243 --- /dev/null +++ b/examples/population/response.json @@ -0,0 +1,260 @@ +{ + "data": { + "population": [ + { + "name": "1000GENOMES:phase_3:ALL", + "description": "All phase 3 individuals", + "sub_populations": [ + { + "name": "1000GENOMES:phase_3:AFR" + }, + { + "name": "1000GENOMES:phase_3:AMR" + }, + { + "name": "1000GENOMES:phase_3:EAS" + }, + { + "name": "1000GENOMES:phase_3:EUR" + }, + { + "name": "1000GENOMES:phase_3:SAS" + } + ] + }, + { + "name": "1000GENOMES:phase_3:AFR", + "description": "African", + "sub_populations": [ + { + "name": "1000GENOMES:phase_3:ACB" + }, + { + "name": "1000GENOMES:phase_3:ASW" + }, + { + "name": "1000GENOMES:phase_3:ESN" + }, + { + "name": "1000GENOMES:phase_3:GWD" + }, + { + "name": "1000GENOMES:phase_3:LWK" + }, + { + "name": "1000GENOMES:phase_3:MSL" + } + ] + }, + { + "name": "1000GENOMES:phase_3:AMR", + "description": "American", + "sub_populations": [ + { + "name": "1000GENOMES:phase_3:CLM" + }, + { + "name": "1000GENOMES:phase_3:MXL" + }, + { + "name": "1000GENOMES:phase_3:PEL" + }, + { + "name": "1000GENOMES:phase_3:PUR" + } + ] + }, + { + "name": "1000GENOMES:phase_3:EAS", + "description": "East Asian", + "sub_populations": [ + { + "name": "1000GENOMES:phase_3:CDX" + }, + { + "name": "1000GENOMES:phase_3:CHB" + }, + { + "name": "1000GENOMES:phase_3:CHS" + }, + { + "name": "1000GENOMES:phase_3:JPT" + }, + { + "name": "1000GENOMES:phase_3:KHV" + } + ] + }, + { + "name": "1000GENOMES:phase_3:EUR", + "description": "European", + "sub_populations": [ + { + "name": "1000GENOMES:phase_3:CEU" + }, + { + "name": "1000GENOMES:phase_3:FIN" + }, + { + "name": "1000GENOMES:phase_3:GBR" + }, + { + "name": "1000GENOMES:phase_3:IBS" + }, + { + "name": "1000GENOMES:phase_3:TSI" + } + ] + }, + { + "name": "1000GENOMES:phase_3:SAS", + "description": "South Asian", + "sub_populations": [ + { + "name": "1000GENOMES:phase_3:BEB" + }, + { + "name": "1000GENOMES:phase_3:GIH" + }, + { + "name": "1000GENOMES:phase_3:ITU" + }, + { + "name": "1000GENOMES:phase_3:PJL" + }, + { + "name": "1000GENOMES:phase_3:STU" + } + ] + }, + { + "name": "1000GENOMES:phase_3:ACB", + "description": "African Caribbean in Barbados", + "sub_populations": [] + }, + { + "name": "1000GENOMES:phase_3:ASW", + "description": "African Ancestry in Southwest US", + "sub_populations": [] + }, + { + "name": "1000GENOMES:phase_3:ESN", + "description": "Esan in Nigeria", + "sub_populations": [] + }, + { + "name": "1000GENOMES:phase_3:GWD", + "description": "Gambian in Western Division, The Gambia", + "sub_populations": [] + }, + { + "name": "1000GENOMES:phase_3:LWK", + "description": "Luhya in Webuye, Kenya", + "sub_populations": [] + }, + { + "name": "1000GENOMES:phase_3:MSL", + "description": "Mende in Sierra Leone", + "sub_populations": [] + }, + { + "name": "1000GENOMES:phase_3:CLM", + "description": "Colombian in Medellin, Colombia", + "sub_populations": [] + }, + { + "name": "1000GENOMES:phase_3:MXL", + "description": "Colombian in Medellin, Colombia", + "sub_populations": [] + }, + { + "name": "1000GENOMES:phase_3:PEL", + "description": "Peruvian in Lima, Peru", + "sub_populations": [] + }, + { + "name": "1000GENOMES:phase_3:PUR", + "description": "Puerto Rican in Puerto Rico", + "sub_populations": [] + }, + { + "name": "1000GENOMES:phase_3:CDX", + "description": "Chinese Dai in Xishuangbanna, China", + "sub_populations": [] + }, + { + "name": "1000GENOMES:phase_3:CHB", + "description": "Han Chinese in Bejing, China", + "sub_populations": [] + }, + { + "name": "1000GENOMES:phase_3:CHS", + "description": "Southern Han Chinese, China", + "sub_populations": [] + }, + { + "name": "1000GENOMES:phase_3:JPT", + "description": "Japanese in Tokyo, Japan", + "sub_populations": [] + }, + { + "name": "1000GENOMES:phase_3:KHV", + "description": "Kinh in Ho Chi Minh City, Vietnam", + "sub_populations": [] + }, + { + "name": "1000GENOMES:phase_3:CEU", + "description": " Utah residents with Northern and Western European ancestry", + "sub_populations": [] + }, + { + "name": "1000GENOMES:phase_3:FIN", + "description": "Finnish in Finland", + "sub_populations": [] + }, + { + "name": "1000GENOMES:phase_3:GBR", + "description": "British in England and Scotland", + "sub_populations": [] + }, + { + "name": "1000GENOMES:phase_3:IBS", + "description": "Iberian populations in Spain", + "sub_populations": [] + }, + { + "name": "1000GENOMES:phase_3:TSI", + "description": "Toscani in Italy", + "sub_populations": [] + }, + { + "name": "1000GENOMES:phase_3:BEB", + "description": "Bengali in Bangladesh", + "sub_populations": [] + }, + { + "name": "1000GENOMES:phase_3:GIH", + "description": "Gujarati Indian in Houston, TX", + "sub_populations": [] + }, + { + "name": "1000GENOMES:phase_3:ITU", + "description": "Indian Telugu in the UK", + "sub_populations": [] + }, + { + "name": "1000GENOMES:phase_3:PJL", + "description": "Punjabi in Lahore, Pakistan", + "sub_populations": [] + }, + { + "name": "1000GENOMES:phase_3:STU", + "description": "Sri Lankan Tamil in the UK", + "sub_populations": [] + } + ] + }, + "extensions": { + "execution_time_in_seconds": 0.03 + } +} diff --git a/examples/population_allele_frequencies/query.graphql b/examples/population_allele_frequencies/query.graphql new file mode 100644 index 0000000..e4d4656 --- /dev/null +++ b/examples/population_allele_frequencies/query.graphql @@ -0,0 +1,21 @@ +query variant_example { + variant( + by_id: {genome_id: "a7335667-93e7-11ec-a39d-005056b38ce3", variant_id: "13:32379902:rs202155613"} + ) { + name + alleles + { + name + population_frequencies + { + population_name + allele_frequency + allele_number + allele_count + is_hpmaf + is_minor_allele + } + } +} +} + diff --git a/examples/population_allele_frequencies/reponse.json b/examples/population_allele_frequencies/reponse.json new file mode 100644 index 0000000..ee68991 --- /dev/null +++ b/examples/population_allele_frequencies/reponse.json @@ -0,0 +1,800 @@ +i{ + "data": { + "variant": { + "name": "rs202155613", + "alleles": [ + { + "name": "13:32379902:C:A", + "population_frequencies": [ + { + "population_name": "1000GENOMES:phase_3:ALL", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:AFR", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:AMR", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:EAS", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:EUR", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:SAS", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:ALL", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:afr", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:amr", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:asj", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:eas", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:fin", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:nfe", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:oth", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:sas", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:ALL", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:afr", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:amr", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:asj", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:eas", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:fin", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:nfe", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:oth", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:sas", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + } + ] + }, + { + "name": "13:32379902:C:G", + "population_frequencies": [ + { + "population_name": "1000GENOMES:phase_3:ALL", + "allele_frequency": 0.0002, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "1000GENOMES:phase_3:AFR", + "allele_frequency": 0, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "1000GENOMES:phase_3:AMR", + "allele_frequency": 0, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "1000GENOMES:phase_3:EAS", + "allele_frequency": 0.001, + "allele_number": null, + "allele_count": null, + "is_hpmaf": true, + "is_minor_allele": true + }, + { + "population_name": "1000GENOMES:phase_3:EUR", + "allele_frequency": 0, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "1000GENOMES:phase_3:SAS", + "allele_frequency": 0, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADe:ALL", + "allele_frequency": 0.0000401777, + "allele_number": 248894, + "allele_count": 10, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADe:afr", + "allele_frequency": 0, + "allele_number": 16104, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADe:amr", + "allele_frequency": 0, + "allele_number": 34402, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADe:asj", + "allele_frequency": 0, + "allele_number": 10010, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADe:eas", + "allele_frequency": 0.000549995, + "allele_number": 18182, + "allele_count": 10, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADe:fin", + "allele_frequency": 0, + "allele_number": 21578, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADe:nfe", + "allele_frequency": 0, + "allele_number": 112036, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADe:oth", + "allele_frequency": 0, + "allele_number": 6066, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADe:sas", + "allele_frequency": 0, + "allele_number": 30516, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADg:ALL", + "allele_frequency": 0.0000131387, + "allele_number": 152222, + "allele_count": 2, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADg:afr", + "allele_frequency": 0, + "allele_number": 41446, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADg:amr", + "allele_frequency": 0, + "allele_number": 15288, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADg:asj", + "allele_frequency": 0, + "allele_number": 3472, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADg:eas", + "allele_frequency": 0.00038432, + "allele_number": 5204, + "allele_count": 2, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADg:fin", + "allele_frequency": 0, + "allele_number": 10618, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADg:nfe", + "allele_frequency": 0, + "allele_number": 68038, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADg:oth", + "allele_frequency": 0, + "allele_number": 2092, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADg:sas", + "allele_frequency": 0, + "allele_number": 4836, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + } + ] + }, + { + "name": "13:32379902:C:T", + "population_frequencies": [ + { + "population_name": "1000GENOMES:phase_3:ALL", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:AFR", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:AMR", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:EAS", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:EUR", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:SAS", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:ALL", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:afr", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:amr", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:asj", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:eas", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:fin", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:nfe", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:oth", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:sas", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:ALL", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:afr", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:amr", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:asj", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:eas", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:fin", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:nfe", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:oth", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:sas", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + } + ] + }, + { + "name": "13:32379902:C:C", + "population_frequencies": [ + { + "population_name": "1000GENOMES:phase_3:ALL", + "allele_frequency": 0.9998, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:AFR", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:AMR", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:EAS", + "allele_frequency": 0.999, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:EUR", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:SAS", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:ALL", + "allele_frequency": 0.9999598223, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:afr", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:amr", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:asj", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:eas", + "allele_frequency": 0.999450005, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:fin", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:nfe", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:oth", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:sas", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:ALL", + "allele_frequency": 0.9999868613, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:afr", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:amr", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:asj", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:eas", + "allele_frequency": 0.99961568, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:fin", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:nfe", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:oth", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:sas", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + } + ] + } + ] + } + }, + "extensions": { + "execution_time_in_seconds": 0.58 + } +} From 31ca0f19dcb37e8702aebb6c68a482c0b32755d4 Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Wed, 24 Jan 2024 13:58:59 +0000 Subject: [PATCH 12/29] Renamed file --- .../population_allele_frequencies/{reponse.json => response.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename examples/population_allele_frequencies/{reponse.json => response.json} (100%) diff --git a/examples/population_allele_frequencies/reponse.json b/examples/population_allele_frequencies/response.json similarity index 100% rename from examples/population_allele_frequencies/reponse.json rename to examples/population_allele_frequencies/response.json From 4eb9e14f00cd9839891164b8c2dcc7bea5fd92df Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Wed, 24 Jan 2024 14:06:14 +0000 Subject: [PATCH 13/29] Minor typo --- examples/population_allele_frequencies/response.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/population_allele_frequencies/response.json b/examples/population_allele_frequencies/response.json index ee68991..d729d93 100644 --- a/examples/population_allele_frequencies/response.json +++ b/examples/population_allele_frequencies/response.json @@ -1,4 +1,4 @@ -i{ +{ "data": { "variant": { "name": "rs202155613", From e6a5f3ed0364122b7ee57903c722d48baa6725d0 Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Wed, 24 Jan 2024 15:35:09 +0000 Subject: [PATCH 14/29] Added examples for gnomADg, gnomADe --- examples/population/query.graphql | 5 + examples/population/response.json | 360 +++++++++++++++++++++++++++++- 2 files changed, 364 insertions(+), 1 deletion(-) diff --git a/examples/population/query.graphql b/examples/population/query.graphql index 96093b9..8227a3f 100644 --- a/examples/population/query.graphql +++ b/examples/population/query.graphql @@ -4,6 +4,10 @@ query pop_example { name description + is_global + super_population { + name + } sub_populations { name @@ -11,3 +15,4 @@ query pop_example { } } + diff --git a/examples/population/response.json b/examples/population/response.json index edb5243..62502ee 100644 --- a/examples/population/response.json +++ b/examples/population/response.json @@ -4,6 +4,8 @@ { "name": "1000GENOMES:phase_3:ALL", "description": "All phase 3 individuals", + "is_global": true, + "super_population": null, "sub_populations": [ { "name": "1000GENOMES:phase_3:AFR" @@ -25,6 +27,10 @@ { "name": "1000GENOMES:phase_3:AFR", "description": "African", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:ALL" + }, "sub_populations": [ { "name": "1000GENOMES:phase_3:ACB" @@ -49,6 +55,10 @@ { "name": "1000GENOMES:phase_3:AMR", "description": "American", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:ALL" + }, "sub_populations": [ { "name": "1000GENOMES:phase_3:CLM" @@ -67,6 +77,10 @@ { "name": "1000GENOMES:phase_3:EAS", "description": "East Asian", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:ALL" + }, "sub_populations": [ { "name": "1000GENOMES:phase_3:CDX" @@ -88,6 +102,10 @@ { "name": "1000GENOMES:phase_3:EUR", "description": "European", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:ALL" + }, "sub_populations": [ { "name": "1000GENOMES:phase_3:CEU" @@ -109,6 +127,10 @@ { "name": "1000GENOMES:phase_3:SAS", "description": "South Asian", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:ALL" + }, "sub_populations": [ { "name": "1000GENOMES:phase_3:BEB" @@ -130,131 +152,467 @@ { "name": "1000GENOMES:phase_3:ACB", "description": "African Caribbean in Barbados", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:AFR" + }, "sub_populations": [] }, { "name": "1000GENOMES:phase_3:ASW", "description": "African Ancestry in Southwest US", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:AFR" + }, "sub_populations": [] }, { "name": "1000GENOMES:phase_3:ESN", "description": "Esan in Nigeria", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:AFR" + }, "sub_populations": [] }, { "name": "1000GENOMES:phase_3:GWD", "description": "Gambian in Western Division, The Gambia", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:AFR" + }, "sub_populations": [] }, { "name": "1000GENOMES:phase_3:LWK", "description": "Luhya in Webuye, Kenya", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:AFR" + }, "sub_populations": [] }, { "name": "1000GENOMES:phase_3:MSL", "description": "Mende in Sierra Leone", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:AFR" + }, "sub_populations": [] }, { "name": "1000GENOMES:phase_3:CLM", "description": "Colombian in Medellin, Colombia", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:AMR" + }, "sub_populations": [] }, { "name": "1000GENOMES:phase_3:MXL", "description": "Colombian in Medellin, Colombia", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:AMR" + }, "sub_populations": [] }, { "name": "1000GENOMES:phase_3:PEL", "description": "Peruvian in Lima, Peru", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:AMR" + }, "sub_populations": [] }, { "name": "1000GENOMES:phase_3:PUR", "description": "Puerto Rican in Puerto Rico", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:AMR" + }, "sub_populations": [] }, { "name": "1000GENOMES:phase_3:CDX", "description": "Chinese Dai in Xishuangbanna, China", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:EAS" + }, "sub_populations": [] }, { "name": "1000GENOMES:phase_3:CHB", "description": "Han Chinese in Bejing, China", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:EAS" + }, "sub_populations": [] }, { "name": "1000GENOMES:phase_3:CHS", "description": "Southern Han Chinese, China", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:EAS" + }, "sub_populations": [] }, { "name": "1000GENOMES:phase_3:JPT", "description": "Japanese in Tokyo, Japan", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:EAS" + }, "sub_populations": [] }, { "name": "1000GENOMES:phase_3:KHV", "description": "Kinh in Ho Chi Minh City, Vietnam", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:EAS" + }, "sub_populations": [] }, { "name": "1000GENOMES:phase_3:CEU", "description": " Utah residents with Northern and Western European ancestry", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:EUR" + }, "sub_populations": [] }, { "name": "1000GENOMES:phase_3:FIN", "description": "Finnish in Finland", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:EUR" + }, "sub_populations": [] }, { "name": "1000GENOMES:phase_3:GBR", "description": "British in England and Scotland", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:EUR" + }, "sub_populations": [] }, { "name": "1000GENOMES:phase_3:IBS", "description": "Iberian populations in Spain", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:EUR" + }, "sub_populations": [] }, { "name": "1000GENOMES:phase_3:TSI", "description": "Toscani in Italy", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:EUR" + }, "sub_populations": [] }, { "name": "1000GENOMES:phase_3:BEB", "description": "Bengali in Bangladesh", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:SAS" + }, "sub_populations": [] }, { "name": "1000GENOMES:phase_3:GIH", "description": "Gujarati Indian in Houston, TX", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:SAS" + }, "sub_populations": [] }, { "name": "1000GENOMES:phase_3:ITU", "description": "Indian Telugu in the UK", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:SAS" + }, "sub_populations": [] }, { "name": "1000GENOMES:phase_3:PJL", "description": "Punjabi in Lahore, Pakistan", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:SAS" + }, "sub_populations": [] }, { "name": "1000GENOMES:phase_3:STU", "description": "Sri Lankan Tamil in the UK", + "is_global": true, + "super_population": { + "name": "1000GENOMES:phase_3:SAS" + }, + "sub_populations": [] + }, + { + "name": "gnomADg:ALL", + "description": "All gnomAD genomes individuals", + "is_global": true, + "super_population": { + "name": null + }, + "sub_populations": [ + { + "name": "gnomADg:afr" + }, + { + "name": "gnomADg:ami" + }, + { + "name": "gnomADg:amr" + }, + { + "name": "gnomADg:asj" + }, + { + "name": "gnomADg:eas" + }, + { + "name": "gnomADg:fin" + }, + { + "name": "gnomADg:mid" + }, + { + "name": "gnomADg:nfe" + }, + { + "name": "gnomADg:oth" + }, + { + "name": "gnomADg:sas" + } + ] + }, + { + "name": "gnomADg:afr", + "description": "African/African American", + "is_global": true, + "super_population": { + "name": "gnomADg:ALL" + }, + "sub_populations": [] + }, + { + "name": "gnomADg:ami", + "description": "Amish", + "is_global": true, + "super_population": { + "name": "gnomADg:ALL" + }, + "sub_populations": [] + }, + { + "name": "gnomADg:amr", + "description": "Latino", + "is_global": true, + "super_population": { + "name": "gnomADg:ALL" + }, + "sub_populations": [] + }, + { + "name": "gnomADg:asj", + "description": "Ashkenazi Jewish", + "is_global": true, + "super_population": { + "name": "gnomADg:ALL" + }, + "sub_populations": [] + }, + { + "name": "gnomADg:eas", + "description": "East Asian", + "is_global": true, + "super_population": { + "name": "gnomADg:ALL" + }, + "sub_populations": [] + }, + { + "name": "gnomADg:fin", + "description": "Finnish", + "is_global": true, + "super_population": { + "name": "gnomADg:ALL" + }, + "sub_populations": [] + }, + { + "name": "gnomADg:mid", + "description": "Middle Eastern", + "is_global": true, + "super_population": { + "name": "gnomADg:ALL" + }, + "sub_populations": [] + }, + { + "name": "gnomADg:nfe", + "description": "Non-Finnish European", + "is_global": true, + "super_population": { + "name": "gnomADg:ALL" + }, + "sub_populations": [] + }, + { + "name": "gnomADg:oth", + "description": "Other", + "is_global": true, + "super_population": { + "name": "gnomADg:ALL" + }, + "sub_populations": [] + }, + { + "name": "gnomADg:sas", + "description": "South Asian", + "is_global": true, + "super_population": { + "name": "gnomADg:ALL" + }, + "sub_populations": [] + }, + { + "name": "gnomADe:ALL", + "description": "All gnomAD exomes individuals", + "is_global": true, + "super_population": { + "name": null + }, + "sub_populations": [ + { + "name": "gnomADe:afr" + }, + { + "name": "gnomADe:amr" + }, + { + "name": "gnomADe:asj" + }, + { + "name": "gnomADe:eas" + }, + { + "name": "gnomADg:fin" + }, + { + "name": "gnomADe:nfe" + }, + { + "name": "gnomADe:oth" + }, + { + "name": "gnomADe:sas" + } + ] + }, + { + "name": "gnomADe:afr", + "description": "African/African American", + "is_global": true, + "super_population": { + "name": "gnomADe:ALL" + }, + "sub_populations": [] + }, + { + "name": "gnomADe:amr", + "description": "Latino", + "is_global": true, + "super_population": { + "name": "gnomADe:ALL" + }, + "sub_populations": [] + }, + { + "name": "gnomADe:asj", + "description": "Ashkenazi Jewish", + "is_global": true, + "super_population": { + "name": "gnomADe:ALL" + }, + "sub_populations": [] + }, + { + "name": "gnomADe:eas", + "description": "East Asian", + "is_global": true, + "super_population": { + "name": "gnomADe:ALL" + }, + "sub_populations": [] + }, + { + "name": "gnomADe:fin", + "description": "Finnish", + "is_global": true, + "super_population": { + "name": "gnomADe:ALL" + }, + "sub_populations": [] + }, + { + "name": "gnomADe:nfe", + "description": "Non-Finnish European", + "is_global": true, + "super_population": { + "name": "gnomADe:ALL" + }, + "sub_populations": [] + }, + { + "name": "gnomADe:oth", + "description": "Other", + "is_global": true, + "super_population": { + "name": "gnomADe:ALL" + }, + "sub_populations": [] + }, + { + "name": "gnomADe:sas", + "description": "South Asian", + "is_global": true, + "super_population": { + "name": "gnomADe:ALL" + }, "sub_populations": [] } ] }, "extensions": { - "execution_time_in_seconds": 0.03 + "execution_time_in_seconds": 0.04 } } From bc8ba603c45e37d24a71b0c8b8133c68ed262707 Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Wed, 24 Jan 2024 15:46:06 +0000 Subject: [PATCH 15/29] Cleanup of files --- data/test_dbsnp.vcf.gz | Bin 6923 -> 0 bytes data/test_dbsnp.vcf.gz.tbi | Bin 102 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 data/test_dbsnp.vcf.gz delete mode 100644 data/test_dbsnp.vcf.gz.tbi diff --git a/data/test_dbsnp.vcf.gz b/data/test_dbsnp.vcf.gz deleted file mode 100644 index 3f6a5a93e8f4f11ed784c44f8701b10f0ef7bc1e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6923 zcmV+m8}#HKiwFb&00000{{{d;LjnNq8r3~(bK*v}pPgT!a_ZJ5b%9aqE&H-nGGI*B z1{N{Sq;B0(2@tkwKw>4~iBtUed%D%)A#@s?+1YU>6_3@Y`}BD~8cp-#kMnR5%;RL~ zXU)gf?Tgk>e)#dn+ur@SGiv@%uiYFvu3Kvd=`;yfSr|vnOJ}i=U{w|*skHLbG?-of z9oA4pZ9fZ|imVV>Cn}7k@j96X&Dq5558;vh?cIFr-M2kJO>`XwlVBbsK?Kvfqt>%( zHCAlt>e)}j=&8B#lPvTXFw*Pa4j4%zx7J@TCqdFAwejmJX!fEkcnXq3GTCNQuPyx) zHiCu(#71n<&y3nFvTmo}p${dLZkE9AhZu)`2v`Dt`YgqB=_!Z;DScf|;>8vFJ)AWp zY5W}QLnJ?%0YLJTK$-=Ma2aO7Oq#q(zBG*&aU}h8^)s8pu&!VODNM^VUjh)p)L%#w zKaqag{0!T);{f=HGbxOwi}fs!R%x)F#dPPiame7%?R;zx{xq9A#MR6m!M_R1hb%GG z-mJsLtk*ur6mEf`Ov(*{EtA0FrICAx)pg3!sYLeZC!rr@61YLI2&6$0K84YhBujN^ z9i^*a8qULDR+9(}bc1BM2&14TDe&aR;AP>oCaLgn6KBt*{oT=9_IKBGvrHNVehN}; z#WOI8pO*fsGzp|-4ARe@{YZ*IF)#jN9Z3Fc2I9>?SJ^YTK{drgKk*mwQ%>;Ywd0O! zk_NxViT@~7b}ZAiDjM@$G(Q_{3D*{4NOLH06)a2=(=R}#HS;w*siRRCMffx{NV<=6+ozEhh=8!LjO9_41zjIeY3~ zx2Jx%CoMnD*wmj+!5AT`rz>!DkTK+vJ*;MlllFO7!DzN9>t&QBLVNx3IVd5fC&2d( zk8y}*bgo`m%H>krVIw6*N9U>xL04k3+aH|7*A2j~0R+MA1(Je4Sp?;h14sB-T}NY3!V%OUl!Z{Neer4R4_?A`oGxB>vVi@ecc4^LRNV*XwnlZ7$GT|@ zwcf%{ARK4B65;exNweK(gxIa!;f?co+!Scd*a7be{-94QpQTS2+m;NYd|j#RXbm17 z2B)L?$fY#U8g;pZePIhA&DndTU>eJzs^aBECM}@$%GfB8WtkfOlBUOawO;TPKn=h@ z5GJ*)!l+)Qzk`qc7h{8#q`87VvdfJ$_wQ2YQbP?H9O^sMsTLA)ed)+r!ORKOy7y21c z+SG@*Tw|j72)`xNV4!~3hmoAzt#Re;(M=Gsj)=B%_u=PYK}DSpX}cki+cWKtY2&A} z-f8zt#V||Ow05K}lm>Zw1?D0FD21tUdr1P)<@ z(#eYRDXgM&D;ygnM@R>RQtHp=0ER53=sGIVcF%3!yg{b3FojSEDag-SPDeefo26%~^lX>uk;?;R3Q3tnQl^oVi6mtzNtsMirjwKjC1pyLGNsCq zEX$OBDn0*JdVUy}2D=6= z=ZLVN4 zQVfyYongC5?t3%ZH#a9{JUIRSsVS}76EpsKbAMun>y8KL6wM1GZryW&53 ziYc4&v3xkd!~n;}#R129&H?0D&m3^9XAV#>z_D3!z_Dd;z_Dd;0LD4NIIr+w4!}6C zuy78*I9D*v6^!!=pWpzD^9rBf0E}}5<6OZwS2502jB^#^T*Ww7G0s(ta~0!U#W+_n z&Q*+a4dGms5e8Km;X{=X&Q%#vnw655*^c^j#;9P`G=0BR2?%P9n-mv1!NtIyE+!HbWDS~hFH69 zA-1bq7#|i!m4yk>#K^TUfQ{~f@`0(=!bD-ppG%9qYNJFJnuX6w)5y1X&+cVKstaaM@JJJtO%AW;-#t> ztTC_YT`4||Gl~E;5m3j0dcJ3+o#+DD>H;e% zVAWjeoSbTyAvgrXu@XOFl3!BfEfaqCD_kKVYa}2i7d*L zvcM|{&!d%&PlO4WhzKGA?H9mG@f5&HpCUZDR8z}yix`L`btTsr4mL$#Rp18&u$nAU z#w&o;ic>}6S4HC2MAT{m_amCX#{g*JKwY$_E)oLIFhXFpvG6QX4Kzdq86rLnLBJpe zu4+?c2d4P58AY_x#ErzvgAE3>aiAqEjEE)7-^AwS7z$R!V1bw00xwr&fs7SVkW@rL zQX!%}2`@;HlArK+kAM{sQHqEtMGycAU}XSMMBT(E0X?5Y#b^Gp@$DTEer~)swJTe? z=bS(F#v$iTRy6Beymab~qntN+)KVZ3I0EkaV~<#-fi}Ag&;7?%=S=$8)SGta{;b&} z_wF=a&$%BLHivepil{NfOE6Ussx|HA-lb>%O4r}5LYl&(- zB06*uok(qIKR14}sW;B2Gbck?d@f#?dag~fly?d*KPy7crwjqi6u>MLW(c~>qP{{? zM4lal=c>Y!Q_=aR@OV>rDu@J_qMJd^weT`X7Y6d;U<-rd%!pbYLr|ZZ0$ObWPFsM} z7F2V#sJoO!?UAU;F8X&oKMK|=LQQYGe-tcAMBB`afOXNi1Gg1nD~Y+2A?}4lXMqJ! znDsHBDr)Y8ISAgfT`T z!X8@@ewZY3v!aBrj<&j}mK5!|^}lKv-;dZE%wjF^N#er;I*I<@J8RZ2XU%fYnl(N- zYuLR#%^^$@afqEJc8LZR3G`*M*B?AWQ#kIp$6$2@i_D=gs7@w%EzyMP*S-xESzE+wPHmTC=}z97&^{{ zitx_sEJIXhiB63*K{cfDZV2fS>}nvGvndD|#U}{me`vH{T#JhN>W{x1eYsH5o6}qCK4DrkT9_9X#Z#iJiOiH8rqF-M zR@V&Os5>VQURsV!>SOqEqVzwUE3Pefb8lqfA<4na)B98ZwNE3|WyLn=KPjxACUZCU z^!6ZDxvoRqQFm@mPBx)*k#+k#v|L-Kv4X5l^UuU2{%mlc!qY-x2n{?GsRD}x`$s2;z(dJOgC(6XwLg(vf`V{1_>BLuN6Ke|#V>S#LF?`ElSJFM@ zSJE{v>2=xxu+|#554~3N(l#!O3zV1;pgy{k?z#`{`tak;J)HrAvUbU?E&}AQ&CA{O z+?V-PgUw5#!;Gi=-cp#*>9+>$4!r`FT_-uAS1nUSM61gti~%i98zv@7gEUAn@B|uB zVE|UG;>9byuLl-26grRuPaF$r$d^(Y&a>tv{i!qf5Brx4x#wK;*rK;=v8(dv^;A*J z?>ovbyzAtGlt7gY>6TrJe#P&3-s~;h^d5#zYrJuPd$<|gZ@R$h<~H!NbrN{=qM_np zbJH7)e;al-olk@Qrq>^j;4gZq-jw}ZZKmzMP)#5J9u!$z1C)U*Xa*7U?2~jHbv^W zzx4|3hyOYpxSP9P_s#?Tu!nruZ4E{puXX42yPXXs(QS=-!*OrW z_ijO?gOR&wIqkMLyc@w5?AMX=>t@t>?A&i$b`Pu5^HxbP^V&nt=~j$Y%xhQ7Yah*X zEAY7$_}mJ7?lC@Y9n5Z$ms~wefYc=1O)tuvY39xM?S_xBySRK7b3oz6=xQ0}7wzu^ z)MP*Fi|}(GrBi=FFGT|&{2nJkF%#t19Qj`kAxxk!oCH$mcZd*DagiH$fk3(s{3Hqz zm|G$CW-&&u1D%CadU003?vV5LVs1p1AzXSUs zPSYyv?XRIdzYZ89y!|zV=cucxcHb;#u6{s<)-zw`JYLTGbHw(Iqx02r6 zU3ZB0zR`es(w-ML>2;{ny@98iOHYK4WrTG31Rii?DK zP@qIsgo!3kFA}@dt}Z>S^CXr(?`{C47vT-vUj3n$Umptq*z_fy`jhnn+&xIIrQHsP zL5F?y0DqL67VNS=;1?I^F&090sWsr(-u`%in8vNqXTf!P&w#suWW4as%sYcjVxX*f|p>?nEQ>VKj^ABnFb!U zpfB`t$9&{7y_>Y2f2E7`GM&Ri7y)-4{el*H>urO+FAJR({Ri%i-+jLUlX86Ve4gLv zSkDELF99*sh0Ag_3hI~K9KENhxAa$y?Dq_&)tDI&I-A#c(u6*&Crc(FDD>!^$#L=u z546Bz;B+;k;)nXi<2UZ7`6JC$-jrS956{#2-@q0o(|H!hi`1i6RzBt$YC@f<{P%N~ zF2YHj{$8Hf%8jSV?)P3_1Lw6M3eOfG%e5#P}7HaL2JZZ0@o7z z+MDt7TKZ+ZpqH!?a-}O*nkv!m;)frhV;nqOKoNA&YhR2yw-?U+_~M@*o%@UYdv-2p z4f_MRpnH;wBqch#a>6jpi}8h1Yh5(pzmePAjbHD70}705*RDHi%GZbA_0nv&KM``z zSW+yL$jbF&tLgS1uSfcIw?DY1m!miT0Tr3kzmglaWs{oRkfDdDH8yS+Qrd9z%avRs z@Hm@veRz&nw@L7?D;TNC*ZIxb*HCyjoy~fce}#od1ES(}W5CLrx~w3Gbq8)r7#Kl?)4D4@Cx*=&H*4cF(@ z_{w2bF8gt%QekXFe`>Ao%n`yx>up?|sTXCB3tP4n9pS=I6>GDIrlY=t$evh+RVDlU z;`Z(#i(eu4uc8>CvUNU{&Sv+eEeM^zI_{l0+&2$XQ4#a7ETWm4HyOF6$?B#qwsK2W zwNujm4t!v=x86iM517hcz_gVM=i(?_+RC>Hm$s(Sa4GA$ZL%Qvy+g*nAZYj~nK-#} z-Wops6V7-*H8`eOMfDrP$9Hv1U;&IXFzPO5@hPk#WlkGj7{7)c0oG z8a3{cnJDkxxHW3rMite68ROQdag&m9A4&dP<2I>r8>+3V79j?dx~*DwYu?-OudwEF z%_`HH^&OZpHDC465RA8%cHQ^MMfd$VA$2^ZO5SHX-kGxg7F2fMd3e}pU{s}$aAeJ= z3(@X-qP_cP!kM+7t1X(VYu(!TC|_IOC|?^k?a3iytFmQOH0*NTvcHq?S2A?-?b-W# zhrfMgBOJXk6pr7gUdHb;ppz;KdRGDcz(T4ienW6S(>lI|T*rTb6l9db_)$c8rzz;b zNDw~WmX5$u-jNQ*e+}*=O3SVpx`J5Sq@N-7)rdxSY+&H!$JvowWDG0OqW-4`{-Oe>Z3@Wu08T z(}V0i(k)`5q`&W!a=-@|dj3((DIJ_^>Dn$fTZ(+q8t;8zvmJheVgF?!v#uYA*I-?y`|GSBR1C>@5YRo zVHEHAd;WsHgSaPW{mr$8^Znn9+N$wP2Awy)DfORnTJ;Rwoc{vPf9B1oJ=vedfb)ho zrM_DTvRDW@-%Cz+XwG+fpK7O`Gud+9_I}k5{}1#m7rbDR001A02m}BC000301^_}s R0stET0{{R300000006wNa@ha? diff --git a/data/test_dbsnp.vcf.gz.tbi b/data/test_dbsnp.vcf.gz.tbi deleted file mode 100644 index b21302d608113f6f978d9fc96980b48c71ad2ebc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 102 zcmb2|=3rp}f&Xj_PR>jWo($ZDpHfm%5)u-ak|cPUP6bFEF=v@P&q+Y^?#lqpw(mg- lm$HRiM0Z(;Giy0q Date: Wed, 24 Jan 2024 15:51:12 +0000 Subject: [PATCH 16/29] Added version metadata for gnomADg and gnomADe --- common/file_model/population_metadata.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/file_model/population_metadata.json b/common/file_model/population_metadata.json index 3ea3559..4ed71db 100644 --- a/common/file_model/population_metadata.json +++ b/common/file_model/population_metadata.json @@ -483,7 +483,7 @@ }, { "name": "gnomADg:ALL", - "description": "All gnomAD genomes individuals", + "description": "All gnomAD genomes individuals v3.1.2", "type": "regional", "is_global": true, "super_population": @@ -657,7 +657,7 @@ }, { "name": "gnomADe:ALL", - "description": "All gnomAD exomes individuals", + "description": "All gnomAD exomes individuals r2.1.1", "type": "regional", "is_global": true, "super_population": From 3a78f32d25c5073ee2c0d896677e00afbf673832 Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Wed, 24 Jan 2024 17:11:23 +0000 Subject: [PATCH 17/29] Allele_frequency as nullable --- common/file_model/variant.py | 6 +++--- common/schemas/population_allele_frequency.graphql | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/file_model/variant.py b/common/file_model/variant.py index a866fcf..9748100 100644 --- a/common/file_model/variant.py +++ b/common/file_model/variant.py @@ -262,7 +262,7 @@ def traverse_population_info(self) -> Mapping: col_index = self.get_info_key_index(freq_val) if col_index and csq_record_list[col_index] is not None: if freq_key == "af": - allele_frequency = csq_record_list[col_index] + allele_frequency = csq_record_list[col_index] or None elif freq_key == "an": allele_number = csq_record_list[col_index] or None elif freq_key == "ac": @@ -271,7 +271,7 @@ def traverse_population_info(self) -> Mapping: raise Exception('Frequency metric is not recognised') population_frequency = { "population_name": sub_pop["name"], - "allele_frequency": allele_frequency or -1, + "allele_frequency": allele_frequency, "allele_count": allele_count, "allele_number": allele_number, "is_minor_allele": False, @@ -320,7 +320,7 @@ def set_frequency_flags(self): else: for pop_freq in pop_freqs: - if pop_name == pop_freq["population_name"] and float(pop_freq["allele_frequency"]) > -1: + if pop_name == pop_freq["population_name"] and pop_freq["allele_frequency"]: minimised_allele = allele.minimise_allele(allele.alt) by_population.append([float(pop_freq["allele_frequency"]),minimised_allele, pop_name]) diff --git a/common/schemas/population_allele_frequency.graphql b/common/schemas/population_allele_frequency.graphql index 21bfe62..218cf84 100644 --- a/common/schemas/population_allele_frequency.graphql +++ b/common/schemas/population_allele_frequency.graphql @@ -3,7 +3,7 @@ type PopulationAlleleFrequency{ Population Allele Frequency """ population_name: String! - allele_frequency: Float! + allele_frequency: Float allele_count: Int allele_number: Int is_minor_allele: Boolean! From f661d72073c9cbd5ff4d0cdffd4fd8f10d74a1ae Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Thu, 25 Jan 2024 11:40:24 +0000 Subject: [PATCH 18/29] Not returning population_allele_frequencies with allele_frequency null --- common/file_model/variant.py | 4 +- .../population_allele_frequency.graphql | 2 +- .../response.json | 392 +----------------- 3 files changed, 6 insertions(+), 392 deletions(-) diff --git a/common/file_model/variant.py b/common/file_model/variant.py index 9748100..ecfa1b4 100644 --- a/common/file_model/variant.py +++ b/common/file_model/variant.py @@ -277,8 +277,8 @@ def traverse_population_info(self) -> Mapping: "is_minor_allele": False, "is_hpmaf": False } - - population_frequency_map[csq_record_list[allele_index]][sub_pop["name"]] = population_frequency + if allele_frequency: + population_frequency_map[csq_record_list[allele_index]][sub_pop["name"]] = population_frequency return population_frequency_map def set_frequency_flags(self): diff --git a/common/schemas/population_allele_frequency.graphql b/common/schemas/population_allele_frequency.graphql index 218cf84..21bfe62 100644 --- a/common/schemas/population_allele_frequency.graphql +++ b/common/schemas/population_allele_frequency.graphql @@ -3,7 +3,7 @@ type PopulationAlleleFrequency{ Population Allele Frequency """ population_name: String! - allele_frequency: Float + allele_frequency: Float! allele_count: Int allele_number: Int is_minor_allele: Boolean! diff --git a/examples/population_allele_frequencies/response.json b/examples/population_allele_frequencies/response.json index d729d93..49d35f6 100644 --- a/examples/population_allele_frequencies/response.json +++ b/examples/population_allele_frequencies/response.json @@ -5,200 +5,7 @@ "alleles": [ { "name": "13:32379902:C:A", - "population_frequencies": [ - { - "population_name": "1000GENOMES:phase_3:ALL", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "1000GENOMES:phase_3:AFR", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "1000GENOMES:phase_3:AMR", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "1000GENOMES:phase_3:EAS", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "1000GENOMES:phase_3:EUR", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "1000GENOMES:phase_3:SAS", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:ALL", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:afr", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:amr", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:asj", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:eas", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:fin", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:nfe", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:oth", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:sas", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:ALL", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:afr", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:amr", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:asj", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:eas", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:fin", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:nfe", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:oth", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:sas", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - } - ] + "population_frequencies": [] }, { "name": "13:32379902:C:G", @@ -399,200 +206,7 @@ }, { "name": "13:32379902:C:T", - "population_frequencies": [ - { - "population_name": "1000GENOMES:phase_3:ALL", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "1000GENOMES:phase_3:AFR", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "1000GENOMES:phase_3:AMR", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "1000GENOMES:phase_3:EAS", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "1000GENOMES:phase_3:EUR", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "1000GENOMES:phase_3:SAS", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:ALL", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:afr", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:amr", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:asj", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:eas", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:fin", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:nfe", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:oth", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:sas", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:ALL", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:afr", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:amr", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:asj", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:eas", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:fin", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:nfe", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:oth", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:sas", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - } - ] + "population_frequencies": [] }, { "name": "13:32379902:C:C", @@ -795,6 +409,6 @@ } }, "extensions": { - "execution_time_in_seconds": 0.58 + "execution_time_in_seconds": 0.64 } } From 5575ce0b1497922ba0ed4f2ad8967f00716ebebc Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Thu, 25 Jan 2024 11:49:02 +0000 Subject: [PATCH 19/29] Removed updates to example payload --- .../response.json | 414 ------------------ 1 file changed, 414 deletions(-) delete mode 100644 examples/population_allele_frequencies/response.json diff --git a/examples/population_allele_frequencies/response.json b/examples/population_allele_frequencies/response.json deleted file mode 100644 index 49d35f6..0000000 --- a/examples/population_allele_frequencies/response.json +++ /dev/null @@ -1,414 +0,0 @@ -{ - "data": { - "variant": { - "name": "rs202155613", - "alleles": [ - { - "name": "13:32379902:C:A", - "population_frequencies": [] - }, - { - "name": "13:32379902:C:G", - "population_frequencies": [ - { - "population_name": "1000GENOMES:phase_3:ALL", - "allele_frequency": 0.0002, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": true - }, - { - "population_name": "1000GENOMES:phase_3:AFR", - "allele_frequency": 0, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": true - }, - { - "population_name": "1000GENOMES:phase_3:AMR", - "allele_frequency": 0, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": true - }, - { - "population_name": "1000GENOMES:phase_3:EAS", - "allele_frequency": 0.001, - "allele_number": null, - "allele_count": null, - "is_hpmaf": true, - "is_minor_allele": true - }, - { - "population_name": "1000GENOMES:phase_3:EUR", - "allele_frequency": 0, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": true - }, - { - "population_name": "1000GENOMES:phase_3:SAS", - "allele_frequency": 0, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": true - }, - { - "population_name": "gnomADe:ALL", - "allele_frequency": 0.0000401777, - "allele_number": 248894, - "allele_count": 10, - "is_hpmaf": false, - "is_minor_allele": true - }, - { - "population_name": "gnomADe:afr", - "allele_frequency": 0, - "allele_number": 16104, - "allele_count": 0, - "is_hpmaf": false, - "is_minor_allele": true - }, - { - "population_name": "gnomADe:amr", - "allele_frequency": 0, - "allele_number": 34402, - "allele_count": 0, - "is_hpmaf": false, - "is_minor_allele": true - }, - { - "population_name": "gnomADe:asj", - "allele_frequency": 0, - "allele_number": 10010, - "allele_count": 0, - "is_hpmaf": false, - "is_minor_allele": true - }, - { - "population_name": "gnomADe:eas", - "allele_frequency": 0.000549995, - "allele_number": 18182, - "allele_count": 10, - "is_hpmaf": false, - "is_minor_allele": true - }, - { - "population_name": "gnomADe:fin", - "allele_frequency": 0, - "allele_number": 21578, - "allele_count": 0, - "is_hpmaf": false, - "is_minor_allele": true - }, - { - "population_name": "gnomADe:nfe", - "allele_frequency": 0, - "allele_number": 112036, - "allele_count": 0, - "is_hpmaf": false, - "is_minor_allele": true - }, - { - "population_name": "gnomADe:oth", - "allele_frequency": 0, - "allele_number": 6066, - "allele_count": 0, - "is_hpmaf": false, - "is_minor_allele": true - }, - { - "population_name": "gnomADe:sas", - "allele_frequency": 0, - "allele_number": 30516, - "allele_count": 0, - "is_hpmaf": false, - "is_minor_allele": true - }, - { - "population_name": "gnomADg:ALL", - "allele_frequency": 0.0000131387, - "allele_number": 152222, - "allele_count": 2, - "is_hpmaf": false, - "is_minor_allele": true - }, - { - "population_name": "gnomADg:afr", - "allele_frequency": 0, - "allele_number": 41446, - "allele_count": 0, - "is_hpmaf": false, - "is_minor_allele": true - }, - { - "population_name": "gnomADg:amr", - "allele_frequency": 0, - "allele_number": 15288, - "allele_count": 0, - "is_hpmaf": false, - "is_minor_allele": true - }, - { - "population_name": "gnomADg:asj", - "allele_frequency": 0, - "allele_number": 3472, - "allele_count": 0, - "is_hpmaf": false, - "is_minor_allele": true - }, - { - "population_name": "gnomADg:eas", - "allele_frequency": 0.00038432, - "allele_number": 5204, - "allele_count": 2, - "is_hpmaf": false, - "is_minor_allele": true - }, - { - "population_name": "gnomADg:fin", - "allele_frequency": 0, - "allele_number": 10618, - "allele_count": 0, - "is_hpmaf": false, - "is_minor_allele": true - }, - { - "population_name": "gnomADg:nfe", - "allele_frequency": 0, - "allele_number": 68038, - "allele_count": 0, - "is_hpmaf": false, - "is_minor_allele": true - }, - { - "population_name": "gnomADg:oth", - "allele_frequency": 0, - "allele_number": 2092, - "allele_count": 0, - "is_hpmaf": false, - "is_minor_allele": true - }, - { - "population_name": "gnomADg:sas", - "allele_frequency": 0, - "allele_number": 4836, - "allele_count": 0, - "is_hpmaf": false, - "is_minor_allele": true - } - ] - }, - { - "name": "13:32379902:C:T", - "population_frequencies": [] - }, - { - "name": "13:32379902:C:C", - "population_frequencies": [ - { - "population_name": "1000GENOMES:phase_3:ALL", - "allele_frequency": 0.9998, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "1000GENOMES:phase_3:AFR", - "allele_frequency": 1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "1000GENOMES:phase_3:AMR", - "allele_frequency": 1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "1000GENOMES:phase_3:EAS", - "allele_frequency": 0.999, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "1000GENOMES:phase_3:EUR", - "allele_frequency": 1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "1000GENOMES:phase_3:SAS", - "allele_frequency": 1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:ALL", - "allele_frequency": 0.9999598223, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:afr", - "allele_frequency": 1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:amr", - "allele_frequency": 1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:asj", - "allele_frequency": 1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:eas", - "allele_frequency": 0.999450005, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:fin", - "allele_frequency": 1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:nfe", - "allele_frequency": 1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:oth", - "allele_frequency": 1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:sas", - "allele_frequency": 1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:ALL", - "allele_frequency": 0.9999868613, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:afr", - "allele_frequency": 1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:amr", - "allele_frequency": 1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:asj", - "allele_frequency": 1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:eas", - "allele_frequency": 0.99961568, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:fin", - "allele_frequency": 1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:nfe", - "allele_frequency": 1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:oth", - "allele_frequency": 1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:sas", - "allele_frequency": 1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - } - ] - } - ] - } - }, - "extensions": { - "execution_time_in_seconds": 0.64 - } -} From 4dfa7d36e802e51d4f5529813120d8ee1fc95bc0 Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Thu, 25 Jan 2024 11:51:42 +0000 Subject: [PATCH 20/29] Removed updates to example payload --- .../response.json | 800 ++++++++++++++++++ 1 file changed, 800 insertions(+) create mode 100644 examples/population_allele_frequencies/response.json diff --git a/examples/population_allele_frequencies/response.json b/examples/population_allele_frequencies/response.json new file mode 100644 index 0000000..d729d93 --- /dev/null +++ b/examples/population_allele_frequencies/response.json @@ -0,0 +1,800 @@ +{ + "data": { + "variant": { + "name": "rs202155613", + "alleles": [ + { + "name": "13:32379902:C:A", + "population_frequencies": [ + { + "population_name": "1000GENOMES:phase_3:ALL", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:AFR", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:AMR", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:EAS", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:EUR", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:SAS", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:ALL", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:afr", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:amr", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:asj", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:eas", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:fin", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:nfe", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:oth", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:sas", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:ALL", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:afr", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:amr", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:asj", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:eas", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:fin", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:nfe", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:oth", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:sas", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + } + ] + }, + { + "name": "13:32379902:C:G", + "population_frequencies": [ + { + "population_name": "1000GENOMES:phase_3:ALL", + "allele_frequency": 0.0002, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "1000GENOMES:phase_3:AFR", + "allele_frequency": 0, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "1000GENOMES:phase_3:AMR", + "allele_frequency": 0, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "1000GENOMES:phase_3:EAS", + "allele_frequency": 0.001, + "allele_number": null, + "allele_count": null, + "is_hpmaf": true, + "is_minor_allele": true + }, + { + "population_name": "1000GENOMES:phase_3:EUR", + "allele_frequency": 0, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "1000GENOMES:phase_3:SAS", + "allele_frequency": 0, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADe:ALL", + "allele_frequency": 0.0000401777, + "allele_number": 248894, + "allele_count": 10, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADe:afr", + "allele_frequency": 0, + "allele_number": 16104, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADe:amr", + "allele_frequency": 0, + "allele_number": 34402, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADe:asj", + "allele_frequency": 0, + "allele_number": 10010, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADe:eas", + "allele_frequency": 0.000549995, + "allele_number": 18182, + "allele_count": 10, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADe:fin", + "allele_frequency": 0, + "allele_number": 21578, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADe:nfe", + "allele_frequency": 0, + "allele_number": 112036, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADe:oth", + "allele_frequency": 0, + "allele_number": 6066, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADe:sas", + "allele_frequency": 0, + "allele_number": 30516, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADg:ALL", + "allele_frequency": 0.0000131387, + "allele_number": 152222, + "allele_count": 2, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADg:afr", + "allele_frequency": 0, + "allele_number": 41446, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADg:amr", + "allele_frequency": 0, + "allele_number": 15288, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADg:asj", + "allele_frequency": 0, + "allele_number": 3472, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADg:eas", + "allele_frequency": 0.00038432, + "allele_number": 5204, + "allele_count": 2, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADg:fin", + "allele_frequency": 0, + "allele_number": 10618, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADg:nfe", + "allele_frequency": 0, + "allele_number": 68038, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADg:oth", + "allele_frequency": 0, + "allele_number": 2092, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + }, + { + "population_name": "gnomADg:sas", + "allele_frequency": 0, + "allele_number": 4836, + "allele_count": 0, + "is_hpmaf": false, + "is_minor_allele": true + } + ] + }, + { + "name": "13:32379902:C:T", + "population_frequencies": [ + { + "population_name": "1000GENOMES:phase_3:ALL", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:AFR", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:AMR", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:EAS", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:EUR", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:SAS", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:ALL", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:afr", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:amr", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:asj", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:eas", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:fin", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:nfe", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:oth", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:sas", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:ALL", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:afr", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:amr", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:asj", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:eas", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:fin", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:nfe", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:oth", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:sas", + "allele_frequency": -1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + } + ] + }, + { + "name": "13:32379902:C:C", + "population_frequencies": [ + { + "population_name": "1000GENOMES:phase_3:ALL", + "allele_frequency": 0.9998, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:AFR", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:AMR", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:EAS", + "allele_frequency": 0.999, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:EUR", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "1000GENOMES:phase_3:SAS", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:ALL", + "allele_frequency": 0.9999598223, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:afr", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:amr", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:asj", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:eas", + "allele_frequency": 0.999450005, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:fin", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:nfe", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:oth", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADe:sas", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:ALL", + "allele_frequency": 0.9999868613, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:afr", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:amr", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:asj", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:eas", + "allele_frequency": 0.99961568, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:fin", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:nfe", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:oth", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + }, + { + "population_name": "gnomADg:sas", + "allele_frequency": 1, + "allele_number": null, + "allele_count": null, + "is_hpmaf": false, + "is_minor_allele": false + } + ] + } + ] + } + }, + "extensions": { + "execution_time_in_seconds": 0.58 + } +} From bb6ae82b051dd19048d220b13b5dd596127d7a8e Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Thu, 25 Jan 2024 14:40:01 +0000 Subject: [PATCH 21/29] Modified endpoint from population to populations; Updated examples --- common/schemas/query.graphql | 2 +- examples/population/query.graphql | 2 +- examples/population/response.json | 8 +- .../response.json | 392 +----------------- graphql_service/resolver/variant_model.py | 4 +- 5 files changed, 11 insertions(+), 397 deletions(-) diff --git a/common/schemas/query.graphql b/common/schemas/query.graphql index ebc0a12..33fb316 100644 --- a/common/schemas/query.graphql +++ b/common/schemas/query.graphql @@ -1,7 +1,7 @@ type Query { version: Version variant(by_id: IdInput): Variant - population(genome_id: String!): [Population] + populations(genome_id: String!): [Population] } input IdInput { diff --git a/examples/population/query.graphql b/examples/population/query.graphql index 8227a3f..b0e0592 100644 --- a/examples/population/query.graphql +++ b/examples/population/query.graphql @@ -1,5 +1,5 @@ query pop_example { - population(genome_id: "a7335667-93e7-11ec-a39d-005056b38ce3") + populations(genome_id: "a7335667-93e7-11ec-a39d-005056b38ce3") { name diff --git a/examples/population/response.json b/examples/population/response.json index 62502ee..644f897 100644 --- a/examples/population/response.json +++ b/examples/population/response.json @@ -1,6 +1,6 @@ { "data": { - "population": [ + "populations": [ { "name": "1000GENOMES:phase_3:ALL", "description": "All phase 3 individuals", @@ -376,7 +376,7 @@ }, { "name": "gnomADg:ALL", - "description": "All gnomAD genomes individuals", + "description": "All gnomAD genomes individuals v3.1.2", "is_global": true, "super_population": { "name": null @@ -506,7 +506,7 @@ }, { "name": "gnomADe:ALL", - "description": "All gnomAD exomes individuals", + "description": "All gnomAD exomes individuals r2.1.1", "is_global": true, "super_population": { "name": null @@ -613,6 +613,6 @@ ] }, "extensions": { - "execution_time_in_seconds": 0.04 + "execution_time_in_seconds": 0.02 } } diff --git a/examples/population_allele_frequencies/response.json b/examples/population_allele_frequencies/response.json index d729d93..b2cc3ce 100644 --- a/examples/population_allele_frequencies/response.json +++ b/examples/population_allele_frequencies/response.json @@ -5,200 +5,7 @@ "alleles": [ { "name": "13:32379902:C:A", - "population_frequencies": [ - { - "population_name": "1000GENOMES:phase_3:ALL", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "1000GENOMES:phase_3:AFR", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "1000GENOMES:phase_3:AMR", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "1000GENOMES:phase_3:EAS", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "1000GENOMES:phase_3:EUR", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "1000GENOMES:phase_3:SAS", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:ALL", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:afr", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:amr", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:asj", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:eas", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:fin", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:nfe", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:oth", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:sas", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:ALL", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:afr", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:amr", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:asj", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:eas", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:fin", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:nfe", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:oth", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:sas", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - } - ] + "population_frequencies": [] }, { "name": "13:32379902:C:G", @@ -399,200 +206,7 @@ }, { "name": "13:32379902:C:T", - "population_frequencies": [ - { - "population_name": "1000GENOMES:phase_3:ALL", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "1000GENOMES:phase_3:AFR", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "1000GENOMES:phase_3:AMR", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "1000GENOMES:phase_3:EAS", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "1000GENOMES:phase_3:EUR", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "1000GENOMES:phase_3:SAS", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:ALL", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:afr", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:amr", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:asj", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:eas", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:fin", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:nfe", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:oth", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADe:sas", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:ALL", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:afr", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:amr", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:asj", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:eas", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:fin", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:nfe", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:oth", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - }, - { - "population_name": "gnomADg:sas", - "allele_frequency": -1, - "allele_number": null, - "allele_count": null, - "is_hpmaf": false, - "is_minor_allele": false - } - ] + "population_frequencies": [] }, { "name": "13:32379902:C:C", @@ -795,6 +409,6 @@ } }, "extensions": { - "execution_time_in_seconds": 0.58 + "execution_time_in_seconds": 0.73 } } diff --git a/graphql_service/resolver/variant_model.py b/graphql_service/resolver/variant_model.py index 3da595c..9e52c75 100644 --- a/graphql_service/resolver/variant_model.py +++ b/graphql_service/resolver/variant_model.py @@ -163,8 +163,8 @@ def resolve_api( return {"api": {"major": "0", "minor": "1", "patch": "0-beta"}} -@QUERY_TYPE.field("population") -def resolve_population(_: None, info: GraphQLResolveInfo, genome_id: str = None) -> List: +@QUERY_TYPE.field("populations") +def resolve_populations(_: None, info: GraphQLResolveInfo, genome_id: str = None) -> List: current_directory = os.path.dirname(__file__) population_metadata_file = f"{current_directory}/../../common/file_model/population_metadata.json" with open(population_metadata_file) as pop_file: From 8a7557d26554afea6fb3e88f8307a432d2ec0b7a Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Mon, 29 Jan 2024 10:35:11 +0000 Subject: [PATCH 22/29] Fixing is_global values --- common/file_model/population_metadata.json | 96 +++++++++++----------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/common/file_model/population_metadata.json b/common/file_model/population_metadata.json index 4ed71db..bf99f11 100644 --- a/common/file_model/population_metadata.json +++ b/common/file_model/population_metadata.json @@ -29,7 +29,7 @@ "name": "1000GENOMES:phase_3:AFR", "description": "African", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:ALL" @@ -59,7 +59,7 @@ "name": "1000GENOMES:phase_3:AMR", "description": "American", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:ALL" @@ -83,7 +83,7 @@ "name": "1000GENOMES:phase_3:EAS", "description": "East Asian", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:ALL" @@ -110,7 +110,7 @@ "name": "1000GENOMES:phase_3:EUR", "description": "European", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:ALL" @@ -137,7 +137,7 @@ "name": "1000GENOMES:phase_3:SAS", "description": "South Asian", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:ALL" @@ -164,7 +164,7 @@ "name": "1000GENOMES:phase_3:ACB", "description": "African Caribbean in Barbados", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:AFR" @@ -176,7 +176,7 @@ "name": "1000GENOMES:phase_3:ASW", "description": "African Ancestry in Southwest US", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:AFR" @@ -189,7 +189,7 @@ "name": "1000GENOMES:phase_3:ESN", "description": "Esan in Nigeria", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:AFR" @@ -202,7 +202,7 @@ "name": "1000GENOMES:phase_3:GWD", "description": "Gambian in Western Division, The Gambia", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:AFR" @@ -215,7 +215,7 @@ "name": "1000GENOMES:phase_3:LWK", "description": "Luhya in Webuye, Kenya", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:AFR" @@ -228,7 +228,7 @@ "name": "1000GENOMES:phase_3:MSL", "description": "Mende in Sierra Leone", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:AFR" @@ -241,7 +241,7 @@ "name": "1000GENOMES:phase_3:CLM", "description": "Colombian in Medellin, Colombia", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:AMR" @@ -254,7 +254,7 @@ "name": "1000GENOMES:phase_3:MXL", "description": "Colombian in Medellin, Colombia", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:AMR" @@ -267,7 +267,7 @@ "name": "1000GENOMES:phase_3:PEL", "description": "Peruvian in Lima, Peru", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:AMR" }, @@ -279,7 +279,7 @@ "name": "1000GENOMES:phase_3:PUR", "description": "Puerto Rican in Puerto Rico", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:AMR" }, @@ -291,7 +291,7 @@ "name": "1000GENOMES:phase_3:CDX", "description": "Chinese Dai in Xishuangbanna, China", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:EAS" @@ -304,7 +304,7 @@ "name": "1000GENOMES:phase_3:CHB", "description": "Han Chinese in Bejing, China", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:EAS" @@ -317,7 +317,7 @@ "name": "1000GENOMES:phase_3:CHS", "description": "Southern Han Chinese, China", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:EAS" }, @@ -329,7 +329,7 @@ "name": "1000GENOMES:phase_3:JPT", "description": "Japanese in Tokyo, Japan", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:EAS" @@ -342,7 +342,7 @@ "name": "1000GENOMES:phase_3:KHV", "description": "Kinh in Ho Chi Minh City, Vietnam", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:EAS" @@ -355,7 +355,7 @@ "name": "1000GENOMES:phase_3:CEU", "description": " Utah residents with Northern and Western European ancestry", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:EUR" @@ -368,7 +368,7 @@ "name": "1000GENOMES:phase_3:FIN", "description": "Finnish in Finland", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:EUR" @@ -381,7 +381,7 @@ "name": "1000GENOMES:phase_3:GBR", "description": "British in England and Scotland", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:EUR" @@ -394,7 +394,7 @@ "name": "1000GENOMES:phase_3:IBS", "description": "Iberian populations in Spain", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:EUR" @@ -407,7 +407,7 @@ "name": "1000GENOMES:phase_3:TSI", "description": "Toscani in Italy", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:EUR" @@ -420,7 +420,7 @@ "name": "1000GENOMES:phase_3:BEB", "description": "Bengali in Bangladesh", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:SAS" @@ -433,7 +433,7 @@ "name": "1000GENOMES:phase_3:GIH", "description": "Gujarati Indian in Houston, TX", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:SAS" @@ -446,7 +446,7 @@ "name": "1000GENOMES:phase_3:ITU", "description": "Indian Telugu in the UK", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:SAS" @@ -459,7 +459,7 @@ "name": "1000GENOMES:phase_3:PJL", "description": "Punjabi in Lahore, Pakistan", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:SAS" @@ -472,7 +472,7 @@ "name": "1000GENOMES:phase_3:STU", "description": "Sri Lankan Tamil in the UK", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:SAS" @@ -528,7 +528,7 @@ "name": "gnomADg:afr", "description": "African/African American", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADg:ALL" @@ -541,7 +541,7 @@ "name": "gnomADg:ami", "description": "Amish", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADg:ALL" @@ -554,7 +554,7 @@ "name": "gnomADg:amr", "description": "Latino", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADg:ALL" @@ -567,7 +567,7 @@ "name": "gnomADg:asj", "description": "Ashkenazi Jewish", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADg:ALL" @@ -580,7 +580,7 @@ "name": "gnomADg:eas", "description": "East Asian", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADg:ALL" @@ -593,7 +593,7 @@ "name": "gnomADg:fin", "description": "Finnish", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADg:ALL" @@ -607,7 +607,7 @@ "name": "gnomADg:mid", "description": "Middle Eastern", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADg:ALL" @@ -620,7 +620,7 @@ "name": "gnomADg:nfe", "description": "Non-Finnish European", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADg:ALL" @@ -633,7 +633,7 @@ "name": "gnomADg:oth", "description": "Other", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADg:ALL" @@ -646,7 +646,7 @@ "name": "gnomADg:sas", "description": "South Asian", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADg:ALL" @@ -696,7 +696,7 @@ "name": "gnomADe:afr", "description": "African/African American", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADe:ALL" @@ -709,7 +709,7 @@ "name": "gnomADe:amr", "description": "Latino", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADe:ALL" @@ -722,7 +722,7 @@ "name": "gnomADe:asj", "description": "Ashkenazi Jewish", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADe:ALL" @@ -735,7 +735,7 @@ "name": "gnomADe:eas", "description": "East Asian", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADe:ALL" @@ -748,7 +748,7 @@ "name": "gnomADe:fin", "description": "Finnish", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADe:ALL" @@ -762,7 +762,7 @@ "name": "gnomADe:nfe", "description": "Non-Finnish European", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADe:ALL" @@ -775,7 +775,7 @@ "name": "gnomADe:oth", "description": "Other", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADe:ALL" @@ -788,7 +788,7 @@ "name": "gnomADe:sas", "description": "South Asian", "type": "regional", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADe:ALL" From 193ffe1fe0f6f598537a127fcbb84d94319097fc Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Mon, 29 Jan 2024 11:15:34 +0000 Subject: [PATCH 23/29] Fixing the nullability logic in super_population --- common/schemas/population.graphql | 3 +- examples/population/response.json | 108 +++++++++++----------- graphql_service/resolver/variant_model.py | 12 ++- 3 files changed, 64 insertions(+), 59 deletions(-) diff --git a/common/schemas/population.graphql b/common/schemas/population.graphql index 62aa1b2..975cfa4 100644 --- a/common/schemas/population.graphql +++ b/common/schemas/population.graphql @@ -2,8 +2,7 @@ type Population{ """ Population """ - name: String ## Requires to be nullable as super-population can be a null field - size: Int! + name: String! description: String! type: String is_global: Boolean diff --git a/examples/population/response.json b/examples/population/response.json index 644f897..55d7a34 100644 --- a/examples/population/response.json +++ b/examples/population/response.json @@ -27,7 +27,7 @@ { "name": "1000GENOMES:phase_3:AFR", "description": "African", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:ALL" }, @@ -55,7 +55,7 @@ { "name": "1000GENOMES:phase_3:AMR", "description": "American", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:ALL" }, @@ -77,7 +77,7 @@ { "name": "1000GENOMES:phase_3:EAS", "description": "East Asian", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:ALL" }, @@ -102,7 +102,7 @@ { "name": "1000GENOMES:phase_3:EUR", "description": "European", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:ALL" }, @@ -127,7 +127,7 @@ { "name": "1000GENOMES:phase_3:SAS", "description": "South Asian", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:ALL" }, @@ -152,7 +152,7 @@ { "name": "1000GENOMES:phase_3:ACB", "description": "African Caribbean in Barbados", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:AFR" }, @@ -161,7 +161,7 @@ { "name": "1000GENOMES:phase_3:ASW", "description": "African Ancestry in Southwest US", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:AFR" }, @@ -170,7 +170,7 @@ { "name": "1000GENOMES:phase_3:ESN", "description": "Esan in Nigeria", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:AFR" }, @@ -179,7 +179,7 @@ { "name": "1000GENOMES:phase_3:GWD", "description": "Gambian in Western Division, The Gambia", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:AFR" }, @@ -188,7 +188,7 @@ { "name": "1000GENOMES:phase_3:LWK", "description": "Luhya in Webuye, Kenya", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:AFR" }, @@ -197,7 +197,7 @@ { "name": "1000GENOMES:phase_3:MSL", "description": "Mende in Sierra Leone", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:AFR" }, @@ -206,7 +206,7 @@ { "name": "1000GENOMES:phase_3:CLM", "description": "Colombian in Medellin, Colombia", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:AMR" }, @@ -215,7 +215,7 @@ { "name": "1000GENOMES:phase_3:MXL", "description": "Colombian in Medellin, Colombia", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:AMR" }, @@ -224,7 +224,7 @@ { "name": "1000GENOMES:phase_3:PEL", "description": "Peruvian in Lima, Peru", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:AMR" }, @@ -233,7 +233,7 @@ { "name": "1000GENOMES:phase_3:PUR", "description": "Puerto Rican in Puerto Rico", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:AMR" }, @@ -242,7 +242,7 @@ { "name": "1000GENOMES:phase_3:CDX", "description": "Chinese Dai in Xishuangbanna, China", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:EAS" }, @@ -251,7 +251,7 @@ { "name": "1000GENOMES:phase_3:CHB", "description": "Han Chinese in Bejing, China", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:EAS" }, @@ -260,7 +260,7 @@ { "name": "1000GENOMES:phase_3:CHS", "description": "Southern Han Chinese, China", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:EAS" }, @@ -269,7 +269,7 @@ { "name": "1000GENOMES:phase_3:JPT", "description": "Japanese in Tokyo, Japan", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:EAS" }, @@ -278,7 +278,7 @@ { "name": "1000GENOMES:phase_3:KHV", "description": "Kinh in Ho Chi Minh City, Vietnam", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:EAS" }, @@ -287,7 +287,7 @@ { "name": "1000GENOMES:phase_3:CEU", "description": " Utah residents with Northern and Western European ancestry", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:EUR" }, @@ -296,7 +296,7 @@ { "name": "1000GENOMES:phase_3:FIN", "description": "Finnish in Finland", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:EUR" }, @@ -305,7 +305,7 @@ { "name": "1000GENOMES:phase_3:GBR", "description": "British in England and Scotland", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:EUR" }, @@ -314,7 +314,7 @@ { "name": "1000GENOMES:phase_3:IBS", "description": "Iberian populations in Spain", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:EUR" }, @@ -323,7 +323,7 @@ { "name": "1000GENOMES:phase_3:TSI", "description": "Toscani in Italy", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:EUR" }, @@ -332,7 +332,7 @@ { "name": "1000GENOMES:phase_3:BEB", "description": "Bengali in Bangladesh", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:SAS" }, @@ -341,7 +341,7 @@ { "name": "1000GENOMES:phase_3:GIH", "description": "Gujarati Indian in Houston, TX", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:SAS" }, @@ -350,7 +350,7 @@ { "name": "1000GENOMES:phase_3:ITU", "description": "Indian Telugu in the UK", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:SAS" }, @@ -359,7 +359,7 @@ { "name": "1000GENOMES:phase_3:PJL", "description": "Punjabi in Lahore, Pakistan", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:SAS" }, @@ -368,7 +368,7 @@ { "name": "1000GENOMES:phase_3:STU", "description": "Sri Lankan Tamil in the UK", - "is_global": true, + "is_global": false, "super_population": { "name": "1000GENOMES:phase_3:SAS" }, @@ -378,9 +378,7 @@ "name": "gnomADg:ALL", "description": "All gnomAD genomes individuals v3.1.2", "is_global": true, - "super_population": { - "name": null - }, + "super_population": null, "sub_populations": [ { "name": "gnomADg:afr" @@ -417,7 +415,7 @@ { "name": "gnomADg:afr", "description": "African/African American", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADg:ALL" }, @@ -426,7 +424,7 @@ { "name": "gnomADg:ami", "description": "Amish", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADg:ALL" }, @@ -435,7 +433,7 @@ { "name": "gnomADg:amr", "description": "Latino", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADg:ALL" }, @@ -444,7 +442,7 @@ { "name": "gnomADg:asj", "description": "Ashkenazi Jewish", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADg:ALL" }, @@ -453,7 +451,7 @@ { "name": "gnomADg:eas", "description": "East Asian", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADg:ALL" }, @@ -462,7 +460,7 @@ { "name": "gnomADg:fin", "description": "Finnish", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADg:ALL" }, @@ -471,7 +469,7 @@ { "name": "gnomADg:mid", "description": "Middle Eastern", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADg:ALL" }, @@ -480,7 +478,7 @@ { "name": "gnomADg:nfe", "description": "Non-Finnish European", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADg:ALL" }, @@ -489,7 +487,7 @@ { "name": "gnomADg:oth", "description": "Other", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADg:ALL" }, @@ -498,7 +496,7 @@ { "name": "gnomADg:sas", "description": "South Asian", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADg:ALL" }, @@ -508,9 +506,7 @@ "name": "gnomADe:ALL", "description": "All gnomAD exomes individuals r2.1.1", "is_global": true, - "super_population": { - "name": null - }, + "super_population": null, "sub_populations": [ { "name": "gnomADe:afr" @@ -541,7 +537,7 @@ { "name": "gnomADe:afr", "description": "African/African American", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADe:ALL" }, @@ -550,7 +546,7 @@ { "name": "gnomADe:amr", "description": "Latino", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADe:ALL" }, @@ -559,7 +555,7 @@ { "name": "gnomADe:asj", "description": "Ashkenazi Jewish", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADe:ALL" }, @@ -568,7 +564,7 @@ { "name": "gnomADe:eas", "description": "East Asian", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADe:ALL" }, @@ -577,7 +573,7 @@ { "name": "gnomADe:fin", "description": "Finnish", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADe:ALL" }, @@ -586,7 +582,7 @@ { "name": "gnomADe:nfe", "description": "Non-Finnish European", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADe:ALL" }, @@ -595,7 +591,7 @@ { "name": "gnomADe:oth", "description": "Other", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADe:ALL" }, @@ -604,7 +600,7 @@ { "name": "gnomADe:sas", "description": "South Asian", - "is_global": true, + "is_global": false, "super_population": { "name": "gnomADe:ALL" }, @@ -613,6 +609,6 @@ ] }, "extensions": { - "execution_time_in_seconds": 0.02 + "execution_time_in_seconds": 0.07 } -} +} \ No newline at end of file diff --git a/graphql_service/resolver/variant_model.py b/graphql_service/resolver/variant_model.py index 9e52c75..ee44cb8 100644 --- a/graphql_service/resolver/variant_model.py +++ b/graphql_service/resolver/variant_model.py @@ -29,6 +29,7 @@ QUERY_TYPE = QueryType() VARIANT_TYPE = ObjectType("Variant") VARIANT_ALLELE_TYPE = ObjectType("VariantAllele") +POPULATION_TYPE = ObjectType("Population") @QUERY_TYPE.field("variant") async def resolve_variant( @@ -163,10 +164,19 @@ def resolve_api( return {"api": {"major": "0", "minor": "1", "patch": "0-beta"}} + + + @QUERY_TYPE.field("populations") def resolve_populations(_: None, info: GraphQLResolveInfo, genome_id: str = None) -> List: current_directory = os.path.dirname(__file__) population_metadata_file = f"{current_directory}/../../common/file_model/population_metadata.json" with open(population_metadata_file) as pop_file: population_metadata = json.load(pop_file) - return population_metadata[genome_id] \ No newline at end of file + return population_metadata[genome_id] + +@POPULATION_TYPE.field("super_population") +## This may still break when queried for other fields in super_population +def resolve_super_population(population: Dict, info: GraphQLResolveInfo): + return population["super_population"] if population["super_population"] and population["super_population"]["name"] else None + From a032adfacd44760d0e6ae8411bf5443f5b105a1f Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Mon, 29 Jan 2024 11:17:23 +0000 Subject: [PATCH 24/29] Fixing the nullability logic in super_population --- common/schemas/population.graphql | 1 + graphql_service/resolver/variant_model.py | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/common/schemas/population.graphql b/common/schemas/population.graphql index 975cfa4..7e3e8c4 100644 --- a/common/schemas/population.graphql +++ b/common/schemas/population.graphql @@ -3,6 +3,7 @@ type Population{ Population """ name: String! + size: Int! description: String! type: String is_global: Boolean diff --git a/graphql_service/resolver/variant_model.py b/graphql_service/resolver/variant_model.py index ee44cb8..dae56f1 100644 --- a/graphql_service/resolver/variant_model.py +++ b/graphql_service/resolver/variant_model.py @@ -163,10 +163,6 @@ def resolve_api( ): # the second argument must be named `info` to avoid a NameError return {"api": {"major": "0", "minor": "1", "patch": "0-beta"}} - - - - @QUERY_TYPE.field("populations") def resolve_populations(_: None, info: GraphQLResolveInfo, genome_id: str = None) -> List: current_directory = os.path.dirname(__file__) From 518b5c84c44e2faa59898da819e9c52cb7388864 Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Mon, 29 Jan 2024 20:34:22 +0000 Subject: [PATCH 25/29] Fixed typo in population metadata file and removed the redundant workaround --- graphql_service/resolver/variant_model.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/graphql_service/resolver/variant_model.py b/graphql_service/resolver/variant_model.py index dae56f1..d4c4692 100644 --- a/graphql_service/resolver/variant_model.py +++ b/graphql_service/resolver/variant_model.py @@ -171,8 +171,4 @@ def resolve_populations(_: None, info: GraphQLResolveInfo, genome_id: str = None population_metadata = json.load(pop_file) return population_metadata[genome_id] -@POPULATION_TYPE.field("super_population") -## This may still break when queried for other fields in super_population -def resolve_super_population(population: Dict, info: GraphQLResolveInfo): - return population["super_population"] if population["super_population"] and population["super_population"]["name"] else None From f38e4875718e6336c779d2d7e578a105640e6fd9 Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Mon, 29 Jan 2024 20:44:27 +0000 Subject: [PATCH 26/29] Fixed typo in population metadata file and removed the redundant workaround --- common/file_model/population_metadata.json | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/common/file_model/population_metadata.json b/common/file_model/population_metadata.json index bf99f11..dcdb644 100644 --- a/common/file_model/population_metadata.json +++ b/common/file_model/population_metadata.json @@ -486,10 +486,7 @@ "description": "All gnomAD genomes individuals v3.1.2", "type": "regional", "is_global": true, - "super_population": - { - "name": null - }, + "super_population": null, "sub_populations": [ { "name": "gnomADg:afr" @@ -660,10 +657,7 @@ "description": "All gnomAD exomes individuals r2.1.1", "type": "regional", "is_global": true, - "super_population": - { - "name": null - }, + "super_population": null, "sub_populations": [ { "name": "gnomADe:afr" From b74af67741a095be126428884f1f2b6056e8eb85 Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Mon, 29 Jan 2024 20:45:19 +0000 Subject: [PATCH 27/29] Updated population.graphql to conform with VDM --- common/schemas/population.graphql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/common/schemas/population.graphql b/common/schemas/population.graphql index 7e3e8c4..6102f3f 100644 --- a/common/schemas/population.graphql +++ b/common/schemas/population.graphql @@ -5,10 +5,10 @@ type Population{ name: String! size: Int! description: String! - type: String - is_global: Boolean - is_from_genotypes: Boolean - display_group_name: String + type: String! + is_global: Boolean! + is_from_genotypes: Boolean! + display_group_name: String! super_population: Population - sub_populations: [Population] + sub_populations: [Population!]! } \ No newline at end of file From f3bfa145daf1990b620151d6ac6a2439df51276a Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Tue, 30 Jan 2024 11:05:40 +0000 Subject: [PATCH 28/29] Handling multiple maf and hpmaf alleles --- common/file_model/variant.py | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/common/file_model/variant.py b/common/file_model/variant.py index ecfa1b4..943c6ff 100644 --- a/common/file_model/variant.py +++ b/common/file_model/variant.py @@ -328,13 +328,33 @@ def set_frequency_flags(self): by_population_sorted = sorted(by_population, key=lambda item: item[0]) if len(by_population_sorted) >= 2: - maf_frequency, maf_allele, maf_population = by_population_sorted[-2] - pop_frequency_map[maf_allele][maf_population]["is_minor_allele"] = True - hpmaf.append([maf_frequency,maf_allele,maf_population]) + highest_frequency = by_population_sorted[-1][0] + maf_frequency = None + # When more than one allele has same maf and is not + # ref allele, we mark it as is_minor_allele + for pop in reversed(by_population_sorted[:-1]): + if pop[0] == highest_frequency: + continue + elif pop[0] < highest_frequency and not maf_frequency: + maf_frequency, maf_allele, maf_population = pop + pop_frequency_map[maf_allele][maf_population]["is_minor_allele"] = True + hpmaf.append([maf_frequency,maf_allele,maf_population]) + elif maf_frequency and pop[0] == maf_frequency and maf_allele != allele.ref: + pop_frequency_map[maf_allele][maf_population]["is_minor_allele"] = True + hpmaf.append([maf_frequency,maf_allele,maf_population]) + elif maf_frequency and pop[0] < maf_frequency: + break if len(hpmaf) > 0: hpmaf_sorted = sorted(hpmaf, key=lambda item: item[0]) - _, hpmaf_allele, hpmaf_population = hpmaf_sorted[-1] + hpmaf_frequency, hpmaf_allele, hpmaf_population = hpmaf_sorted[-1] pop_frequency_map[hpmaf_allele][hpmaf_population]["is_hpmaf"] = True + # When more than one allele has same maf, we mark it as is_hpmaf + for hpmaf_pop in reversed(hpmaf_sorted[:-1]): + if hpmaf_pop[0] == hpmaf_frequency: + hpmaf_frequency, hpmaf_allele, hpmaf_population = hpmaf_pop + pop_frequency_map[hpmaf_allele][hpmaf_population]["is_hpmaf"] = True + elif hpmaf_pop[0] < hpmaf_frequency: + break return pop_frequency_map From 4052b2c42dade3127285d0a1f0f916f39de978e7 Mon Sep 17 00:00:00 2001 From: Likhitha Surapaneni <10923198+likhitha-surapaneni@users.noreply.github.com> Date: Tue, 30 Jan 2024 16:35:33 +0000 Subject: [PATCH 29/29] Added display_group_name --- common/file_model/population_metadata.json | 160 ++++++++++++++------- 1 file changed, 107 insertions(+), 53 deletions(-) diff --git a/common/file_model/population_metadata.json b/common/file_model/population_metadata.json index dcdb644..50dd112 100644 --- a/common/file_model/population_metadata.json +++ b/common/file_model/population_metadata.json @@ -6,7 +6,8 @@ "description": "All phase 3 individuals", "type": "regional", "is_global": true, - "super_population": null, + "display_group_name": "1000 Genomes Project Phase 3", + "super_population":null, "sub_populations": [ { "name": "1000GENOMES:phase_3:AFR" @@ -30,7 +31,8 @@ "description": "African", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": { "name": "1000GENOMES:phase_3:ALL" }, @@ -60,7 +62,8 @@ "description": "American", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": { "name": "1000GENOMES:phase_3:ALL" }, @@ -84,7 +87,8 @@ "description": "East Asian", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": { "name": "1000GENOMES:phase_3:ALL" }, @@ -111,7 +115,8 @@ "description": "European", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": { "name": "1000GENOMES:phase_3:ALL" }, @@ -138,7 +143,8 @@ "description": "South Asian", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": { "name": "1000GENOMES:phase_3:ALL" }, @@ -165,7 +171,8 @@ "description": "African Caribbean in Barbados", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": { "name": "1000GENOMES:phase_3:AFR" }, @@ -177,9 +184,10 @@ "description": "African Ancestry in Southwest US", "type": "regional", "is_global": false, + "display_group_name": "1000 Genomes Project Phase 3", "super_population": { - "name": "1000GENOMES:phase_3:AFR" + "name": "1000GENOMES:phase_3:AFR" }, "sub_populations": [ @@ -190,7 +198,8 @@ "description": "Esan in Nigeria", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": { "name": "1000GENOMES:phase_3:AFR" }, @@ -203,7 +212,8 @@ "description": "Gambian in Western Division, The Gambia", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": { "name": "1000GENOMES:phase_3:AFR" }, @@ -216,7 +226,8 @@ "description": "Luhya in Webuye, Kenya", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": { "name": "1000GENOMES:phase_3:AFR" }, @@ -229,7 +240,8 @@ "description": "Mende in Sierra Leone", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": { "name": "1000GENOMES:phase_3:AFR" }, @@ -242,7 +254,8 @@ "description": "Colombian in Medellin, Colombia", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": { "name": "1000GENOMES:phase_3:AMR" }, @@ -255,7 +268,8 @@ "description": "Colombian in Medellin, Colombia", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": { "name": "1000GENOMES:phase_3:AMR" }, @@ -268,7 +282,9 @@ "description": "Peruvian in Lima, Peru", "type": "regional", "is_global": false, - "super_population": { + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": + { "name": "1000GENOMES:phase_3:AMR" }, "sub_populations": [ @@ -280,8 +296,10 @@ "description": "Puerto Rican in Puerto Rico", "type": "regional", "is_global": false, - "super_population": { - "name": "1000GENOMES:phase_3:AMR" + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": + { + "name": "1000GENOMES:phase_3:AMR" }, "sub_populations": [ @@ -292,7 +310,8 @@ "description": "Chinese Dai in Xishuangbanna, China", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": { "name": "1000GENOMES:phase_3:EAS" }, @@ -305,7 +324,8 @@ "description": "Han Chinese in Bejing, China", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": { "name": "1000GENOMES:phase_3:EAS" }, @@ -318,8 +338,10 @@ "description": "Southern Han Chinese, China", "type": "regional", "is_global": false, - "super_population": { - "name": "1000GENOMES:phase_3:EAS" + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": + { + "name": "1000GENOMES:phase_3:EAS" }, "sub_populations": [ @@ -330,7 +352,8 @@ "description": "Japanese in Tokyo, Japan", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": { "name": "1000GENOMES:phase_3:EAS" }, @@ -343,7 +366,8 @@ "description": "Kinh in Ho Chi Minh City, Vietnam", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": { "name": "1000GENOMES:phase_3:EAS" }, @@ -356,7 +380,8 @@ "description": " Utah residents with Northern and Western European ancestry", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": { "name": "1000GENOMES:phase_3:EUR" }, @@ -369,7 +394,8 @@ "description": "Finnish in Finland", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": { "name": "1000GENOMES:phase_3:EUR" }, @@ -382,7 +408,8 @@ "description": "British in England and Scotland", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": { "name": "1000GENOMES:phase_3:EUR" }, @@ -395,7 +422,8 @@ "description": "Iberian populations in Spain", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": { "name": "1000GENOMES:phase_3:EUR" }, @@ -408,7 +436,8 @@ "description": "Toscani in Italy", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": { "name": "1000GENOMES:phase_3:EUR" }, @@ -421,7 +450,8 @@ "description": "Bengali in Bangladesh", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": { "name": "1000GENOMES:phase_3:SAS" }, @@ -434,7 +464,8 @@ "description": "Gujarati Indian in Houston, TX", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": { "name": "1000GENOMES:phase_3:SAS" }, @@ -447,7 +478,8 @@ "description": "Indian Telugu in the UK", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": { "name": "1000GENOMES:phase_3:SAS" }, @@ -460,7 +492,8 @@ "description": "Punjabi in Lahore, Pakistan", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": { "name": "1000GENOMES:phase_3:SAS" }, @@ -473,7 +506,8 @@ "description": "Sri Lankan Tamil in the UK", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "1000 Genomes Project Phase 3", + "super_population": { "name": "1000GENOMES:phase_3:SAS" }, @@ -486,7 +520,8 @@ "description": "All gnomAD genomes individuals v3.1.2", "type": "regional", "is_global": true, - "super_population": null, + "display_group_name": "gnomAD genomes v3.1.2", + "super_population":null, "sub_populations": [ { "name": "gnomADg:afr" @@ -526,7 +561,8 @@ "description": "African/African American", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "gnomAD genomes v3.1.2", + "super_population": { "name": "gnomADg:ALL" }, @@ -539,7 +575,8 @@ "description": "Amish", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "gnomAD genomes v3.1.2", + "super_population": { "name": "gnomADg:ALL" }, @@ -552,7 +589,8 @@ "description": "Latino", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "gnomAD genomes v3.1.2", + "super_population": { "name": "gnomADg:ALL" }, @@ -565,7 +603,8 @@ "description": "Ashkenazi Jewish", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "gnomAD genomes v3.1.2", + "super_population": { "name": "gnomADg:ALL" }, @@ -578,7 +617,8 @@ "description": "East Asian", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "gnomAD genomes v3.1.2", + "super_population": { "name": "gnomADg:ALL" }, @@ -591,7 +631,8 @@ "description": "Finnish", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "gnomAD genomes v3.1.2", + "super_population": { "name": "gnomADg:ALL" }, @@ -605,7 +646,8 @@ "description": "Middle Eastern", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "gnomAD genomes v3.1.2", + "super_population": { "name": "gnomADg:ALL" }, @@ -618,7 +660,8 @@ "description": "Non-Finnish European", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "gnomAD genomes v3.1.2", + "super_population": { "name": "gnomADg:ALL" }, @@ -631,7 +674,8 @@ "description": "Other", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "gnomAD genomes v3.1.2", + "super_population": { "name": "gnomADg:ALL" }, @@ -644,7 +688,8 @@ "description": "South Asian", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "gnomAD genomes v3.1.2", + "super_population": { "name": "gnomADg:ALL" }, @@ -657,7 +702,8 @@ "description": "All gnomAD exomes individuals r2.1.1", "type": "regional", "is_global": true, - "super_population": null, + "display_group_name": "gnomAD exomes r2.1.1", + "super_population":null, "sub_populations": [ { "name": "gnomADe:afr" @@ -691,7 +737,8 @@ "description": "African/African American", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "gnomAD exomes r2.1.1", + "super_population": { "name": "gnomADe:ALL" }, @@ -704,7 +751,8 @@ "description": "Latino", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "gnomAD exomes r2.1.1", + "super_population": { "name": "gnomADe:ALL" }, @@ -717,7 +765,8 @@ "description": "Ashkenazi Jewish", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "gnomAD exomes r2.1.1", + "super_population": { "name": "gnomADe:ALL" }, @@ -730,7 +779,8 @@ "description": "East Asian", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "gnomAD exomes r2.1.1", + "super_population": { "name": "gnomADe:ALL" }, @@ -743,7 +793,8 @@ "description": "Finnish", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "gnomAD exomes r2.1.1", + "super_population": { "name": "gnomADe:ALL" }, @@ -757,7 +808,8 @@ "description": "Non-Finnish European", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "gnomAD exomes r2.1.1", + "super_population": { "name": "gnomADe:ALL" }, @@ -770,7 +822,8 @@ "description": "Other", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "gnomAD exomes r2.1.1", + "super_population": { "name": "gnomADe:ALL" }, @@ -783,7 +836,8 @@ "description": "South Asian", "type": "regional", "is_global": false, - "super_population": + "display_group_name": "gnomAD exomes r2.1.1", + "super_population": { "name": "gnomADe:ALL" },