Class HeatmapDataService
java.lang.Object
ubic.gemma.rest.HeatmapDataService
Assembles
HeatmapDataValueObject payloads for the
GET /datasets/{id}/heatmap-data endpoint. The service stays out of the
legacy sortVectorDataByDesign / prepareFactorsForFrontEndDisplay path
entirely — no reordering, no colour assignment, no factor-display strings on the wire.- Author:
- claude
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildHeatmapData(ExpressionExperiment ee, Collection<Long> geneIds, Collection<Long> probeIds, Long resultSetId, double threshold, Integer pcaComponent, int pcaCount, int sampleSize, String encoding, Long subSetId, QuantitationType quantitationType, boolean maskOutliers) Build a heatmap payload foreegiven a vector-selection mode.static double[][]decodeBase64Float32(String b64, int rowsCount, int colsCount) Decode a base64f32 string back into adouble[][]of the given shape.
-
Constructor Details
-
HeatmapDataService
public HeatmapDataService()
-
-
Method Details
-
buildHeatmapData
@Transactional(readOnly=true) public HeatmapDataValueObject buildHeatmapData(ExpressionExperiment ee, @Nullable Collection<Long> geneIds, @Nullable Collection<Long> probeIds, @Nullable Long resultSetId, double threshold, @Nullable Integer pcaComponent, int pcaCount, int sampleSize, String encoding, @Nullable Long subSetId, @Nullable QuantitationType quantitationType, boolean maskOutliers) Build a heatmap payload foreegiven a vector-selection mode. Caller has already resolvedeevia ACL. Exactly one ofgeneIds,probeIds,resultSetId,pcaComponentshould be non-null; if all are null the random sample-N path is used.- Parameters:
ee- dataset entity (ACL-resolved by caller)geneIds- query mode: vectors for these gene IDsprobeIds- query mode: vectors for these probe (composite-sequence) IDsresultSetId- query mode: top-hit vectors from this differential analysis result setthreshold- p-value threshold for the resultSetId mode (default 0.01)pcaComponent- query mode: top-loaded vectors for this PCA component (1-based)pcaCount- how many probes per PCA component (default 20)sampleSize- fallback random-N size when no other mode applies (default 20, max 200)encoding-"json"(default) or"base64f32"for the matrix encodingsubSetId- optionalExpressionExperimentSubSetid; when non-null, the response is restricted to that subset's sample columns. The subset must belong toee; otherwiseIllegalArgumentExceptionis raised.quantitationType- optionalQuantitationTypeto source the matrix from. Whennullor when it resolves to the dataset's processed QT, the processed-data path is used (all selection modes). For any other (non-processed) QT the raw vectors for that QT are served instead; thegeneIds/probeIdsselection modes and the random-sample fallback (sampleSize) are supported in that case, whileresultSetId/pcaComponentraiseIllegalArgumentException(no raw-vector equivalent). Non-DOUBLErepresentations (e.g. integer read-counts) are coerced to double.maskOutliers- whentrue(default) the values of assays flagged as outliers are masked toNaN. Whenfalsethe stored expression values are returned for those assays as well, by reading them back from the stored vectors. The row selection is unchanged either way; only the emitted values differ. For a non-processed QT (raw vectors) the stored value is always present, so this restores it. For the processed QT it restores whatever is on disk: today processed data is masked at creation time so this is usually a no-op, but it becomes effective if processed-data creation stops masking outliers on disk (or where a reprocess after an outlier flag failed). Legitimate missing values remainNaNregardless.
-
decodeBase64Float32
Decode a base64f32 string back into adouble[][]of the given shape. Provided for the test path and any server-side debugging; clients do their own decode.
-