plantbreeding / BrAPI

Repository for version control of the BrAPI specifications
https://brapi.org
MIT License
57 stars 32 forks source link

Directly link Germplasm to the source Cross #564

Open BrapiCoordinatorSelby opened 1 year ago

BrapiCoordinatorSelby commented 1 year ago

@daveneti from Slack

"... Or is the only way to know the cross that resulted in the germplasm via the inventory lot?"

@BrapiCoordinatorSelby from Slack

"This is an excellent point. I did some digging and there is no direct link between the cross and germplasm object. I assumed there was and I think there should be. In V2.1, crossDbId and germplasmDbId can only be linked through SeedLot.contentMixture or ObservationUnit. Both a seed lot and an observation unit can be created from a cross before a germplasm exists, and can therefor optionally hold both IDs. "

daveneti commented 4 months ago

There is a one-to-one relationship between cross and germplasm. If a cross is successful then a germplasm is created, so a Cross would zero or one germplasm. A Germplasm is created by a cross in the case of both generative and derivative breeding methods there are cases when a cross is not known or recorded. These include often self-crossing, open pollination, mutation etc. So a germplasm would have a zero or one crosses.

To the JSON schema model

To the Open API model

mlm483 commented 3 months ago

@BrapiCoordinatorSelby two possibly useful endpoint changes might be:

  1. adding parameters to the GET crosses endpoint to filter on parent1 and parent2 (by germplasmDbId would likely be most useful),
  2. adding a search endpoint for crosses, which could support an array of parent germplasmDbIds among other things.

I don't know how a client would know which germplasmDbId to send for "parent1" vs. "parent2", so 2. would probably be more useful (though more work to implement).

And for the search endpoint, I'm not sure if it could provide a way to get crosses with both all and any parent germplasmDbIds. Basically I could see potential use cases for an AND or OR type search. The search request body could contain two arrays of parent germplasmDbIds, one for "parent1" and one for "parent2", this would allow AND and OR type requests, but the implementation would probably need to check "parent1" and "parent2" against both fields since they don't seem to have a distinct meaning (like male/female). Also, are there use cases for crosses with more than 2 parents of record? That would further complicate things.

This is what the GET endpoint currently returns for the parents according to SwaggerHub.

"parent1": {
  "germplasmDbId": "d34b10c3",
  "germplasmName": "TME_419",
  "observationUnitDbId": "2e1926a7",
  "observationUnitName": "my_Plot_9001",
  "parentType": "MALE"
},
"parent2": {
  "germplasmDbId": "d34b10c3",
  "germplasmName": "TME_419",
  "observationUnitDbId": "2e1926a7",
  "observationUnitName": "my_Plot_9001",
  "parentType": "MALE"
},
keocorak commented 3 months ago

I agree that both AND and OR searches would be useful. Convention is that Female is usually parent1 (see breedbase BrAPI implementation, Purdy notation, etc) but a check would probably be warranted. Yes, there are use cases where the user would want to track a set of possible (male) parents.