fields = line.split("\t"); GeneTraitAssociation disease = new GeneTraitAssociation(fields[0], fields[4], fields[3], 0f, 0, new ArrayList<>(), new ArrayList<>(), "hpo"); addValueToMapElement(geneDiseaseAssociationMap, fields[1], disease); while ((line = bufferedReader.readLine()) != null) { fields = line.split("\t"); GeneTraitAssociation disease = new GeneTraitAssociation(fields[3], fields[4], "", Float.parseFloat(fields[5]), Integer.parseInt(fields[6]), Arrays.asList(fields[7]), Arrays.asList(fields[8].split(", ")), "disgenet"); addValueToMapElement(geneDiseaseAssociationMap, fields[1], disease);
if (geneTraitAssociation != null) { Document d = new Document(); putNotNull(d, GENE_TRAIT_ID_FIELD, geneTraitAssociation.getId()); putNotNull(d, GENE_TRAIT_NAME_FIELD, geneTraitAssociation.getName()); putNotNull(d, GENE_TRAIT_SCORE_FIELD, geneTraitAssociation.getScore()); putNotNull(d, GENE_TRAIT_HPO_FIELD, geneTraitAssociation.getHpo()); if (StringUtils.isNotEmpty(geneTraitAssociation.getHpo())) { xrefs.add(convertXrefToStorage(geneTraitAssociation.getHpo(), "hpo")); putNotNull(d, GENE_TRAIT_PUBMEDS_FIELD, geneTraitAssociation.getNumberOfPubmeds()); putNotNull(d, GENE_TRAIT_TYPES_FIELD, geneTraitAssociation.getAssociationTypes()); putNotNull(d, GENE_TRAIT_SOURCES_FIELD, geneTraitAssociation.getSources()); putNotNull(d, GENE_TRAIT_SOURCE_FIELD, geneTraitAssociation.getSource());
&& CollectionUtils.isNotEmpty(variantAnnotation.getGeneTraitAssociation())) { for (GeneTraitAssociation geneTraitAssociation : variantAnnotation.getGeneTraitAssociation()) { switch (geneTraitAssociation.getSource().toLowerCase()) { case "hpo": traits.add("HP" + FIELD_SEP + geneTraitAssociation.getHpo() + FIELD_SEP + geneTraitAssociation.getId() + " -- " + geneTraitAssociation.getName()); break;
case "HP": GeneTraitAssociation geneTraitAssociation = new GeneTraitAssociation(); geneTraitAssociation.setHpo(fields[1]); geneTraitAssociation.setId(fields[2]); geneTraitAssociation.setName(fields[3]); geneTraitAssociationList.add(geneTraitAssociation); break;
List<Document> list = (List) object.get(GENE_TRAIT_FIELD); for (Document document : list) { geneTraitAssociations.add(new GeneTraitAssociation( getDefault(document, GENE_TRAIT_ID_FIELD, ""), getDefault(document, GENE_TRAIT_NAME_FIELD, ""),
@Override public GeneTraitAssociation build() { try { GeneTraitAssociation record = new GeneTraitAssociation(); record.id = fieldSetFlags()[0] ? this.id : (java.lang.String) defaultValue(fields()[0]); record.name = fieldSetFlags()[1] ? this.name : (java.lang.String) defaultValue(fields()[1]); record.hpo = fieldSetFlags()[2] ? this.hpo : (java.lang.String) defaultValue(fields()[2]); record.score = fieldSetFlags()[3] ? this.score : (java.lang.Float) defaultValue(fields()[3]); record.numberOfPubmeds = fieldSetFlags()[4] ? this.numberOfPubmeds : (java.lang.Integer) defaultValue(fields()[4]); record.associationTypes = fieldSetFlags()[5] ? this.associationTypes : (java.util.List<java.lang.String>) defaultValue(fields()[5]); record.sources = fieldSetFlags()[6] ? this.sources : (java.util.List<java.lang.String>) defaultValue(fields()[6]); record.source = fieldSetFlags()[7] ? this.source : (java.lang.String) defaultValue(fields()[7]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }