Class BioMaterialValueObject

java.lang.Object
ubic.gemma.model.common.IdentifiableValueObject<BioMaterial>
ubic.gemma.model.expression.biomaterial.BioMaterialValueObject
All Implemented Interfaces:
Serializable, Identifiable

public class BioMaterialValueObject extends IdentifiableValueObject<BioMaterial>
Author:
lukem
See Also:
  • Constructor Details

    • BioMaterialValueObject

      public BioMaterialValueObject()
      Required when using the class as a spring bean.
    • BioMaterialValueObject

      public BioMaterialValueObject(Long id)
    • BioMaterialValueObject

      public BioMaterialValueObject(BioMaterial bm)
    • BioMaterialValueObject

      public BioMaterialValueObject(BioMaterial bm, BioAssay ba)
    • BioMaterialValueObject

      public BioMaterialValueObject(BioMaterial bm, boolean basic, boolean allFactorValuesAndCharacteristics)
      Parameters:
      basic - if true, populate fVBasicVOs instead of factorValueObjects. Note that basic FVs should be preferred for new code.
      allFactorValuesAndCharacteristics - whether to include all factor values and characteristics, including those inherited from the source biomaterial, otherwise only those from the sample will be included
  • Method Details

    • getFactorValues

      public Collection<? extends IdentifiableValueObject> getFactorValues()
    • getFactorValueObjects

      @Deprecated public Collection<? extends IdentifiableValueObject> getFactorValueObjects()
      Deprecated.
    • toString

      public String toString()
      Overrides:
      toString in class IdentifiableValueObject<BioMaterial>
    • getName

      public String getName()
    • getDescription

      public String getDescription()
    • getAssayName

      public String getAssayName()
    • getAssayDescription

      public String getAssayDescription()
    • getFastqHeaders

      public String getFastqHeaders()
    • getBioAssayIds

      public Collection<Long> getBioAssayIds()
      Related BioAssay IDs.
    • getCharacteristics

      public Collection<CharacteristicValueObject> getCharacteristics()
    • getStatements

      @Nullable public Collection<StatementValueObject> getStatements()
      The same annotations as characteristics, as statements — carrying the predicate and object when a curator wrote one.

      🛑 A sample annotation can be predicated: DatasetsWebService.tagToCharacteristic builds a Statement whenever the write carries a statement field, and it is the same method that writes experiment tags. CharacteristicValueObject has no predicate or object, so before this the sample payload flattened such an annotation to its subject on every read — a curator could write a predicated sample characteristic and never see it again.

      Null, and so absent from the payload, when the caller opted out with GET /datasets/{dataset}/samples?exclude=sample.statements. It is 21.5% of that response and every row in it also appears under characteristics minus the predicate and object, so a client that renders only subjects can decline it. It stays on by default: an opt-out that defaults to off would put predicated sample characteristics back out of sight, which is the thing this collection was added to end.

    • getSourceBioMaterialId

      @Nullable public Long getSourceBioMaterialId()
      The BioMaterial this one was derived from, or null if this is a sample in its own right.

      This is always null on GET /datasets/{dataset}/samples, for every dataset including single-cell ones, and that is the correct answer rather than missing data: that route returns the dataset's own assays, whose samples are the biological samples themselves and so derive from nothing. Derived samples are created only by single-cell aggregation, which files each {sample, cell type} population as a BioMaterial pointing back at the sample it came from, and hangs it off an ExpressionExperimentSubSet rather than the parent dataset. So the populated values are reached through GET /datasets/{dataset}/subSets/{subSet}/samples, where each value is the id of a sample the parent route returned.

      Do not read this field to decide whether a dataset is single-cell: it is null on single-cell datasets too, so the test silently answers "no" everywhere. Use the pre-added assay ExperimentTag (OBI_0002631 / OBI_0003109), or GET /datasets/{dataset}/singleCellDimension, which 404s for datasets that have no single-cell data.

    • getCharacteristicValues

      public Map<String,String> getCharacteristicValues()
    • getCharacteristicOriginalValues

      public Map<String,String> getCharacteristicOriginalValues()
      Map of categories to original text values (for this biomaterial). This is only used for display and will only be populated if the original value is different from the value.
    • isBasicFVs

      public boolean isBasicFVs()
      Indicate if this is using the fVBasicVOs or factorValueObjects for representing factor values.
    • getFVBasicVOs

      public Collection<FactorValueBasicValueObject> getFVBasicVOs()
      🛑 This field's JsonIgnore does not hide it: the payload carries an fvbasicVOs key regardless.

      Lombok generates the getter as getFVBasicVOs(), and a generated getter does not inherit the field's annotations. Jackson then derives an implicit property name from each accessor independently — fVBasicVOs from the field, fvbasicVOs from the getter (the bean de-capitalization rule lowercases the whole leading run of capitals in FVBasicVOs). Those two names are not equal, so Jackson never pairs the getter with the field, the @JsonIgnore applies only to the unpaired field, and the getter serializes as a property in its own right. The same shape on factorValueObjects is harmless because its getter is getFactorValueObjects(), whose implicit name does match its field.

      Repeating @JsonIgnore on getFVBasicVOs() closes it, and is deliberately NOT done here: fvbasicVOs has live readers in the curation-agents repos, which are being moved off it separately. Do not delete the getter either — BioAssayDimensionValueObject calls getFactorValueObjects() from Java, and Java-live is not the same as wire-live.

    • getFactorIdToFactorValueId

      public Map<String,String> getFactorIdToFactorValueId()
      Map of factor ids (factor232) to factor value (id or the actual value) for this biomaterial.
    • getAssayProcessingDate

      public Date getAssayProcessingDate()
    • setName

      public void setName(String name)
    • setDescription

      public void setDescription(String description)
    • setAssayName

      public void setAssayName(String assayName)
    • setAssayDescription

      public void setAssayDescription(String assayDescription)
    • setFastqHeaders

      public void setFastqHeaders(String fastqHeaders)
    • setBioAssayIds

      public void setBioAssayIds(Collection<Long> bioAssayIds)
      Related BioAssay IDs.
    • setCharacteristics

      public void setCharacteristics(Collection<CharacteristicValueObject> characteristics)
    • setStatements

      public void setStatements(@Nullable Collection<StatementValueObject> statements)
      The same annotations as characteristics, as statements — carrying the predicate and object when a curator wrote one.

      🛑 A sample annotation can be predicated: DatasetsWebService.tagToCharacteristic builds a Statement whenever the write carries a statement field, and it is the same method that writes experiment tags. CharacteristicValueObject has no predicate or object, so before this the sample payload flattened such an annotation to its subject on every read — a curator could write a predicated sample characteristic and never see it again.

      Null, and so absent from the payload, when the caller opted out with GET /datasets/{dataset}/samples?exclude=sample.statements. It is 21.5% of that response and every row in it also appears under characteristics minus the predicate and object, so a client that renders only subjects can decline it. It stays on by default: an opt-out that defaults to off would put predicated sample characteristics back out of sight, which is the thing this collection was added to end.

    • setSourceBioMaterialId

      public void setSourceBioMaterialId(@Nullable Long sourceBioMaterialId)
      The BioMaterial this one was derived from, or null if this is a sample in its own right.

      This is always null on GET /datasets/{dataset}/samples, for every dataset including single-cell ones, and that is the correct answer rather than missing data: that route returns the dataset's own assays, whose samples are the biological samples themselves and so derive from nothing. Derived samples are created only by single-cell aggregation, which files each {sample, cell type} population as a BioMaterial pointing back at the sample it came from, and hangs it off an ExpressionExperimentSubSet rather than the parent dataset. So the populated values are reached through GET /datasets/{dataset}/subSets/{subSet}/samples, where each value is the id of a sample the parent route returned.

      Do not read this field to decide whether a dataset is single-cell: it is null on single-cell datasets too, so the test silently answers "no" everywhere. Use the pre-added assay ExperimentTag (OBI_0002631 / OBI_0003109), or GET /datasets/{dataset}/singleCellDimension, which 404s for datasets that have no single-cell data.

    • setCharacteristicValues

      public void setCharacteristicValues(Map<String,String> characteristicValues)
    • setCharacteristicOriginalValues

      public void setCharacteristicOriginalValues(Map<String,String> characteristicOriginalValues)
      Map of categories to original text values (for this biomaterial). This is only used for display and will only be populated if the original value is different from the value.
    • setBasicFVs

      public void setBasicFVs(boolean basicFVs)
      Indicate if this is using the fVBasicVOs or factorValueObjects for representing factor values.
    • setFVBasicVOs

      public void setFVBasicVOs(Collection<FactorValueBasicValueObject> fVBasicVOs)
      🛑 This field's JsonIgnore does not hide it: the payload carries an fvbasicVOs key regardless.

      Lombok generates the getter as getFVBasicVOs(), and a generated getter does not inherit the field's annotations. Jackson then derives an implicit property name from each accessor independently — fVBasicVOs from the field, fvbasicVOs from the getter (the bean de-capitalization rule lowercases the whole leading run of capitals in FVBasicVOs). Those two names are not equal, so Jackson never pairs the getter with the field, the @JsonIgnore applies only to the unpaired field, and the getter serializes as a property in its own right. The same shape on factorValueObjects is harmless because its getter is getFactorValueObjects(), whose implicit name does match its field.

      Repeating @JsonIgnore on getFVBasicVOs() closes it, and is deliberately NOT done here: fvbasicVOs has live readers in the curation-agents repos, which are being moved off it separately. Do not delete the getter either — BioAssayDimensionValueObject calls getFactorValueObjects() from Java, and Java-live is not the same as wire-live.

    • setFactorValueObjects

      public void setFactorValueObjects(Collection<FactorValueValueObject> factorValueObjects)
    • setFactorValues

      public void setFactorValues(Map<String,String> factorValues)
      Map of ids (fv133) to a representation of the value (for this biomaterial.)
    • setFactorIdToFactorValueId

      public void setFactorIdToFactorValueId(Map<String,String> factorIdToFactorValueId)
      Map of factor ids (factor232) to factor value (id or the actual value) for this biomaterial.
    • setAssayProcessingDate

      public void setAssayProcessingDate(Date assayProcessingDate)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class IdentifiableValueObject<BioMaterial>
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class IdentifiableValueObject<BioMaterial>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class IdentifiableValueObject<BioMaterial>