Skip to content

Commit

Permalink
Merge pull request #247 from opencb/TASK-1111
Browse files Browse the repository at this point in the history
TASK-1111 Add Pharmagenomics data to CellBase
  • Loading branch information
jtarraga authored Jul 12, 2023
2 parents 924664d + 7aae905 commit d7e9c96
Show file tree
Hide file tree
Showing 23 changed files with 2,398 additions and 0 deletions.
30 changes: 30 additions & 0 deletions biodata-models/src/main/avro/variantAnnotation.avdl
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,35 @@ protocol VariantAnnotations {
union { null, array<string> } bibliography;
}

record PharmacogenomicsAlleles {
union { null, string } allele;
union { null, string } annotation;
union { null, string } description;
}

record PharmacogenomicsClinicalAnnotation {
union { null, string } variantId;
union { null, array<string> } geneNames;
union { null, array<string> } phenotypes;
union { null, array<string> } phenotypeTypes;
union { null, string } confidence;
union { null, string } score;
union { null, string } url;
union { null, string } summary;
union { null, array<string> } pubmed;
union { null, array<PharmacogenomicsAlleles> } alleles;
}

record Pharmacogenomics {
union { null, string } id;
union { null, string } name;
union { null, string } source;
union { null, array<string> } types;
union { null, string } smiles;
union { null, string } inChI;
union { null, array<PharmacogenomicsClinicalAnnotation> } annotations;
}

record GeneCancerAssociation {
union { null, string } id;
union { null, string } source;
Expand Down Expand Up @@ -299,6 +328,7 @@ protocol VariantAnnotations {
union { null, array<GeneMirnaTarget> } geneMirnaTargets;
union { null, array<GeneCancerAssociation> } geneCancerAssociations;
union { null, array<EvidenceEntry> } traitAssociation;
union { null, array<Pharmacogenomics> } pharmacogenomics;
union { null, array<GwasAssociation> } gwas;
union { null, array<CancerHotspotVariantAnnotation> } cancerHotspots;
union { null, array<Score> } functionalScore;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
package org.opencb.biodata.models.pharma;

import org.opencb.biodata.models.core.Xref;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class PharmaChemical {
private String id;
private String source;
private String name;
private List<String> genericNames;
private List<String> tradeNames;
private List<String> tradeMixtures;
private List<String> types;
private List<Xref> xrefs;
private String smiles;
private String inChI;
private List<PharmaVariantAnnotation> variants;
private List<PharmaGeneAnnotation> genes;

private Map<String, Object> attributes;

public PharmaChemical() {
this.genericNames = new ArrayList<>();
this.tradeNames = new ArrayList<>();
this.tradeMixtures = new ArrayList<>();
this.types = new ArrayList<>();
this.xrefs = new ArrayList<>();
this.variants = new ArrayList<>();
this.genes = new ArrayList<>();
this.attributes = new HashMap<>();
}

public PharmaChemical(String id, String source, String name, List<String> genericNames, List<String> tradeNames,
List<String> tradeMixtures, List<String> types, List<Xref> xrefs, String smiles, String inChI,
List<PharmaVariantAnnotation> variants, List<PharmaGeneAnnotation> genes, Map<String, Object> attributes) {
this.id = id;
this.source = source;
this.name = name;
this.genericNames = genericNames;
this.tradeNames = tradeNames;
this.tradeMixtures = tradeMixtures;
this.types = types;
this.xrefs = xrefs;
this.smiles = smiles;
this.inChI = inChI;
this.variants = variants;
this.genes = genes;
this.attributes = attributes;
}

@Override
public String toString() {
final StringBuilder sb = new StringBuilder("PharmaChemical{");
sb.append("id='").append(id).append('\'');
sb.append(", source='").append(source).append('\'');
sb.append(", name='").append(name).append('\'');
sb.append(", genericNames=").append(genericNames);
sb.append(", tradeNames=").append(tradeNames);
sb.append(", tradeMixtures=").append(tradeMixtures);
sb.append(", types=").append(types);
sb.append(", xrefs=").append(xrefs);
sb.append(", smiles='").append(smiles).append('\'');
sb.append(", inChI='").append(inChI).append('\'');
sb.append(", variants=").append(variants);
sb.append(", genes=").append(genes);
sb.append(", attributes=").append(attributes);
sb.append('}');
return sb.toString();
}

public String getId() {
return id;
}

public PharmaChemical setId(String id) {
this.id = id;
return this;
}

public String getSource() {
return source;
}

public PharmaChemical setSource(String source) {
this.source = source;
return this;
}

public String getName() {
return name;
}

public PharmaChemical setName(String name) {
this.name = name;
return this;
}

public List<String> getGenericNames() {
return genericNames;
}

public PharmaChemical setGenericNames(List<String> genericNames) {
this.genericNames = genericNames;
return this;
}

public List<String> getTradeNames() {
return tradeNames;
}

public PharmaChemical setTradeNames(List<String> tradeNames) {
this.tradeNames = tradeNames;
return this;
}

public List<String> getTradeMixtures() {
return tradeMixtures;
}

public PharmaChemical setTradeMixtures(List<String> tradeMixtures) {
this.tradeMixtures = tradeMixtures;
return this;
}

public List<String> getTypes() {
return types;
}

public PharmaChemical setTypes(List<String> types) {
this.types = types;
return this;
}

public List<Xref> getXrefs() {
return xrefs;
}

public PharmaChemical setXrefs(List<Xref> xrefs) {
this.xrefs = xrefs;
return this;
}

public String getSmiles() {
return smiles;
}

public PharmaChemical setSmiles(String smiles) {
this.smiles = smiles;
return this;
}

public String getInChI() {
return inChI;
}

public PharmaChemical setInChI(String inChI) {
this.inChI = inChI;
return this;
}

public List<PharmaVariantAnnotation> getVariants() {
return variants;
}

public PharmaChemical setVariants(List<PharmaVariantAnnotation> variants) {
this.variants = variants;
return this;
}

public List<PharmaGeneAnnotation> getGenes() {
return genes;
}

public PharmaChemical setGenes(List<PharmaGeneAnnotation> genes) {
this.genes = genes;
return this;
}

public Map<String, Object> getAttributes() {
return attributes;
}

public PharmaChemical setAttributes(Map<String, Object> attributes) {
this.attributes = attributes;
return this;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
package org.opencb.biodata.models.pharma;

import java.util.HashMap;
import java.util.Map;

public class PharmaClinicalAllele {
private String allele;
private String annotation;
private String description;

private Map<String, Object> attributes;

public PharmaClinicalAllele() {
this.attributes = new HashMap<>();
}

public PharmaClinicalAllele(String allele, String annotation, String description, Map<String, Object> attributes) {
this.allele = allele;
this.annotation = annotation;
this.description = description;
this.attributes = attributes;
}

@Override
public String toString() {
final StringBuilder sb = new StringBuilder("PharmaClinicalAllele{");
sb.append("allele='").append(allele).append('\'');
sb.append(", annotation='").append(annotation).append('\'');
sb.append(", description='").append(description).append('\'');
sb.append(", attributes=").append(attributes);
sb.append('}');
return sb.toString();
}

public String getAllele() {
return allele;
}

public PharmaClinicalAllele setAllele(String allele) {
this.allele = allele;
return this;
}

public String getAnnotation() {
return annotation;
}

public PharmaClinicalAllele setAnnotation(String annotation) {
this.annotation = annotation;
return this;
}

public String getDescription() {
return description;
}

public PharmaClinicalAllele setDescription(String description) {
this.description = description;
return this;
}

public Map<String, Object> getAttributes() {
return attributes;
}

public PharmaClinicalAllele setAttributes(Map<String, Object> attributes) {
this.attributes = attributes;
return this;
}
}
Loading

0 comments on commit d7e9c96

Please sign in to comment.