Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@ public final class BrAPIAdditionalInfoFields {
public static final String ENVIRONMENT_NUMBER = "environmentNumber";
public static final String STUDY_NAME = "studyName";
public static final String OBSERVATION_DATASET_ID = "observationDatasetId";
public static final String FEMALE_PARENT_UNKNOWN = "femaleParentUnknown";
public static final String MALE_PARENT_UNKNOWN = "maleParentUnknown";
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,27 @@ public List<Map<String, Object>> processListData(List<BrAPIGermplasm> germplasm,
}
}

if ((germplasmEntry.getPedigree() != null) && (!germplasmEntry.getPedigree().isEmpty())) {
Pedigree germPedigree = Pedigree.parsePedigreeString(germplasmEntry.getPedigree());
if (!germPedigree.maleParent.isEmpty()) {
row.put("Male Parent GID", Integer.parseInt(germPedigree.maleParent));
// Try getting parentGID otherwise look for unknownParent flag
if (germplasmEntry.getAdditionalInfo().get(BrAPIAdditionalInfoFields.GERMPLASM_MALE_PARENT_GID) != null) {
row.put("Male Parent GID", germplasmEntry.getAdditionalInfo()
.get(BrAPIAdditionalInfoFields.GERMPLASM_MALE_PARENT_GID).getAsInt());
} else if (germplasmEntry.getAdditionalInfo().get(BrAPIAdditionalInfoFields.MALE_PARENT_UNKNOWN) != null) {
if (germplasmEntry.getAdditionalInfo().get(BrAPIAdditionalInfoFields.MALE_PARENT_UNKNOWN).getAsBoolean()) {
row.put("Male Parent GID", 0);
}
if (!germPedigree.femaleParent.isEmpty()) {
row.put("Female Parent GID", Integer.parseInt(germPedigree.femaleParent));
} else {
log.error("Male Parent missing expected value");
}

if (germplasmEntry.getAdditionalInfo().get(BrAPIAdditionalInfoFields.GERMPLASM_FEMALE_PARENT_GID) != null) {
row.put("Female Parent GID", germplasmEntry.getAdditionalInfo()
.get(BrAPIAdditionalInfoFields.GERMPLASM_FEMALE_PARENT_GID).getAsInt());
} else if (germplasmEntry.getAdditionalInfo().get(BrAPIAdditionalInfoFields.FEMALE_PARENT_UNKNOWN) != null) {
if (germplasmEntry.getAdditionalInfo().get(BrAPIAdditionalInfoFields.FEMALE_PARENT_UNKNOWN).getAsBoolean()) {
row.put("Female Parent GID", 0);
}
} else {
log.error("Female Parent missing expected value");
}

// Synonyms
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,8 @@ else if (germplasmIndexByEntryNo.containsKey(germplasm.getFemaleParentEntryNo())
if (existingPedigree.isEmpty()) {
mappedBrAPIImport.get(i).getGermplasm().getBrAPIObject().setPedigree(pedigreeString.length() > 0 ? pedigreeString.toString() : null);
//Simpler to just always add boolean, but consider for logic that previous imported values won't have that additional info value
mappedBrAPIImport.get(i).getGermplasm().getBrAPIObject().putAdditionalInfoItem("femaleParentUnknown", femaleParentUnknown);
mappedBrAPIImport.get(i).getGermplasm().getBrAPIObject().putAdditionalInfoItem("maleParentUnknown", maleParentUnknown);
mappedBrAPIImport.get(i).getGermplasm().getBrAPIObject().putAdditionalInfoItem(BrAPIAdditionalInfoFields.FEMALE_PARENT_UNKNOWN, femaleParentUnknown);
mappedBrAPIImport.get(i).getGermplasm().getBrAPIObject().putAdditionalInfoItem(BrAPIAdditionalInfoFields.MALE_PARENT_UNKNOWN, maleParentUnknown);
}
}
}
Expand Down