plantbreeding / BrAPI

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

Make inventory more generic and species agnostic #545

Open shawnyarnes opened 2 years ago

shawnyarnes commented 2 years ago

To better support perennial plant and animal breeders

  1. Change the name "Seed Lots" to "Inventory Lots"
  2. Add a "Lot Type" that can be customized by application and/or species (seed, pollen, bud wood, root stocks eggs, etc..)
  3. Add "Lot Expiry", to support management of time-limited inventory
daveneti commented 2 years ago

Would it be possible to generalise it a little more to cover a 'plant'? Would the term Inventory Lot still be applicable to a Plant. Perhaps we can just use the term 'Lot'? So a plant, would be a Lot with Lot type 'plant'.

BrapiCoordinatorSelby commented 2 years ago

I'm not a huge fan of just "Lot", it is too generic and not descriptive enough. The intention of this endpoint is to record and control the inventory management for things that can grow into plants (seeds, root stock, etc). Planting or sending seeds away are transactions that reduce the amount in an inventory lot. Seed production adds to a lot. A cross might create a new lot.

@daveneti what would "lotType": "plant" relate to in the real world? can you describe the use case a little more? From previous conversation, I'm guessing you are talking about perennials, and I could see how you could have "inventory" to choose from to build an experiment, even though no seed production or planting is required because the perennial plants already exist. Is this kind of your idea?

daveneti commented 2 years ago

No problem, I am happy with 'Inventory Lot' , a plant can be an in Inventory Lot. You could also call it Inventory Item as a suggestion.

Here is the use case for plant lots.

Seed is sown and then transplanted out in to trays, usually 96 cell, 8 x 12. Leaf samples are taken for DNA to genotyped. Individual plants are grown on and put in to pots. Pots move from a glasshouse to a outdoor nursery at some stage. Based on the genotyping results and perhaps some phenotypic measurements, such as resistance/tolerance to endemic biotic stress, plants are kept, sometime moved within the nursey. When the field/orchard is ready to receive then, they are planted out either in mass into a newly prepared plots, or are used to replace plants that have been culled or have died. In the later case the same plot location is used for a new lot. This is a new plot in the system, but the plot location is the same. For several years many observations are taken on the plant, in different trials. After a few years, the plant is considered too valuable to be destroyed so it is moved to another field/orchard location. So as before new plot but same lot, new trial. This can occur several times. Although clonal propagation can also occur, in this case it is the same plant. In some cases plants are used a root stocks for clonal propagation. So as before the plant will move to another trial, but the location and the plant would remain the same, and a scion from a different germplasm is grafted on to this rootstock. The scion is then a separate lot, attached to plant lot. There can be several scions even form different germplasm on the same rootstock.

daveneti commented 1 year ago

Would a Inventory Lot, still continue to have a content mixture? Is there an opportunity to have a direct link to a single germplasm? I can understand that in a physical seed mixture (bulk) you can know the relative contributions of the germplasm in the mix, but is this a rare case?

BrapiCoordinatorSelby commented 1 year ago

The "content mixture" concept comes from @NPZInno in #466. They might want to comment on this discussion.

From a technical perspective, you do still have a direct link to a single germplasm if there is only one item in the content mixture list. Perhaps it is not as human readable, but the computer doesn't care if you reference seedLot.germplasmDbId or seedLot.contentMixture[0].germplasmDbId. For safety, you may want to include something like if (contentMixture.size == 1) ... just to make sure you aren't dealing with a special case.

From a conceptual perspective, we could add a field like primaryGermplasmDbId or something to indicate the primary thing in a lot and make it clear to a human reader that this is the germplasm we care about. I don't know if that concept makes sense for the seed mixture special case, if there is one germplasm in a mixture we care about more than the others. Maybe @NPZInno can chime in there.

ME-NPZ-Innovation commented 1 year ago

Would a Inventory Lot, still continue to have a content mixture? Is there an opportunity to have a direct link to a single germplasm? I can understand that in a physical seed mixture (bulk) you can know the relative contributions of the germplasm in the mix, but is this a rare case?

As suggested as an alternative option in our initial #466 another way of solving this, is to create another "inhomogenous" genotype and attach the mixture info there. Using this concept, a given lot item would have exactly one genotype connected (1:M -> Genotype:LotItem), as recommeded by @daveneti .

When I understand the current approach right (N:M -> Genotype:LotItem), there is no and should be no "primeryGermplasmDbId" IMHO, because this is a kind of interpretation which could greatly depend on the context of the request.

daveneti commented 1 year ago

Sorry for taking so long to get back to this. We will implement using contextMixture :)

daveneti commented 1 year ago

Can we add inventoryLotPUI as a field for InventoryLot.

daveneti commented 1 year ago

We would need to rename SeedLotTransaction to InventoryLotTransaction as well.

daveneti commented 1 year ago

The term 'Lot' is a little overloaded and is highly associated with 'seed', e.g, Seed Lot. Perhaps a better name would be InventoryUnit, to make it more generic?

trife commented 1 year ago

@daveneti I agree and this aligns well with other parts of the standard, as well (e.g., ObservationUnit)