@@ -235,6 +235,21 @@ private static void extracted(DiseaseAnnotationDocument annotation, org.alliance
235235 row .setGeneticEntityType ("Allele" );
236236 }
237237 }
238+ if (annotation .getCategory ().equals ("gene_disease_annotation" ) || annotation .getCategory ().equals ("allele_disease_annotation" )) {
239+ if (CollectionUtils .isNotEmpty (primaryAnnotation .getConditionRelations ())) {
240+ List <ConditionRelation > conditionModifiers = primaryAnnotation .getConditionRelations ().stream ()
241+ .filter (conditionRelation -> conditionRelation .getConditionRelationType () != null )
242+ .filter (conditionRelation -> conditionRelation .getConditionRelationType ().getName ().contains ("has_condition" )
243+ || conditionRelation .getConditionRelationType ().getName ().contains ("induced" )
244+ || conditionRelation .getConditionRelationType ().getName ().contains ("ameliorated" )
245+ || conditionRelation .getConditionRelationType ().getName ().contains ("exacerbated" )).toList ();
246+ List <String > experimentalConditionComponents = new ArrayList <>(conditionModifiers .stream ().map (conditionRelation -> conditionRelation .getConditionRelationType ().getName ()).toList ());
247+ conditionModifiers .forEach (conditionRelation -> conditionRelation .getConditions ().forEach (experimentalCondition -> {
248+ experimentalConditionComponents .add (experimentalCondition .getConditionSummary ());
249+ }));
250+ row .setExperimentalCondition (String .join ("," , experimentalConditionComponents ));
251+ }
252+ }
238253 if (primaryAnnotation .getDiseaseGeneticModifierRelation () != null ) {
239254 row .setDiseaseGeneticModifierRelation (primaryAnnotation .getDiseaseGeneticModifierRelation ().getName ());
240255 }
@@ -342,24 +357,6 @@ private DiseaseDownloadRow getBaseDiseaseDownloadRow(DiseaseAnnotationDocument a
342357 row.setSource(sourceProvider);
343358 }
344359*/
345- if (annotation .getCategory ().equals ("gene_disease_annotation" ) || annotation .getCategory ().equals ("allele_disease_annotation" )) {
346- if (annotation .getPrimaryAnnotations () != null ) {
347- for (org .alliancegenome .curation_api .model .entities .DiseaseAnnotation da : annotation .getPrimaryAnnotations ()) {
348- if (CollectionUtils .isNotEmpty (da .getConditionRelations ())) {
349- List <ConditionRelation > conditionModifiers = da .getConditionRelations ().stream ().filter (conditionRelation -> conditionRelation .getConditionRelationType () != null )
350- .filter (conditionRelation -> conditionRelation .getConditionRelationType ().getName ().contains ("has_condition" )
351- || conditionRelation .getConditionRelationType ().getName ().contains ("induced" )
352- || conditionRelation .getConditionRelationType ().getName ().contains ("ameliorated" )
353- || conditionRelation .getConditionRelationType ().getName ().contains ("exacerbated" )).toList ();
354- List <String > experimentalConditionComponents = new ArrayList <>(conditionModifiers .stream ().map (conditionRelation -> conditionRelation .getConditionRelationType ().getName ()).toList ());
355- conditionModifiers .forEach (conditionRelation -> conditionRelation .getConditions ().forEach (experimentalCondition -> {
356- experimentalConditionComponents .add (experimentalCondition .getConditionSummary ());
357- }));
358- row .setExperimentalCondition (String .join ("," , experimentalConditionComponents ));
359- }
360- }
361- }
362- }
363360 StringJoiner evidenceJoiner = getStringJoiner (primaryAnnotation , org .alliancegenome .curation_api .model .entities .ontology .ECOTerm ::getCurie );
364361 row .setEvidenceCode (evidenceJoiner .toString ());
365362
0 commit comments