@sjcrh/proteinpaint-types 2.210.1-0 → 2.211.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/routes/hicgenome.ts", "../src/routes/termdb.bubbleHeatmap.ts", "../src/routes/termdb.categories.ts", "../src/routes/termdb.chat.ts", "../src/routes/termdb.descrstats.ts", "../src/routes/termdb.diffMeth.ts", "../src/routes/termdb.percentile.ts", "../src/routes/termdb.rootterm.ts", "../src/routes/termdb.runChart.ts", "../src/routes/termdb.singleCellPlots.ts", "../src/routes/termdb.termchildren.ts", "../src/routes/termdb.violinBox.ts", "../src/terms/constants.ts", "../src/terms/pseudobulk.ts"],
|
|
4
|
-
"sourcesContent": ["import type { BaseHicRequest, XYZCoord } from './hicdata.ts'\n\nexport type HicGenomeRequest = BaseHicRequest & {\n\t/** Entire chromosome list read from the file (see hicstate) */\n\tchrlst: string[]\n\t/** window location */\n\tembedder: string\n\t/** whether or not the file contains 'chr' for the chromosomes */\n\tnochr: boolean\n}\n\nexport type HicGenomeResponse = {\n\tdata: {\n\t\t/** First chromosome */\n\t\tlead: string\n\t\t/** Second chromosome */\n\t\tfollow: string\n\t\titems: XYZCoord[]\n\t}[]\n\t/** Error message to display on the client, if applicable */\n\terror?: string\n}\n\n// TODO: write payload examples to help with automated testing and documentation, for non-prod use only\n// The example below will not work in github CI where only termdb test\nexport const hicGenomePayloadExample = {\n\texamples: [\n\t\t{\n\t\t\trequest: {\n\t\t\t\tbody: {\n\t\t\t\t\tembedder: 'localhost',\n\t\t\t\t\turl: 'https://proteinpaint.stjude.org/ppdemo/hg19/hic/hic_demo.hic',\n\t\t\t\t\tmatrixType: 'observed',\n\t\t\t\t\tnmeth: 'NONE',\n\t\t\t\t\tpos1: '3',\n\t\t\t\t\tpos2: '2',\n\t\t\t\t\tresolution: 1000000\n\t\t\t\t} // satisfies HicGenomeRequest // TODO: fix the type or example\n\t\t\t},\n\t\t\tresponse: {\n\t\t\t\theader: { status: 200 }\n\t\t\t}\n\t\t}\n\t]\n}\n", "import type { ErrorResponse } from './errorResponse.ts'\n\nexport type BubbleHeatmapRequest = {\n\tgenome: string\n\tdslabel: string\n\tgene: string\n}\n\n/** One modification site (PTM) or one protein-level measurement (whole/insoluble\n * proteome). PTM cells carry many of these; protein-level cells carry exactly one. */\nexport type BubbleSite = {\n\t/** site identifier \u2014 the DAPfile `identifier` column (modified peptide for PTM,\n\t * e.g. `K.VAVVRT%PPKSPSS*AK.S`; protein id for protein-level rows) */\n\tid: string\n\t/** raw per-site log2 fold change from the DAPfile */\n\tlog2FC: number\n\t/** per-site FDR (adjusted p-value) from the DAPfile */\n\tfdr: number\n\t/** true when fdr < the response's fdrThreshold; non-significant sites\n\t * are still returned (the client draws non-significant protein-level dots faded\n\t * and hides non-significant PTM sites) */\n\tsignificant: boolean\n\t/** matched reference-assay (total protein) log2FC for this protein (base UniProt\n\t * acc) + cohort, if available */\n\tproteinLog2FC?: number\n\t/** protein-abundance-adjusted change = log2FC \u2212 proteinLog2FC (point estimate),\n\t * present only when proteinLog2FC is available */\n\tadjustedLog2FC?: number\n\t/** true when a matched protein value existed and adjustedLog2FC was computed */\n\tadjustedAvailable: boolean\n}\n\nexport type BubbleCell = {\n\t/** all sites for this (acc, assay, cohort); one entry for protein-level assays */\n\tsites: BubbleSite[]\n}\n\nexport type BubbleHeatmapIsoform = {\n\tgene_name: string\n\t/** data[assay][cohort] \u2192 cell (omitted when the cohort doesn't exist under the\n\t * assay or the gene has no row in that DAPfile) */\n\tdata: {\n\t\t[assay: string]: {\n\t\t\t[cohort: string]: BubbleCell\n\t\t}\n\t}\n}\n\nexport type BubbleHeatmapResponse =\n\t| ErrorResponse\n\t| {\n\t\t\tisoforms: { [isoformId: string]: BubbleHeatmapIsoform }\n\t\t\t/** subset of `assays` that are PTM assays \u2014 rendered as multiple small\n\t\t\t * per-site dots; the rest render as a single big dot per cell */\n\t\t\tptmAssays: string[]\n\t\t\t/** Row order */\n\t\t\tassays: string[]\n\t\t\t/** Column order */\n\t\t\tcohorts: string[]\n\t\t\t/** FDR threshold below which a site is significant. Sites with\n\t\t\t * fdr \u2265 threshold are still returned with `significant: false`; the client\n\t\t\t * draws non-significant protein-level dots faded and omits non-significant\n\t\t\t * PTM sites. */\n\t\t\tfdrThreshold: number\n\t\t\t/** assay used as the total-protein baseline for protein-abundance\n\t\t\t * adjustment, or null when adjustment is not configured for this dataset */\n\t\t\tproteinReferenceAssay: string | null\n\t }\n\nexport const bubbleHeatmapPayload = {\n\trequest: { typeId: 'BubbleHeatmapRequest' },\n\tresponse: { typeId: 'BubbleHeatmapResponse' }\n}\n", "import type { Filter } from '../filter.ts'\nimport type { TermWrapper } from '../terms/tw.ts'\n\nexport type CategoriesRequest = {\n\tgenome: string\n\tdslabel: string\n\tembedder: string\n\t/** termwrapper object */\n\ttw: TermWrapper\n\tfilter?: Filter\n\tfilter0?: any\n\t/** quick fix only for gdc */\n\tcurrentGeneNames?: string[]\n\t/** optional property added by mds3 tk, to limit to cases mutated in this region */\n\trglst?: any\n}\n\ninterface Entries {\n\tsamplecount: number\n\tkey: string\n\tlabel: string\n}\n\n/** number of samples per mutation class, k: mclass key (e.g. \"M\") */\ntype DtClasses = { [mclass: string]: number }\n\n/** a distinct pair of breakpoints of the sv/fusion events of a MnameEntry: one on the\n * queried gene and one on the partner gene named by that entry's mname. lets the\n * term-editing UIs chart the breakpoints of either gene, and select a range of them */\nexport type BreakpointEntry = {\n\t/** breakpoint on the queried gene */\n\tpos: number\n\t/** chr of the partner gene, may differ from that of the queried gene */\n\tpartnerChr: string\n\t/** breakpoint on the partner gene */\n\tpartnerPos: number\n\t/** samples having a sv/fusion of both these breakpoints. NOTE these counts are per\n\t * pair, so summing them across the breakpoints of one .pos (e.g. to chart the\n\t * breakpoints of the queried gene alone) may count a sample with two events at\n\t * that position, to different partners, more than once */\n\tsamplecount: number\n}\n\n/** an amino acid change (e.g. \"G12D\") and its sample count, within a mutation class.\n * for a sv/fusion, .mname is the partner gene (or its chr when unannotated) */\nexport type MnameEntry = {\n\tmname: string\n\tclass: string\n\tsamplecount: number\n\t/** gene of this variant, only present when annotated on the mutation data;\n\t * distinguishes variants of a geneVariant term with multiple genes */\n\tgene?: string\n\t/** breakpoints of the sv/fusion events of this entry, sorted by ascending position.\n\t * only present for a sv/fusion dt, and only for events carrying coordinates */\n\tbreakpoints?: BreakpointEntry[]\n\t/** number of samples whose sv/fusion events of this entry lack a breakpoint\n\t * coordinate, and so are absent from .breakpoints and cannot satisfy a breakpoint\n\t * range. only present when non-zero, so that the ui may caveat the chart */\n\tnoPositionCount?: number\n}\n\n/** per-dt entry returned for a geneVariant term without groupsetting */\nexport type GvCategoryEntry = {\n\tdt: number\n\tclasses: DtClasses | { byOrigin: { [origin: string]: DtClasses } }\n\t/** amino acid changes present for this dt, sorted by descending sample count.\n\t * only served by the termdb/categories route, and only when the mutation data\n\t * carries mname; the same entries returned within a data request (see\n\t * mayGetCategories() in termdb.matrix.js) omit this field */\n\tmnames?: MnameEntry[] | { byOrigin: { [origin: string]: MnameEntry[] } }\n}\n\nexport type CategoriesResponse = {\n\tlst: Entries[] | GvCategoryEntry[]\n\torderedLabels?: []\n}\n\n// TODO: write more payload examples to help with automated testing and documentation, for non-prod use only\n\nexport const termdbCategoriesPayloadExamples = {\n\trequest: {\n\t\ttypeId: 'CategoriesRequest'\n\t},\n\tresponse: {\n\t\ttypeId: 'CategoriesResponse'\n\t},\n\texamples: [\n\t\t{\n\t\t\trequest: {\n\t\t\t\tbody: {\n\t\t\t\t\tgenome: 'hg38-test',\n\t\t\t\t\tdslabel: 'TermdbTest',\n\t\t\t\t\tembedder: 'localhost',\n\t\t\t\t\ttw: { id: 'diaggrp' },\n\t\t\t\t\tfilter: {\n\t\t\t\t\t\ttype: 'tvslst',\n\t\t\t\t\t\tin: true,\n\t\t\t\t\t\tjoin: '',\n\t\t\t\t\t\tlst: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//tag: 'cohortFilter',\n\t\t\t\t\t\t\t\ttype: 'tvs',\n\t\t\t\t\t\t\t\ttvs: {\n\t\t\t\t\t\t\t\t\tterm: {\n\t\t\t\t\t\t\t\t\t\tname: 'Cohort',\n\t\t\t\t\t\t\t\t\t\ttype: 'categorical',\n\t\t\t\t\t\t\t\t\t\tvalues: { ABC: { label: 'ABC' }, XYZ: { label: 'XYZ' } },\n\t\t\t\t\t\t\t\t\t\tid: 'subcohort',\n\t\t\t\t\t\t\t\t\t\tisleaf: false,\n\t\t\t\t\t\t\t\t\t\tgroupsetting: { disabled: true }\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tvalues: [{ key: 'ABC', label: 'ABC' }]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t} // satisfies CategoriesRequest // TODO: use the type definition\n\t\t\t},\n\t\t\tresponse: {\n\t\t\t\theader: { status: 200 }\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t// geneVariant term without groupsetting, returns per-dt entries\n\t\t\t// with classes and mnames (amino acid changes), see GvCategoryEntry\n\t\t\trequest: {\n\t\t\t\tbody: {\n\t\t\t\t\tgenome: 'hg38-test',\n\t\t\t\t\tdslabel: 'TermdbTest',\n\t\t\t\t\tembedder: 'localhost',\n\t\t\t\t\ttw: {\n\t\t\t\t\t\tterm: { type: 'geneVariant', name: 'TP53', genes: [{ kind: 'gene', gene: 'TP53' }] },\n\t\t\t\t\t\tq: { type: 'values' }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tresponse: {\n\t\t\t\theader: { status: 200 }\n\t\t\t}\n\t\t}\n\t]\n}\n", "import type { TermTypes } from '../terms/constants.ts'\nimport type { Filter } from '../filter.ts'\n\n/** */\n// Helps track ambiguous points in the LLM reasoning process for debugging and improvement purposes.\n// Create a fresh array per request/pipeline run to avoid sharing mutable state across module consumers.\nexport const createAmbiguousPoints = (): string[] => []\n\nexport type ChatRequest = {\n\tgenome: string\n\tdslabel: string\n\tfilter?: Filter\n\t/** user prompt */\n\tprompt: string\n\t__protected__?: any\n}\n\nexport type TextResponse = {\n\ttype: 'text'\n\t/** Plain text message to display in the chat */\n\ttext: string\n}\nexport type HtmlResponse = {\n\ttype: 'html'\n\t/** Pre-approved HTML from the dataset JSON resources array */\n\thtml: string\n}\nexport type PlotResponse = {\n\ttype: 'plot'\n\tplot: object\n\tmsg?: string\n\t/** Specifies what action to take e.g. Summary plot or no action. Will add more chart types later */\n}\n\nexport interface GeneDataTypeResult {\n\tgene: string\n\tdataType: string\n}\n\n/** Gene data types a dataset supports, for the mass omnisearch to decide which gene-search actions\n * (expression / variant sub-types / methylation / genome browser) to offer. */\nexport interface GeneDataTypeAvailability {\n\tgeneExpression: boolean\n\tdnaMethylation: boolean\n\tsnvindel: boolean\n\tcnv: boolean\n\tsvfusion: boolean\n\t/** True when any genomic-alteration data type (snvindel/cnv/svfusion) is available, meaning a\n\t * genome browser can be seeded for the gene. Derived from the three flags above. */\n\tgenomeBrowser: boolean\n}\n\n/** One matched gene together with the data types available for that specific gene. */\nexport interface GeneMatch {\n\tgene: string\n\tdataTypes: GeneDataTypeAvailability\n\t/** Default genomic coordinate for the gene, used to seed a genome browser track (e.g. the DNA\n\t * methylation region picker) so the client needs no separate genelookup request. Null when the\n\t * gene is not resolved to a coordinate (only resolved for genes that need a genome browser). */\n\tcoord: { chr: string; start: number; stop: number } | null\n}\n\n/** One matched sample. Only sent when the dataset allows displaying sample ids\n * (authApi.canDisplaySampleIds); a dataset that does not permit it yields no samples at all, so the\n * client needs no permission check of its own. */\nexport interface SampleMatch {\n\tid: number | string\n\tname: string\n\t/** Sample selection for the single-cell viewer, when this sample has single-cell data. */\n\tsingleCell?: { sID: string; eID?: string }\n\t/** Facet-table assays available for this sample, when track-list facet data exists. */\n\tassays?: { facet: string; names: string[] }[]\n\t/** true when the sample has plain whole-slide images on disk\n\t (ds.queries.w2.wsiFolder); shows the \"Whole Slide Images\" action */\n\twsimages?: boolean\n}\n\n/** Result of the mass omnisearch: matched dictionary terms and matched genes, each carrying its own\n * available gene data types so the client can offer the appropriate per-gene action buttons. */\nexport interface OmnisearchResult {\n\tdictionaryTerms: any[]\n\tgenes: GeneMatch[]\n\t/** Matched samples. Always [] for a dataset that does not allow displaying sample ids. */\n\tsamples: SampleMatch[]\n\t/** Total match count per result type BEFORE the per-type display cap. Lets the client show a\n\t * \"Displaying N out of M\" note when a type's matches were truncated (total > the returned array length). */\n\ttotals?: { dictionaryTerms: number; genes: number; samples: number }\n\t/** Parsed genomic coordinate when the prompt is a valid \"chr:start-stop\" range AND the dataset\n\t * supports the genome browser genomic view (has snvindel/cnv/svfusion and gbRestrictMode !== 'protein').\n\t * Null/absent otherwise. Resolved server-side (via string2pos) so the client needs no genome object. */\n\tcoord?: { chr: string; start: number; stop: number } | null\n\terror?: any\n}\n\nexport type LlmConfig = {\n\tprovider: 'SJ' | 'ollama' | 'huggingface' | 'azure'\n\tEmbeddingProvider: 'SJ' | 'ollama' | 'huggingface'\n\tEmbeddingProviderApi: string\n\tapi: string\n\tapiToken?: string\n\tEmbeddingProviderApiToken?: string\n\tmodel: ModelConfig\n\tembeddingModelName: string\n\t/** Whether to load the embedding model locally (via transformers.js) or call a remote API. Defaults to 'api'. */\n\tembeddingModelAccess?: 'local' | 'api'\n\t/** Smaller model to use for LLM classification fallback. Defaults to `model` if not set. */\n\tclassifierModelConfig?: ModelConfig\n\t/** Log verbose debug output (e.g. raw embedding arrays) to the terminal. Defaults to false. */\n\tverbose?: boolean\n}\n\nexport type ModelConfig = {\n\tmodelName: string\n\tmaxTokens: number\n}\n\nexport interface GeneSetDataTypeResult {\n\tgeneSet: string\n\tdataType: typeof TermTypes.SSGSEA | typeof TermTypes.GENE_VARIANT | 'ambiguous' | typeof TermTypes.GENE_EXPRESSION\n}\n\nexport type ChatResponse = TextResponse | HtmlResponse | PlotResponse\n\nexport type SummaryType = {\n\t/** Name of 1st term */\n\tterm: string\n\t/** Name of 2nd term */\n\tterm2?: string\n\t/** Optional simple filter terms */\n\tsimpleFilter: FilterTerm[]\n\t/** Optional explicit child type requested by the user. If omitted, the logic of the data types picks the child type. */\n\tchildType?: 'violin' | 'boxplot' | 'sampleScatter' | 'barchart'\n}\n\nexport type FilterTerm =\n\t| CategoricalFilterTerm\n\t| NumericFilterTerm /** FilterTerm can either be numeric or categorical */\n\nexport type CategoricalFilterTerm = {\n\t/** Name of categorical term */\n\tterm: string\n\t/** The category of the term */\n\tcategory: string\n\t/** join term to be used only when there is more than one filter term and should be placed from the 2nd filter term onwards describing how it connects to the previous term */\n\tjoin?: 'and' | 'or'\n}\n\nexport type NumericFilterTerm = {\n\t/** Name of numeric term */\n\tterm: string\n\t/** start position (or lower limit) of numeric term */\n\tstart?: number\n\t/** stop position (or upper limit) of numeric term */\n\tstop?: number\n\t/** join term to be used only when there is more than one filter term and should be placed from the 2nd filter term onwards describing how it connects to the previous term */\n\tjoin?: 'and' | 'or'\n}\n\nexport type DbRows = {\n\t/** Name of the term */\n\tname: string\n\t/** Description of the term in plain language */\n\tdescription: string\n\t/** The type of variable stored in the DB (e.g. categorical, float) */\n\tterm_type: string\n\t/** Array of {key,value} terms storing the possible categories for a categorical variable */\n\tvalues: DbValue[]\n}\n\nexport type DbValue = {\n\t/** Name of the key */\n\tkey: string\n\t/** Object of values corresponding to the key */\n\tvalue: any\n}\n\nexport type ClassificationType =\n\t| plot_type\n\t| resource_type\n\t| none_type /** Variable containing the type of action the UI needs to take */\n\nexport type plot_type = {\n\t/** When type == plot, show the corresponding plot in the plot field */\n\ttype: 'plot'\n\t/** The type of plot to be displayed on the UI.\n\t * Standard categories are listed; datasets may define additional custom categories. */\n\tplot: 'summary' | 'dge' | 'survival' | 'matrix' | 'sampleScatter' | 'hierCluster' | 'genomeBrowser'\n}\n\nexport type resource_type = {\n\t/** When type == resource, invoke the resource agent to return a matching resource link */\n\ttype: 'resource'\n}\n\nexport type none_type = {\n\t/** When type == none, the query did not match any known category */\n\ttype: 'none'\n}\n\n/** Top-level classification returned by classifyQuery: plot or notplot (subtype determined separately by plot.ts) */\nexport type QueryClassification = { type: 'plot' } | { type: 'notplot' } | { type: 'binaryQuery' }\n\n/** Specific plot type returned by classifyPlotType in plot.ts */\nexport type PlotType =\n\t| 'summary'\n\t| 'dge'\n\t| 'survival'\n\t| 'cox'\n\t| 'matrix'\n\t| 'prebuiltscatter'\n\t| 'hiercluster'\n\t| 'genomeBrowser'\n\nexport type DEType = {\n\t/** Name of group1 which is an array of filter terms */\n\tgroup1: FilterTerm[]\n\t/** Name of group2 which is an array of filter terms */\n\tgroup2: FilterTerm[]\n\t/** Method used for carrying out differential gene expression analysis */\n\tmethod?: 'edgeR' | 'limma' | 'wilcoxon'\n}\n\nexport type MatrixType = {\n\t/** Names of dictionary terms to include as rows in the matrix (e.g. \"Diagnosis\", \"Gender\", \"Race\") */\n\tterms?: string[]\n\t/** Names of genes to include as gene variant rows in the matrix (e.g. \"TP53\", \"KRAS\", \"NRAS\") */\n\tgeneNames?: string[]\n\t/** Names of gene sets containing ssGSEA enrichment scores */\n\tgenesetNames?: string[]\n\t/** Optional simple filter terms to restrict the sample set */\n\tsimpleFilter?: FilterTerm[]\n}\n\nexport type HierClusterType = {\n\t/** Names of genes to include in the hierarchical clustering (e.g. \"TP53\", \"KRAS\", \"BCR\") */\n\tgeneNames?: string[]\n\t/** Names of gene sets containing list of genes to be used for hierarchical clustering */\n\tgenesetNames?: string[]\n\t/** Optional simple filter terms to restrict the sample set */\n\tsimpleFilter?: FilterTerm[]\n}\n\nexport type SampleScatterType = {\n\t/** Name of the pre-built plot (e.g. \"Transcriptome t-SNE\", \"Transcriptome UMAP\") */\n\tplotName: string\n\t/** Term or gene name to overlay as color, or null to remove color overlay */\n\tcolorTW?: string | null\n\t/** Term or gene name to overlay as shape, or null to remove shape overlay */\n\tshapeTW?: string | null\n\t/** Term or gene name to overlay as Z-divide, or null to remove divide overlay */\n\tterm0?: string | null\n\t/** Optional simple filter terms */\n\tsimpleFilter?: FilterTerm[]\n}\n", "import type { Filter } from '../filter.ts'\nimport type { TermWrapper } from '../terms/tw.ts'\n\nexport type DescrStatsRequest = {\n\t/** genome label in the serverconfig.json */\n\tgenome: string\n\t/** dataset label for the given genome */\n\tdslabel: string\n\t// embedder: string\n\t/** wrapper of a numeric term, q.mode can be any as getData() will always pull sample-level values for summarizing */\n\ttw: TermWrapper\n\t/** if true, the (violin) plot is in log scale and must exclude 0-values from the stat */\n\tlogScale?: boolean\n\t/** optional pp filter */\n\tfilter?: Filter\n\t/** optional gdc filter */\n\tfilter0?: any\n}\n\nexport type DescrStats = {\n\t[key: string]: {\n\t\tkey: string\n\t\tlabel: string\n\t\tvalue: number\n\t}\n}\n\nexport type DescrStatsResponse = DescrStats\n\n// TODO: write more payload examples to help with automated testing and documentation, for non-prod use only\n\nexport const descrStatsPayloadExamples = {\n\trequest: {\n\t\ttypeId: 'DescrStatsRequest'\n\t},\n\tresponse: {\n\t\ttypeId: 'DescrStatsResponse'\n\t},\n\texamples: [\n\t\t{\n\t\t\trequest: {\n\t\t\t\tbody: {\n\t\t\t\t\tgenome: 'hg38-test',\n\t\t\t\t\tdslabel: 'TermdbTest',\n\t\t\t\t\tembedder: 'localhost',\n\t\t\t\t\ttw: { term: { id: 'hrtavg' }, q: { mode: 'continuous' } },\n\t\t\t\t\tfilter: {\n\t\t\t\t\t\ttype: 'tvslst',\n\t\t\t\t\t\tin: true,\n\t\t\t\t\t\tjoin: '',\n\t\t\t\t\t\tlst: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttag: 'cohortFilter',\n\t\t\t\t\t\t\t\ttype: 'tvs',\n\t\t\t\t\t\t\t\ttvs: {\n\t\t\t\t\t\t\t\t\tterm: {\n\t\t\t\t\t\t\t\t\t\tname: 'Cohort',\n\t\t\t\t\t\t\t\t\t\ttype: 'categorical',\n\t\t\t\t\t\t\t\t\t\tvalues: { ABC: { label: 'ABC' }, XYZ: { label: 'XYZ' } },\n\t\t\t\t\t\t\t\t\t\tid: 'subcohort',\n\t\t\t\t\t\t\t\t\t\tisleaf: false,\n\t\t\t\t\t\t\t\t\t\tgroupsetting: { disabled: true }\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tvalues: [{ key: 'ABC', label: 'ABC' }]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t} // satisfies DescrStatsRequest // TODO: enable type check\n\t\t\t},\n\t\t\tresponse: {\n\t\t\t\theader: { status: 200 }\n\t\t\t}\n\t\t}\n\t]\n}\n", "import type { DataEntry, VolcanoData, VolcanoRenderRequest } from './termdb.DE.js'\nimport type { DmrRunResources, TermdbDmrBatchSuccessResponse } from './termdb.dmrBatch.js'\n\n/** The element_type that asks the differential-methylation volcano to call DMRs de novo across\n * the genome (termdb/dmrBatch scan mode) instead of testing a pre-annotated element class. Not a\n * key into ds.queries.dnaMethylation.elements; termdb.config.ts lists it among elementTypes when\n * the dataset has a matrix the region analysis can run on. */\nexport const DMR_SCAN_ELEMENT_TYPE = 'dmr_scan'\n\n/** Default CpG floor, shared because the client seeds its control with it and the server falls\n * back to it for a request that omits one -- two readings of \"an untouched scan\" that must agree.\n * Two-CpG calls carry the LARGEST effect sizes and split 51.5% / 48.5% hyper / hypo on MMRF chr1\n * -- a coin flip -- where 10+ CpG calls run 58% hyper. Five keeps 86% of calls and all of the\n * structure. Not part of any cache key: the floor is applied to a cached scan's DMRs. */\nexport const DEFAULT_MIN_CPGS = 5\n\nexport type DiffMethRequest = {\n\t/** Discriminator tag. Matches the `kind` field on `DmCacheResult` and\n\t * lets the GSEA route tell a snapshot DM request apart from a snapshot\n\t * DE request without structural-shape probing. */\n\tkind: 'DM'\n\t/** Genome build name */\n\tgenome: string\n\t/** Dataset label */\n\tdslabel: string\n\t/** Object containing two arrays of samples for differential methylation analysis */\n\tsamplelst: any\n\t/** Minimum non-NA samples required per group (default 3) */\n\tmin_samples_per_group?: number\n\t/** Drop chrX/chrY elements before testing (default false). X-inactivation makes\n\t * chrX methylation strongly sex-dependent, so a sex-imbalanced comparison produces\n\t * chrX hits that are sex rather than the grouping variable. */\n\texclude_sex_chr?: boolean\n\t/** Which regulatory-element class to test, keying into\n\t * ds.queries.dnaMethylation.elements. Absent means 'promoter', which keeps every\n\t * existing client request and cache entry valid. The available keys and their\n\t * display labels come from the dataset config, so the picker is data-driven rather\n\t * than a hardcoded list. */\n\telement_type?: string\n\t/** Only read when element_type is DMR_SCAN_ELEMENT_TYPE. Every field has a default, so a bare\n\t * scan request scans the whole genome uncorrected and keeps DMRs of 5+ CpGs. */\n\tscan?: {\n\t\t/** one chromosome to scan; absent = every major chromosome except the mitochondrion */\n\t\tchromosome?: string\n\t\t/** score each DMR against matched intergenic background (termdb/dmrBatch\n\t\t * backgroundCorrection); the volcano's p then becomes that empirical p and DMRs whose\n\t\t * stratum held too little background are left out of the rows */\n\t\tbackgroundCorrection?: boolean\n\t\t/** drop DMRs called from fewer CpGs than this before rendering; absent = DEFAULT_MIN_CPGS */\n\t\tminCpgs?: number\n\t\t/** display width of the methylome-wide profile's bins, in bp. Several native bins are\n\t\t * averaged into one at render time; absent or at/below the native width draws them as\n\t\t * computed. Not part of any cache key -- changing it redraws a cached scan. */\n\t\tprofileBinBp?: number\n\t\t/** DMRcate lambda, C and per-CpG FDR cutoff, passed to termdb/dmrBatch; absent = its defaults.\n\t\t * Part of the scan's cache key, so changing one refits. */\n\t\tlambda?: number\n\t\tC?: number\n\t\tfdrCutoff?: number\n\t}\n\t/** Term for confounding variable 1 (if present) */\n\ttw?: any\n\t/** Term for confounding variable 2 (if present) */\n\ttw2?: any\n\t/** Option to return early with actual number of samples with methylation values */\n\tpreAnalysis?: boolean\n\t/** Parameters for the server-side `da` Rust renderer. Always required \u2014 the\n\t * server always returns a rendered PNG plus the threshold-passing rows. */\n\tvolcanoRender: VolcanoRenderRequest\n}\n\n/** Response when DiffMethRequest.preAnalysis === true. Returns per-group\n * sample counts (keyed by group name) plus an optional validation alert. */\nexport type DiffMethPreAnalysisResponse = {\n\t/** number of samples with methylation data, keyed by group name. a group name is\n\t * user-supplied, so it must not share this object with any other property */\n\tdata: Record<string, number>\n\t/** validation message; the client hides the run button while it is present */\n\talert?: string\n}\n\n/** Response for a full differential methylation run (preAnalysis absent/false). */\nexport type DiffMethFullResponse = {\n\t/** The volcano payload \u2014 per-element interactive dots + PNG + extents +\n\t * totals. See VolcanoData for details. */\n\tdata: VolcanoData<DiffMethEntry>\n\t/** Effective sample size for group 1 */\n\tsample_size1: number\n\t/** Effective sample size for group 2 */\n\tsample_size2: number\n\t/** Present only for a DMR scan: what the scan did and found, beyond the rows themselves. */\n\tscan?: DmrScanSummary\n}\n\n/** Whole-scan facts the volcano's Statistics panel and genome map are drawn from. Every count here\n * is over the scan as returned by termdb/dmrBatch, before the volcano's own thresholds, so the\n * panel can state what the rows were selected from. */\nexport type DmrScanSummary = {\n\t/** chromosomes scanned, in genome order */\n\tchromosomes: string[]\n\ttotalProbesAnalyzed: number\n\t/** DMRs the scan called, before any filtering here */\n\tcalled: number\n\t/** the minCpgs that was applied, and how many DMRs met it */\n\tminCpgs: number\n\tkept: number\n\t/** direction split of the kept DMRs */\n\thyper: number\n\thypo: number\n\t/** width quantiles (bp) of the kept DMRs; absent when none were kept */\n\twidth?: { median: number; q1: number; q3: number }\n\tglobalMethylation?: { controlMeanBeta: number; caseMeanBeta: number; shift: number; valuesCounted: number }\n\tregionMask?: { sources: string[]; overlapFrac: number; dmrsDropped: number }\n\t/** present when the correction ran. `scored` and `significant` count the kept DMRs; `unscored`\n\t * kept DMRs had no background in their stratum and are not among the rows */\n\tbackgroundCorrection?: { windows: number; scored: number; unscored: number; significant: number; matchedOn: string[] }\n\t/** genes under kept hypomethylated gene-body DMRs -- the set the expression test\n\t * (termdb/dmrGeneDE) runs on. With the background correction on, a region must also beat its\n\t * matched background (p<0.05), which makes this the stricter of two readings rather than the\n\t * only one. Absent when no DMR qualifies. */\n\tgeneBodyLoss?: { regions: number; genes: string[] }\n\t/** The two groups cut to the samples with methylation data, as sample ids: the cohort any\n\t * expression step after a scan should run on, so both readings come from the same patients. */\n\tmatchedSamplelst?: { groups: { name: string; values: { sampleId: number | string }[]; [k: string]: any }[] }\n\t/** what the scan cost when it was computed; see DmrRunResources */\n\tresources?: DmrRunResources\n\t/** Mean methylation per group in fixed-width bins along the genome: the profile methylome\n\t * papers plot for a genome-wide comparison, covering every bin with probes rather than only\n\t * the called DMRs. See TermdbDmrBatchSuccessResponse.binMethylation. */\n\tbinMethylation?: NonNullable<TermdbDmrBatchSuccessResponse['binMethylation']>\n\t/** The rendered genome-wide methylation profile: the per-bin group difference along the genome.\n\t * Rendered per request, after the cache, like the DMR Manhattan. `interactive` is how many bins\n\t * per direction carry pixel coordinates; `dotRadius` is the radius the PNG was drawn at, which\n\t * the client's hover layer must match to land on the dots. */\n\tprofile?: {\n\t\tpng: string\n\t\tplotData: any\n\t\t/** the width actually drawn, which is the requested display width when one was asked for */\n\t\tbinBp: number\n\t\tplotWidth: number\n\t\tplotHeight: number\n\t\tdotRadius: number\n\t\t/** bins drawn at that width */\n\t\tbins: number\n\t\t/** how many of them are hoverable: the top N per direction by |delta beta|, so at a coarse\n\t\t * width where the rule reaches every bin this equals `bins` */\n\t\tinteractive: number\n\t}\n\t/** Quantiles of the per-bin difference and the fraction of bins that moved beyond a threshold:\n\t * how much of the measured methylome changed, which the DMR counts alone do not say. */\n\tprofileSummary?: {\n\t\tbins: number\n\t\tmedian: number\n\t\tq1: number\n\t\tq3: number\n\t\tfractionBeyond05: number\n\t\tfractionBeyond10: number\n\t\tfractionHyper: number\n\t}\n\t/** the cached scan the rows came from, so anything ranked off the same scan (e.g.\n\t * termdb/dmrGeneLink) can reach it without recomputing anything */\n\tcacheId?: string\n\t/** The kept DMRs written as a bedj track file under the \"bedj\" cache subdir, as its file name.\n\t * A genome browser opened on the scan loads it with isCache:true, so the track is an ordinary\n\t * bedj file tk rather than items the browser has to fetch and swap per chromosome. */\n\tbedjFile?: string\n\t/** Every kept DMR drawn along the genome, hyper above the line and hypo below, y = signed\n\t * -log10 of the q the volcano plots; the N most significant per direction carry pixel\n\t * coordinates and are interactive. Rendered per request, after the cache, because it depends\n\t * on the client's pixel ratio. */\n\tmanhattan?: { png: string; plotData: any; interactive: number; plotWidth: number; plotHeight: number }\n}\n\nexport type DiffMethResponse = DiffMethPreAnalysisResponse | DiffMethFullResponse\n\n/** One tested regulatory element. Despite the field names, this is NOT promoter-specific:\n * the same shape describes promoters, cCRE classes, eQTM blocks and promoter sub-window tiles.\n * `promoter_id` keeps its name only for backward compatibility with existing clients \u2014 read\n * `element_class` to know what a row actually is. */\nexport type DiffMethEntry = DataEntry & {\n\t/** Row key, unique within a result. For an untiled run this equals `element_id`; for a\n\t * tiled run it is the composite \"<element_id>::tile<N>\", so rows stay unique while\n\t * `element_id` remains groupable. Named `promoter_id` for backward compatibility from when\n\t * the analysis was promoter-only. */\n\tpromoter_id: string\n\t/** The bare element identifier, without any tile suffix \u2014 e.g. an ENCODE cCRE accession\n\t * (EH38E3756858) for cCRE builds, or the builder's own id for eQTM blocks. Resolved from\n\t * meta/element/elementID, meta/element_id, or legacy meta/promoter/promoterID. */\n\telement_id: string\n\t/** Which class this row belongs to: 'promoter', 'enhancer_distal', 'eqtm_block', etc.\n\t * Present per row because one matrix may hold several classes, in which case the run-level\n\t * label is 'mixed' while each row still names its own. */\n\telement_class: string\n\t/** Sub-window index within the element, 5'->3'. Only present when the input was a tile\n\t * matrix (build_element_matrix.py --tiles N); absent otherwise, so a non-tiled run's shape\n\t * is unchanged. */\n\ttile_index?: number\n\t/** Gene symbol(s) associated with the element (comma-separated if multiple, may be empty) */\n\tgene_name: string\n\t/** Chromosome (e.g. \"chr1\") */\n\tchr: string\n\t/** Element start coordinate (0-based). For a tile row this is the tile's own span, not the\n\t * parent element's. */\n\tstart: number\n\t/** Element end coordinate (exclusive) */\n\tstop: number\n\t/** Group 1 (control) mean beta, over observed cells only. Absent on a DMR-scan row, which\n\t * carries the difference but not the two means. */\n\tmean_beta_control?: number\n\t/** Group 2 (case) mean beta, over observed cells only */\n\tmean_beta_case?: number\n\t/** mean_beta_case - mean_beta_control. The interpretable effect size: fold_change is a\n\t * difference of M-values (a logit), so it does not say how much methylation changed.\n\t * Same sign as fold_change, since both are case - control. Derived by back-transforming\n\t * the stored M-values, which yields the alpha-smoothed beta and so shrinks the difference\n\t * toward zero by 2/(depth+2) \u2014 under 1% at this cohort's typical promoter depth. */\n\tdelta_beta: number\n\t/** DMR-scan rows only (element_class 'dmr'): CpGs the region was called from, and when the\n\t * background correction ran, the observed delta-beta minus the matched drift. */\n\tno_cpgs?: number\n\texcess?: number\n}\n\n/** What diffMeth.R actually tested, as opposed to what was asked for. Emitted by the R script\n * alongside the rows; NOT currently forwarded to the client by termdb.diffMeth.ts, which passes\n * only `promoter_data` through. Documented here because the R output is a shared contract and a\n * caller reading it directly (or a future route that does forward it) needs the shape.\n *\n * It exists because promoter, enhancer and tile runs all use identical column names, so without\n * it a result is indistinguishable from any other. */\nexport type DiffMethElementMeta = {\n\t/** The class tested, or 'mixed' when the retained rows span more than one. Computed over the\n\t * rows that survived filtering, not over the whole matrix. */\n\telement_class: string\n\t/** Which h5 path supplied the row ids \u2014 meta/element/elementID, meta/element_id, or\n\t * meta/promoter/promoterID. Distinguishes a new build from a legacy promoter-only one. */\n\tid_source: string\n\t/** Whether the input was a tile matrix, i.e. whether rows carry tile_index. */\n\tis_tiled: boolean\n\t/** Elements that passed filtering and entered the model. */\n\tn_elements_tested: number\n}\n\n// TODO: write payload examples to help with automated testing and documentation, for non-prod use only\n", "import type { Filter } from '../filter.ts'\nimport type { Term } from '../terms/term.ts'\n\nexport type PercentileRequest = {\n\t/** a user-defined genome label in the serverconfig.json, hg38, hg19, mm10, etc */\n\tgenome: string\n\t/** a user-defined dataset label in the serverconfig.json, such as ClinVar, SJLife, GDC, etc */\n\tdslabel: string\n\tembedder: string\n\tgetpercentile: number[]\n\t/** term id string */\n\tterm: Term\n\tfilter?: Filter\n\tfilter0?: any\n}\n\nexport type PercentileResponse = {\n\tvalues: number[]\n}\n\n// TODO: write more payload examples to help with automated testing and documentation, for non-prod use only\n\nexport const percentilePayloadExamples = {\n\trequest: {\n\t\ttypeId: 'PercentileRequest'\n\t},\n\tresponse: {\n\t\ttypeId: 'PercentileResponse'\n\t},\n\texamples: [\n\t\t{\n\t\t\trequest: {\n\t\t\t\tbody: {\n\t\t\t\t\tgenome: 'hg38-test',\n\t\t\t\t\tdslabel: 'TermdbTest',\n\t\t\t\t\tembedder: 'localhost',\n\t\t\t\t\tgetpercentile: [50],\n\t\t\t\t\tterm: { id: 'agedx' },\n\t\t\t\t\tfilter: {\n\t\t\t\t\t\ttype: 'tvslst',\n\t\t\t\t\t\tin: true,\n\t\t\t\t\t\tjoin: '',\n\t\t\t\t\t\tlst: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttag: 'cohortFilter',\n\t\t\t\t\t\t\t\ttype: 'tvs',\n\t\t\t\t\t\t\t\ttvs: {\n\t\t\t\t\t\t\t\t\tterm: {\n\t\t\t\t\t\t\t\t\t\tname: 'Cohort',\n\t\t\t\t\t\t\t\t\t\ttype: 'categorical',\n\t\t\t\t\t\t\t\t\t\tvalues: { ABC: { label: 'ABC' }, XYZ: { label: 'XYZ' } },\n\t\t\t\t\t\t\t\t\t\tid: 'subcohort',\n\t\t\t\t\t\t\t\t\t\tisleaf: false,\n\t\t\t\t\t\t\t\t\t\tgroupsetting: { disabled: true }\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tvalues: [{ key: 'ABC', label: 'ABC' }]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t} // satisfies PercentileRequest // TODO: enable type check\n\t\t\t},\n\t\t\tresponse: {\n\t\t\t\theader: { status: 200 }\n\t\t\t}\n\t\t}\n\t]\n}\n", "export type RootTermRequest = {\n\t/** a user-defined genome label in the serverconfig.json, hg38, hg19, mm10, etc */\n\tgenome: string\n\t/** a user-defined dataset label in the serverconfig.json, such as ClinVar, SJLife, GDC, etc */\n\tdslabel: string\n\tembedder: string\n\tdefault_rootterm: number\n\tcohortValues: string\n\ttreeFilter: string\n}\n\ninterface Entries {\n\tname: string\n\tid: string\n\tisleaf: boolean\n\tincluded_types: string[]\n\tchild_types: string[]\n}\n\nexport type RootTermResponse = {\n\tlst: Entries[]\n}\n\nexport const rootTermPayloadExamples = {\n\trequest: {\n\t\ttypeId: 'RootTermRequest'\n\t},\n\tresponse: {\n\t\ttypeId: 'RootTermResponse'\n\t},\n\texamples: [\n\t\t{\n\t\t\trequest: {\n\t\t\t\tbody: {\n\t\t\t\t\tgenome: 'hg38-test',\n\t\t\t\t\tdslabel: 'TermdbTest',\n\t\t\t\t\tembedder: 'localhost',\n\t\t\t\t\tdefault_rootterm: 1,\n\t\t\t\t\tcohortValues: 'ABC'\n\t\t\t\t} // satisfies RootTermRequest // TODO: enable type check\n\t\t\t},\n\t\t\tresponse: {\n\t\t\t\theader: { status: 200 }\n\t\t\t}\n\t\t}\n\t]\n}\n", "export type RunChartRequest = {\n\tgenome: string\n\tdslabel: string\n\t/**\n\t * term wrapper for x axis: { term, q }.\n\t * runChart2: q.mode='continuous' \u2192 1 series.\n\t * runChart2Period: q.mode='discrete' (with bins) \u2192 multiple series by period.\n\t */\n\txtw: { term: { id: string }; q?: { mode?: 'continuous' | 'discrete' }; $id?: string }\n\t/** term wrapper for y axis: { term, q }. When omitted, chart renders as frequency (count per time bucket). */\n\tytw?: { term: { id: string }; q?: { mode?: string }; $id?: string }\n\taggregation?: 'median'\n\t/** When true (frequency mode only), series Y values are cumulative counts. */\n\tshowCumulativeFrequency?: boolean\n\tfilter?: any\n\t__protected__?: any // auth token for accessing protected data\n}\n\nexport type RunChartSeries = {\n\t/** period/series identifier */\n\tseriesId?: string\n\t/** calculated Y median value for this curve */\n\tmedian: number\n\tpoints: Point[]\n}\n\nexport type RunChartSuccessResponse = {\n\tstatus: 'ok'\n\t/** each series is one curve, with a median. a runchart may show 1 or multiple curves */\n\tseries: RunChartSeries[]\n}\n\nexport type RunChartErrorResponse = {\n\terror: string\n\t/** Always empty on error; present so response shape is consistent for clients/checkers. */\n\tseries: RunChartSeries[]\n}\n\n/** Discriminated union: server returns success shape on 200 or error shape with series: []. */\nexport type RunChartResponse = RunChartSuccessResponse | RunChartErrorResponse\n\nexport function isRunChartSuccess(r: RunChartResponse): r is RunChartSuccessResponse {\n\treturn 'status' in r && r.status === 'ok'\n}\n\ntype Point = {\n\t/** decimal year, e.g. 2024.21321321 */\n\tx: number\n\t/** text of human-readable x value, e.g. \"Jan 2024\" which may be by the months, depends on dataset customization */\n\txName: string\n\t/** timeline, e.g. number of days */\n\ty: number\n\t/** number of samples with this timeline at this time point */\n\tsampleCount: number\n}\n\n// TODO: write payload examples to help with automated testing and documentation, for non-prod use only\n", "import type { Filter } from '../filter.ts'\nimport type { ErrorResponse } from './errorResponse.ts'\nimport type { ColorLegendEntry, ShapeLegendEntry } from './termdb.sampleScatter.ts'\nimport type { TermWrapper } from '../terms/tw.ts'\n\n/** Test sample ID for single cell plots.\n * Recreated here from utils/src/test/testData.ts so\n * es-lint doesn't complain. */\nconst scTestSample = '2646'\n\nexport type TermdbSingleCellPlotsRequest = {\n\t/** Genome id */\n\tgenome: string\n\t/** Dataset label */\n\tdslabel: string\n\tsingleCellPlot: {\n\t\t/** Name of the single cell plot type, e.g. 'umap', 'tsne' */\n\t\tname: string\n\t\tsample?: { eID?: string; sID: string }\n\t\tisMetaResult?: boolean\n\t}\n\tfilter?: Filter\n\tfilter0?: any //ds specific filter, specifically for api requests\n\t/** When sample size is too large, canvas rendering uses\n\t * these settings to control how the plot is rendered. */\n\tcanvasSettings: {\n\t\t/** Maximum number of samples to render on the client side.\n\t\t * If over the cutoff, will return an image instead of sample array.\n\t\t * Matches the maxSvgSamplesCutoff in scatter settings.*/\n\t\tcutoff: number\n\t\t/** Width of the scatter canvas */\n\t\twidth: number\n\t\t/** Height of the scatter canvas */\n\t\theight: number\n\t\t/** Radius of the points in the scatter plot. In scatter,\n\t\t * this is the setting size. */\n\t\tradius: number\n\t\t/** Default or user defined lower limit cutoff for x scale */\n\t\tminXScale: number | null\n\t\t/** Default or user defined upper limit cutoff for x scale */\n\t\tmaxXScale: number | null\n\t\t/** Default or user defined lower limit cutoff for y scale */\n\t\tminYScale: number | null\n\t\t/** Default or user defined upper limit cutoff for y scale */\n\t\tmaxYScale: number | null\n\t\t/** Default or user defined opacity for the scatter plot points */\n\t\topacity: number\n\t\t/** Required non expression color for scge plots. 'startColor' is the\n\t\t * settings key in the scatter. */\n\t\tstartColor: string\n\t\t/** Required non expression color for scge plots. 'stopColor' is the\n\t\t * settings key in the scatter. */\n\t\tstopColor: string\n\t\t/** Device pixel ratio from the client for HiDPI rendering */\n\t\tdevicePixelRatio?: number\n\t\tcolorScaleMode?: 'auto' | 'fixed' | 'percentile'\n\t\tcolorScaleMinFixed?: number | null\n\t\tcolorScaleMaxFixed?: number | null\n\t\tcolorScalePercentile?: number\n\t}\n\t/** Term wrapper for coloring the single cell plot */\n\tcolorTW?: TermWrapper\n\t/** Term wrappers for gene expression */\n\tcoordTWs?: TermWrapper[]\n}\n\nexport type TermdbSingleCellPlotsResponse = ErrorResponse | ValidSingleCellPlotsResponse\n\n/** The computed coordinate and gene expression range for cells\n * returned in a single request. Scoped to the specific plot type\n * (e.g. 'umap', 'tsne') and optional sample filter \u2014 not a global\n * range across all plots or samples. Used to define axis domains\n * and color scale domains for rendering. */\nexport type SingleCellRange = {\n\t/** Minimum x coordinate across all cells in this plot response */\n\txMin: number\n\t/** Maximum x coordinate across all cells in this plot response */\n\txMax: number\n\t/** Minimum y coordinate across all cells in this plot response */\n\tyMin: number\n\t/** Maximum y coordinate across all cells in this plot response */\n\tyMax: number\n\t/** Minimum gene expression value (Infinity when no expression data) */\n\tgeMin: number\n\t/** Maximum gene expression value (-Infinity when no expression data) */\n\tgeMax: number\n}\n\n/** Returns cell data formatted in samples array for the sampleScatter */\nexport type FormattedCell2Sample = {\n\t/** Cell identifier used as the sample id */\n\tsampleId: string\n\t/** X coordinate of the cell in the plot */\n\tx: number\n\t/** Y coordinate of the cell in the plot */\n\ty: number\n\t/** Z coordinate, always 0 (2D plots only) */\n\tz: number\n\t/** Cell type or group assignment for coloring */\n\tcategory: string\n\t/** Shape key for the legend, always 'Ref' */\n\tshape: string\n\t/** Visibility state based on user-hidden categories */\n\thidden: { category: boolean }\n\t/** Gene expression value for this cell, undefined when not applicable */\n\tgeneExp: number | undefined\n}\n\nexport type SingleCellPlotDataResult = {\n\t/** Resolved numeric color domain shared by the canvas and its legend. */\n\tcolorDomain?: [number, number]\n\tcolorLegend: ColorLegendEntry[]\n\tshapeLegend: ShapeLegendEntry[]\n\tsamples?: FormattedCell2Sample[]\n\t/** If over the cutoff, will return image instead of sample array */\n\tsrc?: string\n\t/** css dimensions of the canvas image, used to display at\n\t * the correct size when devicePixelRatio > 1 */\n\tcanvasWidth?: number\n\tcanvasHeight?: number\n\t/** When no sample array is returned, send the total sample count for\n\t * the legend. */\n\ttotalSampleCount?: number\n}\n\nexport type ValidSingleCellPlotsResponse = {\n\trange: SingleCellRange\n\tresult: { Default: SingleCellPlotDataResult }\n}\n\nconst TermdbSingleCellPlotsRequestExample = {\n\tgenome: 'hg38-test',\n\tdslabel: 'TermdbTest',\n\tsingleCellPlot: {\n\t\tname: 'umap',\n\t\tsample: { sID: scTestSample }\n\t},\n\tfilter: {\n\t\ttype: 'tvslst',\n\t\tin: true,\n\t\tjoin: '',\n\t\tlst: [\n\t\t\t{\n\t\t\t\ttag: 'cohortFilter',\n\t\t\t\ttype: 'tvs',\n\t\t\t\ttvs: {\n\t\t\t\t\tterm: { id: 'subcohort', type: 'multivalue' },\n\t\t\t\t\tvalues: [{ key: 'ABC', label: 'ABC' }]\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t},\n\tfilter0: undefined,\n\tcanvasSettings: {\n\t\tcutoff: 10000,\n\t\twidth: 800,\n\t\theight: 600,\n\t\tradius: 3,\n\t\tminXScale: null,\n\t\tmaxXScale: null,\n\t\tminYScale: null,\n\t\tmaxYScale: null,\n\t\topacity: 0.8,\n\t\tstartColor: '#0000ff',\n\t\tstopColor: '#ff0000',\n\t\tdevicePixelRatio: 2\n\t},\n\tcolorTW: {\n\t\tterm: {\n\t\t\tname: 'Cell Type',\n\t\t\tplot: 'UMAP',\n\t\t\ttype: 'singleCellCellType',\n\t\t\tsample: { sID: scTestSample },\n\t\t\tgroupsetting: { disabled: false },\n\t\t\tvalues: {}\n\t\t},\n\t\tq: { mode: 'discrete', type: 'values', hiddenValues: {} }\n\t}\n}\n\nconst TermdbSingleCellPlotsResponseExample = {\n\trange: {\n\t\txMin: -2.45230826499861,\n\t\txMax: 2.02116419939392,\n\t\tyMin: -2.670907125487,\n\t\tyMax: 2.97596441655721,\n\t\tgeMin: null,\n\t\tgeMax: null\n\t},\n\tresult: {\n\t\tDefault: {\n\t\t\tcolorLegend: [\n\t\t\t\t[\n\t\t\t\t\t'T_NK',\n\t\t\t\t\t{\n\t\t\t\t\t\tsampleCount: 20,\n\t\t\t\t\t\tcolor: '#1b9e77',\n\t\t\t\t\t\tkey: 'T_NK'\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'Blast',\n\t\t\t\t\t{\n\t\t\t\t\t\tsampleCount: 54,\n\t\t\t\t\t\tcolor: '#030303',\n\t\t\t\t\t\tkey: 'Blast'\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'Monocyte',\n\t\t\t\t\t{\n\t\t\t\t\t\tsampleCount: 26,\n\t\t\t\t\t\tcolor: '#7570b3',\n\t\t\t\t\t\tkey: 'Monocyte'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t],\n\t\t\tshapeLegend: [\n\t\t\t\t[\n\t\t\t\t\t'Ref',\n\t\t\t\t\t{\n\t\t\t\t\t\tsampleCount: 100,\n\t\t\t\t\t\tshape: 0,\n\t\t\t\t\t\tkey: 'Ref'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t],\n\t\t\tsamples: [\n\t\t\t\t{\n\t\t\t\t\tsampleId: 'cell1',\n\t\t\t\t\tx: 0.958429213345285,\n\t\t\t\t\ty: 1.94008987552318,\n\t\t\t\t\tz: 0,\n\t\t\t\t\tcategory: 'T_NK',\n\t\t\t\t\tshape: 'Ref',\n\t\t\t\t\thidden: {\n\t\t\t\t\t\tcategory: false\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsampleId: 'cell2',\n\t\t\t\t\tx: 0.678836078621254,\n\t\t\t\t\ty: -1.13854914348622,\n\t\t\t\t\tz: 0,\n\t\t\t\t\tcategory: 'T_NK',\n\t\t\t\t\tshape: 'Ref',\n\t\t\t\t\thidden: {\n\t\t\t\t\t\tcategory: false\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsampleId: 'cell3',\n\t\t\t\t\tx: -2.11135267144421,\n\t\t\t\t\ty: -2.33519450621652,\n\t\t\t\t\tz: 0,\n\t\t\t\t\tcategory: 'T_NK',\n\t\t\t\t\tshape: 'Ref',\n\t\t\t\t\thidden: {\n\t\t\t\t\t\tcategory: false\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsampleId: 'cell4',\n\t\t\t\t\tx: 0.551783876521269,\n\t\t\t\t\ty: -1.24685552943596,\n\t\t\t\t\tz: 0,\n\t\t\t\t\tcategory: 'T_NK',\n\t\t\t\t\tshape: 'Ref',\n\t\t\t\t\thidden: {\n\t\t\t\t\t\tcategory: false\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsampleId: 'cell5',\n\t\t\t\t\tx: 1.84959385901015,\n\t\t\t\t\ty: 2.68311790617899,\n\t\t\t\t\tz: 0,\n\t\t\t\t\tcategory: 'T_NK',\n\t\t\t\t\tshape: 'Ref',\n\t\t\t\t\thidden: {\n\t\t\t\t\t\tcategory: false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t}\n}\n\nexport const TermdbSingleCellPlotsExample = {\n\trequest: {\n\t\tbody: TermdbSingleCellPlotsRequestExample\n\t},\n\tresponse: {\n\t\tbody: TermdbSingleCellPlotsResponseExample\n\t}\n}\n", "export type TermChildrenRequest = {\n\t/** a user-defined genome label in the serverconfig.json, hg38, hg19, mm10, etc */\n\tgenome: string\n\t/** a user-defined dataset label in the serverconfig.json, such as ClinVar, SJLife, GDC, etc */\n\tdslabel: string\n\tembedder: string\n\tget_children: number\n\tcohortValues?: string\n\ttid: string\n}\n\ninterface Entries {\n\tname: string\n\tid: string\n\tisleaf: boolean\n\tincluded_types: string[]\n\tchild_types: string[]\n}\n\nexport type TermChildrenResponse = {\n\tlst: Entries[]\n}\n\nexport const termChildrenPayloadExamples = {\n\trequest: {\n\t\ttypeId: 'TermChildrenRequest'\n\t},\n\tresponse: {\n\t\ttypeId: 'TermChildrenResponse'\n\t},\n\texamples: [\n\t\t{\n\t\t\trequest: {\n\t\t\t\tbody: {\n\t\t\t\t\tgenome: 'hg38-test',\n\t\t\t\t\tdslabel: 'TermdbTest',\n\t\t\t\t\tembedder: 'localhost',\n\t\t\t\t\tget_children: 1,\n\t\t\t\t\tcohortValues: 'ABC',\n\t\t\t\t\ttid: 'GO:0000001'\n\t\t\t\t} satisfies TermChildrenRequest // TODO: enable type check\n\t\t\t},\n\t\t\tresponse: {\n\t\t\t\theader: { status: 200 }\n\t\t\t}\n\t\t}\n\t]\n}\n", "import type { TermWrapper } from '../terms/tw.ts'\nimport type { Filter } from '../filter.ts'\nimport type { ErrorResponse } from './errorResponse.ts'\nimport type { DescrStats } from './termdb.descrstats.ts'\n\n/** Common properties shared by both violin and box plots */\ntype CommonProps = {\n\t/** numeric tw to fetch numeric data. tw.q.mode must be continuous */\n\ttw: TermWrapper\n\tdslabel: string\n\tgenome: string\n\t/** overlay tw for multiple violins/boxplots */\n\toverlayTw?: TermWrapper\n\t/** tw to divide to multiple charts */\n\tdivideTw?: TermWrapper\n\t/** mass filter */\n\tfilter?: Filter\n\t/** read-only invisible filter */\n\tfilter0?: any\n\t/** TODO: Needs description FIXME delete */\n\tcurrentGeneNames?: string[]\n\t/** if true, use log scale; if false or undefined, use linear scale */\n\tisLogScale?: boolean\n}\n\n/** Request type for violin plots with required violin-specific parameters */\nexport type ViolinRequest = CommonProps & {\n\t/** Indicates the type of chart to render */\n\tplotType: 'violin'\n\t/** A number representing the dimension perpendicular to the violin spread */\n\taxisHeight?: number\n\t/** A string representing the type of symbol used on the plot */\n\tdatasymbol?: string\n\t/** A number representing the device's pixel ratio */\n\tdevicePixelRatio: number\n\t/** If true, uses KDE method to build plot */\n\tisKDE?: boolean\n\t/** A string with two possible values: 'horizontal' or 'vertical' */\n\torientation: string\n\t/** A number representing the radius of the data symbols */\n\tradius: number\n\t/** A number representing the right margin */\n\trightMargin?: number\n\t/** Term may be scaled from regression analysis */\n\tscale?: any\n\t/** A number representing the width of the stroke */\n\tstrokeWidth?: number\n\t/** A number representing the width of the SVG box */\n\tsvgw: number\n\t/** Number of bins to build the plot. Default is 20. */\n\tticks?: number\n}\n\n/** Request type for box plots with required box-specific parameters */\nexport type BoxRequest = CommonProps & {\n\t/** Indicates the type of chart to render */\n\tplotType: 'box'\n\t/** sort plots by median value */\n\torderByMedian?: boolean\n\t/** Remove outliers from the plot */\n\tremoveOutliers?: boolean\n\t/** If true, show association tests table */\n\tshowAssocTests?: boolean\n}\n\n/**Unified request type for violin and boxplot - union of ViolinRequest and BoxRequest */\nexport type ViolinBoxRequest = ViolinRequest | BoxRequest\n\nexport type ViolinBoxResponse = ViolinResponse | BoxPlotResponse | ErrorResponse\n\n/** Type guard to check if response is an ErrorResponse */\nexport function isErrorResponse(response: ViolinBoxResponse): response is ErrorResponse {\n\treturn 'error' in response && 'status' in response\n}\n\n/** Type guard to check if response is a BoxPlotResponse */\nexport function isBoxPlotResponse(response: ViolinBoxResponse): response is BoxPlotResponse {\n\treturn !isErrorResponse(response) && 'charts' in response && 'descrStats' in response\n}\n\n/** Type guard to check if response is a ViolinResponse */\nexport function isViolinResponse(response: ViolinBoxResponse): response is ViolinResponse {\n\treturn !isErrorResponse(response) && 'min' in response && 'max' in response\n}\n\n/** Violin response types */\ninterface BinsEntries {\n\tx0: number\n\tx1: number\n\tdensity: number\n}\n\ninterface PValueEntries {\n\tvalue?: string\n\thtml?: string\n}\n\ntype ViolinDensity = {\n\tbins: BinsEntries[]\n\tdensityMax: number\n\tdensityMin: number\n}\n\nexport type ViolinPlotEntry = {\n\tcolor: string\n\tchartId: string\n\tdensity: ViolinDensity\n\tlabel: string\n\tplotValueCount: number\n\tseriesId: string\n\tsrc: string\n\tsummaryStats: DescrStats\n}\n\nexport type ViolinResponseChart = {\n\tchartId: string\n\tplots: ViolinPlotEntry[]\n\tpvalues?: PValueEntries[][]\n}\n\nexport type ViolinResponse = {\n\tbins: { [index: string]: any }\n\tcharts: {\n\t\t[index: string]: ViolinResponseChart\n\t}\n\tmin: number\n\tmax: number\n\tuncomputableValues: { [index: string]: number }[] | null\n\tdescrStats?: DescrStats\n}\n\n/** Boxplot response types */\nexport type BoxPlotData = {\n\tw1: number | undefined\n\tw2: number | undefined\n\tp05: number\n\tp25: number\n\tp50: number\n\tp75: number\n\tp95: number\n\tiqr: number\n\tout: { value: number }[]\n}\n\nexport type BoxPlotEntry = {\n\tboxplot: BoxPlotData & { label: string }\n\tcolor?: string\n\tdescrStats: DescrStats\n\tisHidden?: boolean\n\tkey: string\n\tseriesId?: string\n}\n\nexport type BoxPlotChartEntry = {\n\tchartId: string\n\tplots: BoxPlotEntry[]\n\tsampleCount: number\n\twilcoxon?: [{ value: string }, { value: string }, { html: string }][]\n}\n\nexport type BoxPlotResponse = {\n\tabsMin?: number\n\tabsMax?: number\n\tbins?: {\n\t\t[index: string]: any\n\t}\n\tcharts: {\n\t\t[chartId: string]: BoxPlotChartEntry\n\t}\n\tdescrStats: DescrStats\n\tuncomputableValues: { label: string; value: number }[] | null\n}\n\n// TODO: write more payload examples to help with automated testing and documentation, for non-prod use only\n\nexport const violinBoxPayload = {\n\trequest: {\n\t\ttypeId: 'ViolinBoxRequest'\n\t},\n\tresponse: {\n\t\ttypeId: 'ViolinBoxResponse'\n\t},\n\texamples: [\n\t\t{\n\t\t\trequest: {\n\t\t\t\tbody: {\n\t\t\t\t\tplotType: 'violin',\n\t\t\t\t\tgenome: 'hg38-test',\n\t\t\t\t\tdslabel: 'TermdbTest',\n\t\t\t\t\ttw: {\n\t\t\t\t\t\tterm: { id: 'aaclassic_5', type: 'float' },\n\t\t\t\t\t\tq: { mode: 'continuous' }\n\t\t\t\t\t},\n\t\t\t\t\tdevicePixelRatio: 2,\n\t\t\t\t\tsvgw: 200,\n\t\t\t\t\torientation: 'horizontal',\n\t\t\t\t\tdatasymbol: 'rug',\n\t\t\t\t\tradius: 5,\n\t\t\t\t\tisLogScale: false\n\t\t\t\t} // satisfies ViolinBoxRequest // TODO: enable type check\n\t\t\t},\n\t\t\tresponse: {\n\t\t\t\theader: { status: 200 }\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\trequest: {\n\t\t\t\tbody: {\n\t\t\t\t\tplotType: 'box',\n\t\t\t\t\tgenome: 'hg38-test',\n\t\t\t\t\tdslabel: 'TermdbTest',\n\t\t\t\t\ttw: {\n\t\t\t\t\t\tterm: { id: 'agedx', type: 'float' },\n\t\t\t\t\t\tq: { mode: 'continuous' }\n\t\t\t\t\t},\n\t\t\t\t\toverlayTw: {\n\t\t\t\t\t\tterm: { id: 'sex', type: 'categorical' }\n\t\t\t\t\t},\n\t\t\t\t\torderByMedian: true\n\t\t\t\t} // satisfies ViolinBoxRequest // TODO: enable type check\n\t\t\t},\n\t\t\tresponse: {\n\t\t\t\theader: { status: 200 }\n\t\t\t}\n\t\t}\n\t]\n}\n", "export const CATEGORICAL = 'categorical'\nexport const CONDITION = 'condition'\nexport const DATE = 'date'\nexport const DNA_METHYLATION = 'dnaMethylation'\n// dt term types, used for filtering variants of a geneVariant term;\n// the matching dt term entries are declared in `#shared/common.js` dtTerms[]\nexport const DTCNV = 'dtcnv'\nexport const DTFUSION = 'dtfusion'\nexport const DTITD = 'dtitd'\nexport const DTSNVINDEL = 'dtsnvindel'\nexport const DTSV = 'dtsv'\nexport const FLOAT = 'float'\nexport const GENE_VARIANT = 'geneVariant'\nexport const GENE_EXPRESSION = 'geneExpression'\nexport const ISOFORM_EXPRESSION = 'isoformExpression'\nexport const INTEGER = 'integer'\nexport const JUNCTION = 'junction'\nexport const METABOLITE_INTENSITY = 'metaboliteIntensity'\nexport const MULTIVALUE = 'multivalue'\nexport const PROTEOME_ABUNDANCE = 'proteomeAbundance'\nexport const PROTEOME_DAP = 'proteomeDAP'\nexport const PSEUDOBULK = 'pseudobulk'\nexport const SAMPLELST = 'samplelst'\nexport const SINGLECELL_CELLTYPE = 'singleCellCellType'\nexport const SINGLECELL_GENE_EXPRESSION = 'singleCellGeneExpression'\nexport const SINGLECELL_NUMERIC_VALUE = 'singleCellNumericValue'\nexport const SNP = 'snp'\nexport const SNP_LIST = 'snplst'\nexport const SNP_LOCUS = 'snplocus'\nexport const SSGSEA = 'ssGSEA'\nexport const SURVIVAL = 'survival'\nexport const TERM_COLLECTION = 'termCollection'\nexport const COHORT = 'cohort'\n\n//Term types should be used gradually using these constants instead of hardcoding the values,\n// eg: type == CATEGORICAL instead of type == 'categorical'\n// NOTE: keep this list complete at declaration, do not add entries to it at runtime,\n// so that consumers see the same keys regardless of module load order\nexport const TermTypes = {\n\tGENE_VARIANT,\n\tGENE_EXPRESSION,\n\tISOFORM_EXPRESSION,\n\tSSGSEA,\n\tDNA_METHYLATION,\n\tCATEGORICAL,\n\tINTEGER,\n\tJUNCTION,\n\tFLOAT,\n\tSNP,\n\tSNP_LIST,\n\tSNP_LOCUS,\n\tCONDITION,\n\tSURVIVAL,\n\tSAMPLELST,\n\tMETABOLITE_INTENSITY,\n\tPROTEOME_ABUNDANCE,\n\tPSEUDOBULK,\n\tSINGLECELL_CELLTYPE,\n\tSINGLECELL_GENE_EXPRESSION,\n\tSINGLECELL_NUMERIC_VALUE,\n\tMULTIVALUE,\n\tDATE,\n\tTERM_COLLECTION,\n\tCOHORT,\n\tDTCNV,\n\tDTFUSION,\n\tDTITD,\n\tDTSNVINDEL,\n\tDTSV\n}\n", "import type { NumericBaseTerm, NumTW, PresetNumericBins, RawNumTW } from '../index.ts'\n\nexport const PseudobulkAssay = ['geneExpression'] as const //Add more assays here\n\nexport type PseudobulkTerm = NumericBaseTerm & {\n\ttype: 'pseudobulk'\n\t/** Corresponds to the singleCell.pseudobulk[assay] */\n\tassay: (typeof PseudobulkAssay)[number]\n\t/** Corresponds to the singleCell.pseudobulk[assay][memberId] */\n\tmemberId: string\n\t/** Corresponds to one key in singleCell.pseudobulk[assay][memberId].categories{} */\n\tcategory: string\n\t/** gene symbol */\n\tgene: string\n\tbins?: PresetNumericBins\n}\n\nexport type PseudobulkTW = NumTW & { term: PseudobulkTerm }\n\nexport type RawPseudobulkTerm = PseudobulkTerm & { name?: string }\n\nexport type RawPseudobulkTW = RawNumTW & { term: RawPseudobulkTerm }\n"],
|
|
4
|
+
"sourcesContent": ["import type { BaseHicRequest, XYZCoord } from './hicdata.ts'\n\nexport type HicGenomeRequest = BaseHicRequest & {\n\t/** Entire chromosome list read from the file (see hicstate) */\n\tchrlst: string[]\n\t/** window location */\n\tembedder: string\n\t/** whether or not the file contains 'chr' for the chromosomes */\n\tnochr: boolean\n}\n\nexport type HicGenomeResponse = {\n\tdata: {\n\t\t/** First chromosome */\n\t\tlead: string\n\t\t/** Second chromosome */\n\t\tfollow: string\n\t\titems: XYZCoord[]\n\t}[]\n\t/** Error message to display on the client, if applicable */\n\terror?: string\n}\n\n// TODO: write payload examples to help with automated testing and documentation, for non-prod use only\n// The example below will not work in github CI where only termdb test\nexport const hicGenomePayloadExample = {\n\texamples: [\n\t\t{\n\t\t\trequest: {\n\t\t\t\tbody: {\n\t\t\t\t\tembedder: 'localhost',\n\t\t\t\t\turl: 'https://proteinpaint.stjude.org/ppdemo/hg19/hic/hic_demo.hic',\n\t\t\t\t\tmatrixType: 'observed',\n\t\t\t\t\tnmeth: 'NONE',\n\t\t\t\t\tpos1: '3',\n\t\t\t\t\tpos2: '2',\n\t\t\t\t\tresolution: 1000000\n\t\t\t\t} // satisfies HicGenomeRequest // TODO: fix the type or example\n\t\t\t},\n\t\t\tresponse: {\n\t\t\t\theader: { status: 200 }\n\t\t\t}\n\t\t}\n\t]\n}\n", "import type { ErrorResponse } from './errorResponse.ts'\n\nexport type BubbleHeatmapRequest = {\n\tgenome: string\n\tdslabel: string\n\tgene: string\n}\n\n/** One modification site (PTM) or one protein-level measurement (whole/insoluble\n * proteome). PTM cells carry many of these; protein-level cells carry exactly one. */\nexport type BubbleSite = {\n\t/** site identifier \u2014 the DAPfile `identifier` column (modified peptide for PTM,\n\t * e.g. `K.VAVVRT%PPKSPSS*AK.S`; protein id for protein-level rows) */\n\tid: string\n\t/** raw per-site log2 fold change from the DAPfile */\n\tlog2FC: number\n\t/** per-site FDR (adjusted p-value) from the DAPfile */\n\tfdr: number\n\t/** true when fdr < the response's fdrThreshold; non-significant sites\n\t * are still returned (the client draws non-significant protein-level dots faded\n\t * and hides non-significant PTM sites) */\n\tsignificant: boolean\n\t/** matched reference-assay (total protein) log2FC for this protein (base UniProt\n\t * acc) + cohort, if available */\n\tproteinLog2FC?: number\n\t/** protein-abundance-adjusted change = log2FC \u2212 proteinLog2FC (point estimate),\n\t * present only when proteinLog2FC is available */\n\tadjustedLog2FC?: number\n\t/** true when a matched protein value existed and adjustedLog2FC was computed */\n\tadjustedAvailable: boolean\n}\n\nexport type BubbleCell = {\n\t/** all sites for this (acc, assay, cohort); one entry for protein-level assays */\n\tsites: BubbleSite[]\n}\n\nexport type BubbleHeatmapIsoform = {\n\tgene_name: string\n\t/** data[assay][cohort] \u2192 cell (omitted when the cohort doesn't exist under the\n\t * assay or the gene has no row in that DAPfile) */\n\tdata: {\n\t\t[assay: string]: {\n\t\t\t[cohort: string]: BubbleCell\n\t\t}\n\t}\n}\n\nexport type BubbleHeatmapResponse =\n\t| ErrorResponse\n\t| {\n\t\t\tisoforms: { [isoformId: string]: BubbleHeatmapIsoform }\n\t\t\t/** subset of `assays` that are PTM assays \u2014 rendered as multiple small\n\t\t\t * per-site dots; the rest render as a single big dot per cell */\n\t\t\tptmAssays: string[]\n\t\t\t/** Row order */\n\t\t\tassays: string[]\n\t\t\t/** Column order */\n\t\t\tcohorts: string[]\n\t\t\t/** FDR threshold below which a site is significant. Sites with\n\t\t\t * fdr \u2265 threshold are still returned with `significant: false`; the client\n\t\t\t * draws non-significant protein-level dots faded and omits non-significant\n\t\t\t * PTM sites. */\n\t\t\tfdrThreshold: number\n\t\t\t/** assay used as the total-protein baseline for protein-abundance\n\t\t\t * adjustment, or null when adjustment is not configured for this dataset */\n\t\t\tproteinReferenceAssay: string | null\n\t }\n\nexport const bubbleHeatmapPayload = {\n\trequest: { typeId: 'BubbleHeatmapRequest' },\n\tresponse: { typeId: 'BubbleHeatmapResponse' }\n}\n", "import type { Filter } from '../filter.ts'\nimport type { TermWrapper } from '../terms/tw.ts'\n\nexport type CategoriesRequest = {\n\tgenome: string\n\tdslabel: string\n\tembedder: string\n\t/** termwrapper object */\n\ttw: TermWrapper\n\tfilter?: Filter\n\tfilter0?: any\n\t/** quick fix only for gdc */\n\tcurrentGeneNames?: string[]\n\t/** optional property added by mds3 tk, to limit to cases mutated in this region */\n\trglst?: any\n}\n\ninterface Entries {\n\tsamplecount: number\n\tkey: string\n\tlabel: string\n}\n\n/** number of samples per mutation class, k: mclass key (e.g. \"M\") */\ntype DtClasses = { [mclass: string]: number }\n\n/** a distinct pair of breakpoints of the sv/fusion events of a MnameEntry: one on the\n * queried gene and one on the partner gene named by that entry's mname. lets the\n * term-editing UIs chart the breakpoints of either gene, and select a range of them */\nexport type BreakpointEntry = {\n\t/** breakpoint on the queried gene */\n\tpos: number\n\t/** chr of the partner gene, may differ from that of the queried gene */\n\tpartnerChr: string\n\t/** breakpoint on the partner gene */\n\tpartnerPos: number\n\t/** samples having a sv/fusion of both these breakpoints. NOTE these counts are per\n\t * pair, so summing them across the breakpoints of one .pos (e.g. to chart the\n\t * breakpoints of the queried gene alone) may count a sample with two events at\n\t * that position, to different partners, more than once */\n\tsamplecount: number\n}\n\n/** an amino acid change (e.g. \"G12D\") and its sample count, within a mutation class.\n * for a sv/fusion, .mname is the partner gene (or its chr when unannotated) */\nexport type MnameEntry = {\n\tmname: string\n\tclass: string\n\tsamplecount: number\n\t/** gene of this variant, only present when annotated on the mutation data;\n\t * distinguishes variants of a geneVariant term with multiple genes */\n\tgene?: string\n\t/** breakpoints of the sv/fusion events of this entry, sorted by ascending position.\n\t * only present for a sv/fusion dt, and only for events carrying coordinates */\n\tbreakpoints?: BreakpointEntry[]\n\t/** number of samples whose sv/fusion events of this entry lack a breakpoint\n\t * coordinate, and so are absent from .breakpoints and cannot satisfy a breakpoint\n\t * range. only present when non-zero, so that the ui may caveat the chart */\n\tnoPositionCount?: number\n}\n\n/** per-dt entry returned for a geneVariant term without groupsetting */\nexport type GvCategoryEntry = {\n\tdt: number\n\tclasses: DtClasses | { byOrigin: { [origin: string]: DtClasses } }\n\t/** amino acid changes present for this dt, sorted by descending sample count.\n\t * only served by the termdb/categories route, and only when the mutation data\n\t * carries mname; the same entries returned within a data request (see\n\t * mayGetCategories() in termdb.matrix.js) omit this field */\n\tmnames?: MnameEntry[] | { byOrigin: { [origin: string]: MnameEntry[] } }\n}\n\nexport type CategoriesResponse = {\n\tlst: Entries[] | GvCategoryEntry[]\n\torderedLabels?: []\n}\n\n// TODO: write more payload examples to help with automated testing and documentation, for non-prod use only\n\nexport const termdbCategoriesPayloadExamples = {\n\trequest: {\n\t\ttypeId: 'CategoriesRequest'\n\t},\n\tresponse: {\n\t\ttypeId: 'CategoriesResponse'\n\t},\n\texamples: [\n\t\t{\n\t\t\trequest: {\n\t\t\t\tbody: {\n\t\t\t\t\tgenome: 'hg38-test',\n\t\t\t\t\tdslabel: 'TermdbTest',\n\t\t\t\t\tembedder: 'localhost',\n\t\t\t\t\ttw: { id: 'diaggrp' },\n\t\t\t\t\tfilter: {\n\t\t\t\t\t\ttype: 'tvslst',\n\t\t\t\t\t\tin: true,\n\t\t\t\t\t\tjoin: '',\n\t\t\t\t\t\tlst: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//tag: 'cohortFilter',\n\t\t\t\t\t\t\t\ttype: 'tvs',\n\t\t\t\t\t\t\t\ttvs: {\n\t\t\t\t\t\t\t\t\tterm: {\n\t\t\t\t\t\t\t\t\t\tname: 'Cohort',\n\t\t\t\t\t\t\t\t\t\ttype: 'categorical',\n\t\t\t\t\t\t\t\t\t\tvalues: { ABC: { label: 'ABC' }, XYZ: { label: 'XYZ' } },\n\t\t\t\t\t\t\t\t\t\tid: 'subcohort',\n\t\t\t\t\t\t\t\t\t\tisleaf: false,\n\t\t\t\t\t\t\t\t\t\tgroupsetting: { disabled: true }\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tvalues: [{ key: 'ABC', label: 'ABC' }]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t} // satisfies CategoriesRequest // TODO: use the type definition\n\t\t\t},\n\t\t\tresponse: {\n\t\t\t\theader: { status: 200 }\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t// geneVariant term without groupsetting, returns per-dt entries\n\t\t\t// with classes and mnames (amino acid changes), see GvCategoryEntry\n\t\t\trequest: {\n\t\t\t\tbody: {\n\t\t\t\t\tgenome: 'hg38-test',\n\t\t\t\t\tdslabel: 'TermdbTest',\n\t\t\t\t\tembedder: 'localhost',\n\t\t\t\t\ttw: {\n\t\t\t\t\t\tterm: { type: 'geneVariant', name: 'TP53', genes: [{ kind: 'gene', gene: 'TP53' }] },\n\t\t\t\t\t\tq: { type: 'values' }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tresponse: {\n\t\t\t\theader: { status: 200 }\n\t\t\t}\n\t\t}\n\t]\n}\n", "import type { TermTypes } from '../terms/constants.ts'\nimport type { Filter } from '../filter.ts'\n\n/** */\n// Helps track ambiguous points in the LLM reasoning process for debugging and improvement purposes.\n// Create a fresh array per request/pipeline run to avoid sharing mutable state across module consumers.\nexport const createAmbiguousPoints = (): string[] => []\n\nexport type ChatRequest = {\n\tgenome: string\n\tdslabel: string\n\tfilter?: Filter\n\t/** user prompt */\n\tprompt: string\n\t__protected__?: any\n}\n\nexport type TextResponse = {\n\ttype: 'text'\n\t/** Plain text message to display in the chat */\n\ttext: string\n}\nexport type HtmlResponse = {\n\ttype: 'html'\n\t/** Pre-approved HTML from the dataset JSON resources array */\n\thtml: string\n}\nexport type PlotResponse = {\n\ttype: 'plot'\n\tplot: object\n\tmsg?: string\n\t/** Specifies what action to take e.g. Summary plot or no action. Will add more chart types later */\n}\n\nexport interface GeneDataTypeResult {\n\tgene: string\n\tdataType: string\n}\n\n/** Gene data types a dataset supports, for the mass omnisearch to decide which gene-search actions\n * (expression / variant sub-types / methylation / genome browser) to offer. */\nexport interface GeneDataTypeAvailability {\n\tgeneExpression: boolean\n\tdnaMethylation: boolean\n\tsnvindel: boolean\n\tcnv: boolean\n\tsvfusion: boolean\n\t/** True when any genomic-alteration data type (snvindel/cnv/svfusion) is available, meaning a\n\t * genome browser can be seeded for the gene. Derived from the three flags above. */\n\tgenomeBrowser: boolean\n}\n\n/** One matched gene together with the data types available for that specific gene. */\nexport interface GeneMatch {\n\tgene: string\n\tdataTypes: GeneDataTypeAvailability\n\t/** Default genomic coordinate for the gene, used to seed a genome browser track (e.g. the DNA\n\t * methylation region picker) so the client needs no separate genelookup request. Null when the\n\t * gene is not resolved to a coordinate (only resolved for genes that need a genome browser). */\n\tcoord: { chr: string; start: number; stop: number } | null\n}\n\n/** One matched sample. Only sent when the dataset allows displaying sample ids\n * (authApi.canDisplaySampleIds); a dataset that does not permit it yields no samples at all, so the\n * client needs no permission check of its own. */\nexport interface SampleMatch {\n\tid: number | string\n\tname: string\n\t/** Sample selection for the single-cell viewer, when this sample has single-cell data. */\n\tsingleCell?: { sID: string; eID?: string }\n\t/** Facet-table assays available for this sample, when track-list facet data exists. */\n\tassays?: { facet: string; names: string[] }[]\n\t/** true when the sample has plain whole-slide images on disk\n\t (ds.queries.w2.wsiFolder); shows the \"Whole Slide Images\" action */\n\twsimages?: boolean\n}\n\n/** Result of the mass omnisearch: matched dictionary terms and matched genes, each carrying its own\n * available gene data types so the client can offer the appropriate per-gene action buttons. */\nexport interface OmnisearchResult {\n\tdictionaryTerms: any[]\n\tgenes: GeneMatch[]\n\t/** Matched samples. Always [] for a dataset that does not allow displaying sample ids. */\n\tsamples: SampleMatch[]\n\t/** Total match count per result type BEFORE the per-type display cap. Lets the client show a\n\t * \"Displaying N out of M\" note when a type's matches were truncated (total > the returned array length). */\n\ttotals?: { dictionaryTerms: number; genes: number; samples: number }\n\t/** Parsed genomic coordinate when the prompt is a valid \"chr:start-stop\" range AND the dataset\n\t * supports the genome browser genomic view (has snvindel/cnv/svfusion and gbRestrictMode !== 'protein').\n\t * Null/absent otherwise. Resolved server-side (via string2pos) so the client needs no genome object. */\n\tcoord?: { chr: string; start: number; stop: number } | null\n\terror?: any\n}\n\nexport type LlmConfig = {\n\tprovider: 'SJ' | 'ollama' | 'huggingface' | 'azure'\n\tEmbeddingProvider: 'SJ' | 'ollama' | 'huggingface'\n\tEmbeddingProviderApi: string\n\tapi: string\n\tapiToken?: string\n\tEmbeddingProviderApiToken?: string\n\tmodel: ModelConfig\n\tembeddingModelName: string\n\t/** Whether to load the embedding model locally (via transformers.js) or call a remote API. Defaults to 'api'. */\n\tembeddingModelAccess?: 'local' | 'api'\n\t/** Smaller model to use for LLM classification fallback. Defaults to `model` if not set. */\n\tclassifierModelConfig?: ModelConfig\n\t/** Log verbose debug output (e.g. raw embedding arrays) to the terminal. Defaults to false. */\n\tverbose?: boolean\n}\n\nexport type ModelConfig = {\n\tmodelName: string\n\tmaxTokens: number\n}\n\nexport interface GeneSetDataTypeResult {\n\tgeneSet: string\n\tdataType: typeof TermTypes.SSGSEA | typeof TermTypes.GENE_VARIANT | 'ambiguous' | typeof TermTypes.GENE_EXPRESSION\n}\n\nexport type ChatResponse = TextResponse | HtmlResponse | PlotResponse\n\nexport type SummaryType = {\n\t/** Name of 1st term */\n\tterm: string\n\t/** Name of 2nd term */\n\tterm2?: string\n\t/** Optional simple filter terms */\n\tsimpleFilter: FilterTerm[]\n\t/** Optional explicit child type requested by the user. If omitted, the logic of the data types picks the child type. */\n\tchildType?: 'violin' | 'boxplot' | 'sampleScatter' | 'barchart'\n}\n\nexport type FilterTerm =\n\t| CategoricalFilterTerm\n\t| NumericFilterTerm /** FilterTerm can either be numeric or categorical */\n\nexport type CategoricalFilterTerm = {\n\t/** Name of categorical term */\n\tterm: string\n\t/** The category of the term */\n\tcategory: string\n\t/** join term to be used only when there is more than one filter term and should be placed from the 2nd filter term onwards describing how it connects to the previous term */\n\tjoin?: 'and' | 'or'\n}\n\nexport type NumericFilterTerm = {\n\t/** Name of numeric term */\n\tterm: string\n\t/** start position (or lower limit) of numeric term */\n\tstart?: number\n\t/** stop position (or upper limit) of numeric term */\n\tstop?: number\n\t/** join term to be used only when there is more than one filter term and should be placed from the 2nd filter term onwards describing how it connects to the previous term */\n\tjoin?: 'and' | 'or'\n}\n\nexport type DbRows = {\n\t/** Name of the term */\n\tname: string\n\t/** Description of the term in plain language */\n\tdescription: string\n\t/** The type of variable stored in the DB (e.g. categorical, float) */\n\tterm_type: string\n\t/** Array of {key,value} terms storing the possible categories for a categorical variable */\n\tvalues: DbValue[]\n}\n\nexport type DbValue = {\n\t/** Name of the key */\n\tkey: string\n\t/** Object of values corresponding to the key */\n\tvalue: any\n}\n\nexport type ClassificationType =\n\t| plot_type\n\t| resource_type\n\t| none_type /** Variable containing the type of action the UI needs to take */\n\nexport type plot_type = {\n\t/** When type == plot, show the corresponding plot in the plot field */\n\ttype: 'plot'\n\t/** The type of plot to be displayed on the UI.\n\t * Standard categories are listed; datasets may define additional custom categories. */\n\tplot: 'summary' | 'dge' | 'survival' | 'matrix' | 'sampleScatter' | 'hierCluster' | 'genomeBrowser'\n}\n\nexport type resource_type = {\n\t/** When type == resource, invoke the resource agent to return a matching resource link */\n\ttype: 'resource'\n}\n\nexport type none_type = {\n\t/** When type == none, the query did not match any known category */\n\ttype: 'none'\n}\n\n/** Top-level classification returned by classifyQuery: plot or notplot (subtype determined separately by plot.ts) */\nexport type QueryClassification = { type: 'plot' } | { type: 'notplot' } | { type: 'binaryQuery' }\n\n/** Specific plot type returned by classifyPlotType in plot.ts */\nexport type PlotType =\n\t| 'summary'\n\t| 'dge'\n\t| 'survival'\n\t| 'cox'\n\t| 'matrix'\n\t| 'prebuiltscatter'\n\t| 'hiercluster'\n\t| 'genomeBrowser'\n\nexport type DEType = {\n\t/** Name of group1 which is an array of filter terms */\n\tgroup1: FilterTerm[]\n\t/** Name of group2 which is an array of filter terms */\n\tgroup2: FilterTerm[]\n\t/** Method used for carrying out differential gene expression analysis */\n\tmethod?: 'edgeR' | 'limma' | 'wilcoxon'\n}\n\nexport type MatrixType = {\n\t/** Names of dictionary terms to include as rows in the matrix (e.g. \"Diagnosis\", \"Gender\", \"Race\") */\n\tterms?: string[]\n\t/** Names of genes to include as gene variant rows in the matrix (e.g. \"TP53\", \"KRAS\", \"NRAS\") */\n\tgeneNames?: string[]\n\t/** Names of gene sets containing ssGSEA enrichment scores */\n\tgenesetNames?: string[]\n\t/** Optional simple filter terms to restrict the sample set */\n\tsimpleFilter?: FilterTerm[]\n}\n\nexport type HierClusterType = {\n\t/** Names of genes to include in the hierarchical clustering (e.g. \"TP53\", \"KRAS\", \"BCR\") */\n\tgeneNames?: string[]\n\t/** Names of gene sets containing list of genes to be used for hierarchical clustering */\n\tgenesetNames?: string[]\n\t/** Optional simple filter terms to restrict the sample set */\n\tsimpleFilter?: FilterTerm[]\n}\n\nexport type SampleScatterType = {\n\t/** Name of the pre-built plot (e.g. \"Transcriptome t-SNE\", \"Transcriptome UMAP\") */\n\tplotName: string\n\t/** Term or gene name to overlay as color, or null to remove color overlay */\n\tcolorTW?: string | null\n\t/** Term or gene name to overlay as shape, or null to remove shape overlay */\n\tshapeTW?: string | null\n\t/** Term or gene name to overlay as Z-divide, or null to remove divide overlay */\n\tterm0?: string | null\n\t/** Optional simple filter terms */\n\tsimpleFilter?: FilterTerm[]\n}\n", "import type { Filter } from '../filter.ts'\nimport type { TermWrapper } from '../terms/tw.ts'\n\nexport type DescrStatsRequest = {\n\t/** genome label in the serverconfig.json */\n\tgenome: string\n\t/** dataset label for the given genome */\n\tdslabel: string\n\t// embedder: string\n\t/** wrapper of a numeric term, q.mode can be any as getData() will always pull sample-level values for summarizing */\n\ttw: TermWrapper\n\t/** if true, the (violin) plot is in log scale and must exclude 0-values from the stat */\n\tlogScale?: boolean\n\t/** optional pp filter */\n\tfilter?: Filter\n\t/** optional gdc filter */\n\tfilter0?: any\n}\n\nexport type DescrStats = {\n\t[key: string]: {\n\t\tkey: string\n\t\tlabel: string\n\t\tvalue: number\n\t}\n}\n\nexport type DescrStatsResponse = DescrStats\n\n// TODO: write more payload examples to help with automated testing and documentation, for non-prod use only\n\nexport const descrStatsPayloadExamples = {\n\trequest: {\n\t\ttypeId: 'DescrStatsRequest'\n\t},\n\tresponse: {\n\t\ttypeId: 'DescrStatsResponse'\n\t},\n\texamples: [\n\t\t{\n\t\t\trequest: {\n\t\t\t\tbody: {\n\t\t\t\t\tgenome: 'hg38-test',\n\t\t\t\t\tdslabel: 'TermdbTest',\n\t\t\t\t\tembedder: 'localhost',\n\t\t\t\t\ttw: { term: { id: 'hrtavg' }, q: { mode: 'continuous' } },\n\t\t\t\t\tfilter: {\n\t\t\t\t\t\ttype: 'tvslst',\n\t\t\t\t\t\tin: true,\n\t\t\t\t\t\tjoin: '',\n\t\t\t\t\t\tlst: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttag: 'cohortFilter',\n\t\t\t\t\t\t\t\ttype: 'tvs',\n\t\t\t\t\t\t\t\ttvs: {\n\t\t\t\t\t\t\t\t\tterm: {\n\t\t\t\t\t\t\t\t\t\tname: 'Cohort',\n\t\t\t\t\t\t\t\t\t\ttype: 'categorical',\n\t\t\t\t\t\t\t\t\t\tvalues: { ABC: { label: 'ABC' }, XYZ: { label: 'XYZ' } },\n\t\t\t\t\t\t\t\t\t\tid: 'subcohort',\n\t\t\t\t\t\t\t\t\t\tisleaf: false,\n\t\t\t\t\t\t\t\t\t\tgroupsetting: { disabled: true }\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tvalues: [{ key: 'ABC', label: 'ABC' }]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t} // satisfies DescrStatsRequest // TODO: enable type check\n\t\t\t},\n\t\t\tresponse: {\n\t\t\t\theader: { status: 200 }\n\t\t\t}\n\t\t}\n\t]\n}\n", "import type { DataEntry, VolcanoData, VolcanoRenderRequest } from './termdb.DE.js'\nimport type { DmrRunResources, TermdbDmrBatchSuccessResponse } from './termdb.dmrBatch.js'\n\n/** The element_type that asks the differential-methylation volcano to call DMRs de novo across\n * the genome (termdb/dmrBatch scan mode) instead of testing a pre-annotated element class. Not a\n * key into ds.queries.dnaMethylation.elements; termdb.config.ts lists it among elementTypes when\n * the dataset has a matrix the region analysis can run on. */\nexport const DMR_SCAN_ELEMENT_TYPE = 'dmr_scan'\n\n/** Default CpG floor, shared because the client seeds its control with it and the server falls\n * back to it for a request that omits one -- two readings of \"an untouched scan\" that must agree.\n * Two-CpG calls carry the LARGEST effect sizes and split 51.5% / 48.5% hyper / hypo on MMRF chr1\n * -- a coin flip -- where 10+ CpG calls run 58% hyper. Five keeps 86% of calls and all of the\n * structure. Not part of any cache key: the floor is applied to a cached scan's DMRs. */\nexport const DEFAULT_MIN_CPGS = 5\n\nexport type DiffMethRequest = {\n\t/** Discriminator tag. Matches the `kind` field on `DmCacheResult` and\n\t * lets the GSEA route tell a snapshot DM request apart from a snapshot\n\t * DE request without structural-shape probing. */\n\tkind: 'DM'\n\t/** Genome build name */\n\tgenome: string\n\t/** Dataset label */\n\tdslabel: string\n\t/** Object containing two arrays of samples for differential methylation analysis */\n\tsamplelst: any\n\t/** Minimum non-NA samples required per group (default 3) */\n\tmin_samples_per_group?: number\n\t/** Drop chrX/chrY elements before testing (default false). X-inactivation makes\n\t * chrX methylation strongly sex-dependent, so a sex-imbalanced comparison produces\n\t * chrX hits that are sex rather than the grouping variable. */\n\texclude_sex_chr?: boolean\n\t/** Which regulatory-element class to test, keying into\n\t * ds.queries.dnaMethylation.elements. Absent means 'promoter', which keeps every\n\t * existing client request and cache entry valid. The available keys and their\n\t * display labels come from the dataset config, so the picker is data-driven rather\n\t * than a hardcoded list. */\n\telement_type?: string\n\t/** Only read when element_type is DMR_SCAN_ELEMENT_TYPE. Every field has a default, so a bare\n\t * scan request scans the whole genome uncorrected and keeps DMRs of 5+ CpGs. */\n\tscan?: {\n\t\t/** one chromosome to scan; absent = every major chromosome except the mitochondrion */\n\t\tchromosome?: string\n\t\t/** score each DMR against matched intergenic background (termdb/dmrBatch\n\t\t * backgroundCorrection); the volcano's p then becomes that empirical p and DMRs whose\n\t\t * stratum held too little background are left out of the rows */\n\t\tbackgroundCorrection?: boolean\n\t\t/** drop DMRs called from fewer CpGs than this before rendering; absent = DEFAULT_MIN_CPGS */\n\t\tminCpgs?: number\n\t\t/** display width of the methylome-wide profile's bins, in bp. Several native bins are\n\t\t * averaged into one at render time; absent or at/below the native width draws them as\n\t\t * computed. Not part of any cache key -- changing it redraws a cached scan. */\n\t\tprofileBinBp?: number\n\t\t/** DMRcate lambda, C and per-CpG FDR cutoff, passed to termdb/dmrBatch; absent = its defaults.\n\t\t * Part of the scan's cache key, so changing one refits. */\n\t\tlambda?: number\n\t\tC?: number\n\t\tfdrCutoff?: number\n\t}\n\t/** Term for confounding variable 1 (if present) */\n\ttw?: any\n\t/** Term for confounding variable 2 (if present) */\n\ttw2?: any\n\t/** Option to return early with actual number of samples with methylation values */\n\tpreAnalysis?: boolean\n\t/** Parameters for the server-side `da` Rust renderer. Always required \u2014 the\n\t * server always returns a rendered PNG plus the threshold-passing rows. */\n\tvolcanoRender: VolcanoRenderRequest\n}\n\n/** Response when DiffMethRequest.preAnalysis === true. Returns per-group\n * sample counts (keyed by group name) plus an optional validation alert. */\nexport type DiffMethPreAnalysisResponse = {\n\t/** number of samples with methylation data, keyed by group name. a group name is\n\t * user-supplied, so it must not share this object with any other property */\n\tdata: Record<string, number>\n\t/** validation message; the client hides the run button while it is present */\n\talert?: string\n}\n\n/** Response for a full differential methylation run (preAnalysis absent/false). */\nexport type DiffMethFullResponse = {\n\t/** The volcano payload \u2014 per-element interactive dots + PNG + extents +\n\t * totals. See VolcanoData for details. */\n\tdata: VolcanoData<DiffMethEntry>\n\t/** Effective sample size for group 1 */\n\tsample_size1: number\n\t/** Effective sample size for group 2 */\n\tsample_size2: number\n\t/** Present only for a DMR scan: what the scan did and found, beyond the rows themselves. */\n\tscan?: DmrScanSummary\n}\n\n/** Whole-scan facts the volcano's Statistics panel and genome map are drawn from. Every count here\n * is over the scan as returned by termdb/dmrBatch, before the volcano's own thresholds, so the\n * panel can state what the rows were selected from. */\nexport type DmrScanSummary = {\n\t/** chromosomes scanned, in genome order */\n\tchromosomes: string[]\n\ttotalProbesAnalyzed: number\n\t/** DMRs the scan called, before any filtering here */\n\tcalled: number\n\t/** the minCpgs that was applied, and how many DMRs met it */\n\tminCpgs: number\n\tkept: number\n\t/** direction split of the kept DMRs */\n\thyper: number\n\thypo: number\n\t/** width quantiles (bp) of the kept DMRs; absent when none were kept */\n\twidth?: { median: number; q1: number; q3: number }\n\tglobalMethylation?: { controlMeanBeta: number; caseMeanBeta: number; shift: number; valuesCounted: number }\n\tregionMask?: { sources: string[]; overlapFrac: number; dmrsDropped: number }\n\t/** present when the correction ran. `scored` and `significant` count the kept DMRs; `unscored`\n\t * kept DMRs had no background in their stratum and are not among the rows */\n\tbackgroundCorrection?: { windows: number; scored: number; unscored: number; significant: number; matchedOn: string[] }\n\t/** genes under kept hypomethylated gene-body DMRs -- the set the expression test\n\t * (termdb/dmrGeneDE) runs on. With the background correction on, a region must also beat its\n\t * matched background (p<0.05), which makes this the stricter of two readings rather than the\n\t * only one. Absent when no DMR qualifies. */\n\tgeneBodyLoss?: { regions: number; genes: string[] }\n\t/** The two groups cut to the samples with methylation data, as sample ids: the cohort any\n\t * expression step after a scan should run on, so both readings come from the same patients. */\n\tmatchedSamplelst?: { groups: { name: string; values: { sampleId: number | string }[]; [k: string]: any }[] }\n\t/** what the scan cost when it was computed; see DmrRunResources */\n\tresources?: DmrRunResources\n\t/** Mean methylation per group in fixed-width bins along the genome: the profile methylome\n\t * papers plot for a genome-wide comparison, covering every bin with probes rather than only\n\t * the called DMRs. See TermdbDmrBatchSuccessResponse.binMethylation. */\n\tbinMethylation?: NonNullable<TermdbDmrBatchSuccessResponse['binMethylation']>\n\t/** The rendered genome-wide methylation profile: the per-bin group difference along the genome.\n\t * Rendered per request, after the cache, like the DMR Manhattan. `interactive` is how many bins\n\t * per direction carry pixel coordinates; `dotRadius` is the radius the PNG was drawn at, which\n\t * the client's hover layer must match to land on the dots. */\n\tprofile?: {\n\t\tpng: string\n\t\tplotData: any\n\t\t/** the width actually drawn, which is the requested display width when one was asked for */\n\t\tbinBp: number\n\t\tplotWidth: number\n\t\tplotHeight: number\n\t\tdotRadius: number\n\t\t/** bins drawn at that width */\n\t\tbins: number\n\t\t/** how many of them are hoverable: the top N per direction by |delta beta|, so at a coarse\n\t\t * width where the rule reaches every bin this equals `bins` */\n\t\tinteractive: number\n\t}\n\t/** Quantiles of the per-bin difference and the fraction of bins that moved beyond a threshold:\n\t * how much of the measured methylome changed, which the DMR counts alone do not say. */\n\tprofileSummary?: {\n\t\tbins: number\n\t\tmedian: number\n\t\tq1: number\n\t\tq3: number\n\t\tfractionBeyond05: number\n\t\tfractionBeyond10: number\n\t\tfractionHyper: number\n\t}\n\t/** the cached scan the rows came from, so anything ranked off the same scan (e.g.\n\t * termdb/dmrGeneLink) can reach it without recomputing anything */\n\tcacheId?: string\n\t/** The kept DMRs written as a bedj track file under the \"bedj\" cache subdir, as its file name.\n\t * A genome browser opened on the scan loads it with isCache:true, so the track is an ordinary\n\t * bedj file tk rather than items the browser has to fetch and swap per chromosome. */\n\tbedjFile?: string\n\t/** Every kept DMR drawn along the genome, hyper above the line and hypo below, y = signed\n\t * -log10 of the q the volcano plots; the N most significant per direction carry pixel\n\t * coordinates and are interactive. Rendered per request, after the cache, because it depends\n\t * on the client's pixel ratio. */\n\tmanhattan?: { png: string; plotData: any; interactive: number; plotWidth: number; plotHeight: number }\n}\n\nexport type DiffMethResponse = DiffMethPreAnalysisResponse | DiffMethFullResponse\n\n/** One tested regulatory element. Despite the field names, this is NOT promoter-specific:\n * the same shape describes promoters, cCRE classes, eQTM blocks and promoter sub-window tiles.\n * `promoter_id` keeps its name only for backward compatibility with existing clients \u2014 read\n * `element_class` to know what a row actually is. */\nexport type DiffMethEntry = DataEntry & {\n\t/** Row key, unique within a result. For an untiled run this equals `element_id`; for a\n\t * tiled run it is the composite \"<element_id>::tile<N>\", so rows stay unique while\n\t * `element_id` remains groupable. Named `promoter_id` for backward compatibility from when\n\t * the analysis was promoter-only. */\n\tpromoter_id: string\n\t/** The bare element identifier, without any tile suffix \u2014 e.g. an ENCODE cCRE accession\n\t * (EH38E3756858) for cCRE builds, or the builder's own id for eQTM blocks. Resolved from\n\t * meta/element/elementID, meta/element_id, or legacy meta/promoter/promoterID. */\n\telement_id: string\n\t/** Which class this row belongs to: 'promoter', 'enhancer_distal', 'eqtm_block', etc.\n\t * Present per row because one matrix may hold several classes, in which case the run-level\n\t * label is 'mixed' while each row still names its own. */\n\telement_class: string\n\t/** Sub-window index within the element, 5'->3'. Only present when the input was a tile\n\t * matrix (build_element_matrix.py --tiles N); absent otherwise, so a non-tiled run's shape\n\t * is unchanged. */\n\ttile_index?: number\n\t/** Gene symbol(s) associated with the element (comma-separated if multiple, may be empty) */\n\tgene_name: string\n\t/** Chromosome (e.g. \"chr1\") */\n\tchr: string\n\t/** Element start coordinate (0-based). For a tile row this is the tile's own span, not the\n\t * parent element's. */\n\tstart: number\n\t/** Element end coordinate (exclusive) */\n\tstop: number\n\t/** Group 1 (control) mean beta, over observed cells only. Absent on a DMR-scan row, which\n\t * carries the difference but not the two means. */\n\tmean_beta_control?: number\n\t/** Group 2 (case) mean beta, over observed cells only */\n\tmean_beta_case?: number\n\t/** mean_beta_case - mean_beta_control. The interpretable effect size: fold_change is a\n\t * difference of M-values (a logit), so it does not say how much methylation changed.\n\t * Same sign as fold_change, since both are case - control. Derived by back-transforming\n\t * the stored M-values, which yields the alpha-smoothed beta and so shrinks the difference\n\t * toward zero by 2/(depth+2) \u2014 under 1% at this cohort's typical promoter depth. */\n\tdelta_beta: number\n\t/** DMR-scan rows only (element_class 'dmr'): CpGs the region was called from, and when the\n\t * background correction ran, the observed delta-beta minus the matched drift. */\n\tno_cpgs?: number\n\texcess?: number\n}\n\n/** What diffMeth.R actually tested, as opposed to what was asked for. Emitted by the R script\n * alongside the rows; NOT currently forwarded to the client by termdb.diffMeth.ts, which passes\n * only `promoter_data` through. Documented here because the R output is a shared contract and a\n * caller reading it directly (or a future route that does forward it) needs the shape.\n *\n * It exists because promoter, enhancer and tile runs all use identical column names, so without\n * it a result is indistinguishable from any other. */\nexport type DiffMethElementMeta = {\n\t/** The class tested, or 'mixed' when the retained rows span more than one. Computed over the\n\t * rows that survived filtering, not over the whole matrix. */\n\telement_class: string\n\t/** Which h5 path supplied the row ids \u2014 meta/element/elementID, meta/element_id, or\n\t * meta/promoter/promoterID. Distinguishes a new build from a legacy promoter-only one. */\n\tid_source: string\n\t/** Whether the input was a tile matrix, i.e. whether rows carry tile_index. */\n\tis_tiled: boolean\n\t/** Elements that passed filtering and entered the model. */\n\tn_elements_tested: number\n}\n\n// TODO: write payload examples to help with automated testing and documentation, for non-prod use only\n", "import type { Filter } from '../filter.ts'\nimport type { Term } from '../terms/term.ts'\n\nexport type PercentileRequest = {\n\t/** a user-defined genome label in the serverconfig.json, hg38, hg19, mm10, etc */\n\tgenome: string\n\t/** a user-defined dataset label in the serverconfig.json, such as ClinVar, SJLife, GDC, etc */\n\tdslabel: string\n\tembedder: string\n\tgetpercentile: number[]\n\t/** term id string */\n\tterm: Term\n\tfilter?: Filter\n\tfilter0?: any\n}\n\nexport type PercentileResponse = {\n\tvalues: number[]\n}\n\n// TODO: write more payload examples to help with automated testing and documentation, for non-prod use only\n\nexport const percentilePayloadExamples = {\n\trequest: {\n\t\ttypeId: 'PercentileRequest'\n\t},\n\tresponse: {\n\t\ttypeId: 'PercentileResponse'\n\t},\n\texamples: [\n\t\t{\n\t\t\trequest: {\n\t\t\t\tbody: {\n\t\t\t\t\tgenome: 'hg38-test',\n\t\t\t\t\tdslabel: 'TermdbTest',\n\t\t\t\t\tembedder: 'localhost',\n\t\t\t\t\tgetpercentile: [50],\n\t\t\t\t\tterm: { id: 'agedx' },\n\t\t\t\t\tfilter: {\n\t\t\t\t\t\ttype: 'tvslst',\n\t\t\t\t\t\tin: true,\n\t\t\t\t\t\tjoin: '',\n\t\t\t\t\t\tlst: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttag: 'cohortFilter',\n\t\t\t\t\t\t\t\ttype: 'tvs',\n\t\t\t\t\t\t\t\ttvs: {\n\t\t\t\t\t\t\t\t\tterm: {\n\t\t\t\t\t\t\t\t\t\tname: 'Cohort',\n\t\t\t\t\t\t\t\t\t\ttype: 'categorical',\n\t\t\t\t\t\t\t\t\t\tvalues: { ABC: { label: 'ABC' }, XYZ: { label: 'XYZ' } },\n\t\t\t\t\t\t\t\t\t\tid: 'subcohort',\n\t\t\t\t\t\t\t\t\t\tisleaf: false,\n\t\t\t\t\t\t\t\t\t\tgroupsetting: { disabled: true }\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tvalues: [{ key: 'ABC', label: 'ABC' }]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t} // satisfies PercentileRequest // TODO: enable type check\n\t\t\t},\n\t\t\tresponse: {\n\t\t\t\theader: { status: 200 }\n\t\t\t}\n\t\t}\n\t]\n}\n", "export type RootTermRequest = {\n\t/** a user-defined genome label in the serverconfig.json, hg38, hg19, mm10, etc */\n\tgenome: string\n\t/** a user-defined dataset label in the serverconfig.json, such as ClinVar, SJLife, GDC, etc */\n\tdslabel: string\n\tembedder: string\n\tdefault_rootterm: number\n\tcohortValues: string\n\ttreeFilter: string\n}\n\ninterface Entries {\n\tname: string\n\tid: string\n\tisleaf: boolean\n\tincluded_types: string[]\n\tchild_types: string[]\n}\n\nexport type RootTermResponse = {\n\tlst: Entries[]\n}\n\nexport const rootTermPayloadExamples = {\n\trequest: {\n\t\ttypeId: 'RootTermRequest'\n\t},\n\tresponse: {\n\t\ttypeId: 'RootTermResponse'\n\t},\n\texamples: [\n\t\t{\n\t\t\trequest: {\n\t\t\t\tbody: {\n\t\t\t\t\tgenome: 'hg38-test',\n\t\t\t\t\tdslabel: 'TermdbTest',\n\t\t\t\t\tembedder: 'localhost',\n\t\t\t\t\tdefault_rootterm: 1,\n\t\t\t\t\tcohortValues: 'ABC'\n\t\t\t\t} // satisfies RootTermRequest // TODO: enable type check\n\t\t\t},\n\t\t\tresponse: {\n\t\t\t\theader: { status: 200 }\n\t\t\t}\n\t\t}\n\t]\n}\n", "export type RunChartRequest = {\n\tgenome: string\n\tdslabel: string\n\t/**\n\t * term wrapper for x axis: { term, q }.\n\t * runChart2: q.mode='continuous' \u2192 1 series.\n\t * runChart2Period: q.mode='discrete' (with bins) \u2192 multiple series by period.\n\t */\n\txtw: { term: { id: string }; q?: { mode?: 'continuous' | 'discrete' }; $id?: string }\n\t/** term wrapper for y axis: { term, q }. When omitted, chart renders as frequency (count per time bucket). */\n\tytw?: { term: { id: string }; q?: { mode?: string }; $id?: string }\n\taggregation?: 'median'\n\t/** When true (frequency mode only), series Y values are cumulative counts. */\n\tshowCumulativeFrequency?: boolean\n\tfilter?: any\n\t__protected__?: any // auth token for accessing protected data\n}\n\nexport type RunChartSeries = {\n\t/** period/series identifier */\n\tseriesId?: string\n\t/** calculated Y median value for this curve */\n\tmedian: number\n\tpoints: Point[]\n}\n\nexport type RunChartSuccessResponse = {\n\tstatus: 'ok'\n\t/** each series is one curve, with a median. a runchart may show 1 or multiple curves */\n\tseries: RunChartSeries[]\n}\n\nexport type RunChartErrorResponse = {\n\terror: string\n\t/** Always empty on error; present so response shape is consistent for clients/checkers. */\n\tseries: RunChartSeries[]\n}\n\n/** Discriminated union: server returns success shape on 200 or error shape with series: []. */\nexport type RunChartResponse = RunChartSuccessResponse | RunChartErrorResponse\n\nexport function isRunChartSuccess(r: RunChartResponse): r is RunChartSuccessResponse {\n\treturn 'status' in r && r.status === 'ok'\n}\n\ntype Point = {\n\t/** decimal year, e.g. 2024.21321321 */\n\tx: number\n\t/** text of human-readable x value, e.g. \"Jan 2024\" which may be by the months, depends on dataset customization */\n\txName: string\n\t/** timeline, e.g. number of days */\n\ty: number\n\t/** number of samples with this timeline at this time point */\n\tsampleCount: number\n}\n\n// TODO: write payload examples to help with automated testing and documentation, for non-prod use only\n", "import type { Filter } from '../filter.ts'\nimport type { ErrorResponse } from './errorResponse.ts'\nimport type { ColorLegendEntry, ShapeLegendEntry } from './termdb.sampleScatter.ts'\nimport type { TermWrapper } from '../terms/tw.ts'\n\n/** Test sample ID for single cell plots.\n * Recreated here from utils/src/test/testData.ts so\n * es-lint doesn't complain. */\nconst scTestSample = '2646'\n\nexport type TermdbSingleCellPlotsRequest = {\n\t/** Genome id */\n\tgenome: string\n\t/** Dataset label */\n\tdslabel: string\n\tsingleCellPlot: {\n\t\t/** Name of the single cell plot type, e.g. 'umap', 'tsne' */\n\t\tname: string\n\t\tsample?: { eID?: string; sID: string }\n\t\tisMetaResult?: boolean\n\t}\n\tfilter?: Filter\n\tfilter0?: any //ds specific filter, specifically for api requests\n\t/** When sample size is too large, canvas rendering uses\n\t * these settings to control how the plot is rendered. */\n\tcanvasSettings: {\n\t\t/** Maximum number of samples to render on the client side.\n\t\t * If over the cutoff, will return an image instead of sample array.\n\t\t * Matches the maxSvgSamplesCutoff in scatter settings.*/\n\t\tcutoff: number\n\t\t/** Width of the scatter canvas */\n\t\twidth: number\n\t\t/** Height of the scatter canvas */\n\t\theight: number\n\t\t/** Radius of the points in the scatter plot. In scatter,\n\t\t * this is the setting size. */\n\t\tradius: number\n\t\t/** Default or user defined lower limit cutoff for x scale */\n\t\tminXScale: number | null\n\t\t/** Default or user defined upper limit cutoff for x scale */\n\t\tmaxXScale: number | null\n\t\t/** Default or user defined lower limit cutoff for y scale */\n\t\tminYScale: number | null\n\t\t/** Default or user defined upper limit cutoff for y scale */\n\t\tmaxYScale: number | null\n\t\t/** Default or user defined opacity for the scatter plot points */\n\t\topacity: number\n\t\t/** Required non expression color for scge plots. 'startColor' is the\n\t\t * settings key in the scatter. */\n\t\tstartColor: string\n\t\t/** Required non expression color for scge plots. 'stopColor' is the\n\t\t * settings key in the scatter. */\n\t\tstopColor: string\n\t\t/** Device pixel ratio from the client for HiDPI rendering */\n\t\tdevicePixelRatio?: number\n\t\tcolorScaleMode?: 'auto' | 'fixed' | 'percentile'\n\t\tcolorScaleMinFixed?: number | null\n\t\tcolorScaleMaxFixed?: number | null\n\t\tcolorScalePercentile?: number\n\t}\n\t/** Term wrapper for coloring the single cell plot */\n\tcolorTW?: TermWrapper\n\t/** Term wrappers for gene expression */\n\tcoordTWs?: TermWrapper[]\n}\n\nexport type TermdbSingleCellPlotsResponse = ErrorResponse | ValidSingleCellPlotsResponse\n\n/** The computed coordinate and gene expression range for cells\n * returned in a single request. Scoped to the specific plot type\n * (e.g. 'umap', 'tsne') and optional sample filter \u2014 not a global\n * range across all plots or samples. Used to define axis domains\n * and color scale domains for rendering. */\nexport type SingleCellRange = {\n\t/** Minimum x coordinate across all cells in this plot response */\n\txMin: number\n\t/** Maximum x coordinate across all cells in this plot response */\n\txMax: number\n\t/** Minimum y coordinate across all cells in this plot response */\n\tyMin: number\n\t/** Maximum y coordinate across all cells in this plot response */\n\tyMax: number\n\t/** Minimum gene expression value (Infinity when no expression data) */\n\tgeMin: number\n\t/** Maximum gene expression value (-Infinity when no expression data) */\n\tgeMax: number\n}\n\n/** Returns cell data formatted in samples array for the sampleScatter */\nexport type FormattedCell2Sample = {\n\t/** Cell identifier used as the sample id */\n\tsampleId: string\n\t/** X coordinate of the cell in the plot */\n\tx: number\n\t/** Y coordinate of the cell in the plot */\n\ty: number\n\t/** Z coordinate, always 0 (2D plots only) */\n\tz: number\n\t/** Cell type or group assignment for coloring */\n\tcategory: string\n\t/** Shape key for the legend, always 'Ref' */\n\tshape: string\n\t/** Visibility state based on user-hidden categories */\n\thidden: { category: boolean }\n\t/** Gene expression value for this cell, undefined when not applicable */\n\tgeneExp: number | undefined\n}\n\nexport type SingleCellPlotDataResult = {\n\t/** Resolved numeric color domain shared by the canvas and its legend. */\n\tcolorDomain?: [number, number]\n\tcolorLegend: ColorLegendEntry[]\n\tshapeLegend: ShapeLegendEntry[]\n\tsamples?: FormattedCell2Sample[]\n\t/** If over the cutoff, will return image instead of sample array */\n\tsrc?: string\n\t/** css dimensions of the canvas image, used to display at\n\t * the correct size when devicePixelRatio > 1 */\n\tcanvasWidth?: number\n\tcanvasHeight?: number\n\t/** When no sample array is returned, send the total sample count for\n\t * the legend. */\n\ttotalSampleCount?: number\n}\n\nexport type ValidSingleCellPlotsResponse = {\n\trange: SingleCellRange\n\tresult: { Default: SingleCellPlotDataResult }\n}\n\nconst TermdbSingleCellPlotsRequestExample = {\n\tgenome: 'hg38-test',\n\tdslabel: 'TermdbTest',\n\tsingleCellPlot: {\n\t\tname: 'umap',\n\t\tsample: { sID: scTestSample }\n\t},\n\tfilter: {\n\t\ttype: 'tvslst',\n\t\tin: true,\n\t\tjoin: '',\n\t\tlst: [\n\t\t\t{\n\t\t\t\ttag: 'cohortFilter',\n\t\t\t\ttype: 'tvs',\n\t\t\t\ttvs: {\n\t\t\t\t\tterm: { id: 'subcohort', type: 'multivalue' },\n\t\t\t\t\tvalues: [{ key: 'ABC', label: 'ABC' }]\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t},\n\tfilter0: undefined,\n\tcanvasSettings: {\n\t\tcutoff: 10000,\n\t\twidth: 800,\n\t\theight: 600,\n\t\tradius: 3,\n\t\tminXScale: null,\n\t\tmaxXScale: null,\n\t\tminYScale: null,\n\t\tmaxYScale: null,\n\t\topacity: 0.8,\n\t\tstartColor: '#0000ff',\n\t\tstopColor: '#ff0000',\n\t\tdevicePixelRatio: 2\n\t},\n\tcolorTW: {\n\t\tterm: {\n\t\t\tname: 'Cell Type',\n\t\t\tplot: 'UMAP',\n\t\t\ttype: 'singleCellCellType',\n\t\t\tsample: { sID: scTestSample },\n\t\t\tgroupsetting: { disabled: false },\n\t\t\tvalues: {}\n\t\t},\n\t\tq: { mode: 'discrete', type: 'values', hiddenValues: {} }\n\t}\n}\n\nconst TermdbSingleCellPlotsResponseExample = {\n\trange: {\n\t\txMin: -2.45230826499861,\n\t\txMax: 2.02116419939392,\n\t\tyMin: -2.670907125487,\n\t\tyMax: 2.97596441655721,\n\t\tgeMin: null,\n\t\tgeMax: null\n\t},\n\tresult: {\n\t\tDefault: {\n\t\t\tcolorLegend: [\n\t\t\t\t[\n\t\t\t\t\t'T_NK',\n\t\t\t\t\t{\n\t\t\t\t\t\tsampleCount: 20,\n\t\t\t\t\t\tcolor: '#1b9e77',\n\t\t\t\t\t\tkey: 'T_NK'\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'Blast',\n\t\t\t\t\t{\n\t\t\t\t\t\tsampleCount: 54,\n\t\t\t\t\t\tcolor: '#030303',\n\t\t\t\t\t\tkey: 'Blast'\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'Monocyte',\n\t\t\t\t\t{\n\t\t\t\t\t\tsampleCount: 26,\n\t\t\t\t\t\tcolor: '#7570b3',\n\t\t\t\t\t\tkey: 'Monocyte'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t],\n\t\t\tshapeLegend: [\n\t\t\t\t[\n\t\t\t\t\t'Ref',\n\t\t\t\t\t{\n\t\t\t\t\t\tsampleCount: 100,\n\t\t\t\t\t\tshape: 0,\n\t\t\t\t\t\tkey: 'Ref'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t],\n\t\t\tsamples: [\n\t\t\t\t{\n\t\t\t\t\tsampleId: 'cell1',\n\t\t\t\t\tx: 0.958429213345285,\n\t\t\t\t\ty: 1.94008987552318,\n\t\t\t\t\tz: 0,\n\t\t\t\t\tcategory: 'T_NK',\n\t\t\t\t\tshape: 'Ref',\n\t\t\t\t\thidden: {\n\t\t\t\t\t\tcategory: false\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsampleId: 'cell2',\n\t\t\t\t\tx: 0.678836078621254,\n\t\t\t\t\ty: -1.13854914348622,\n\t\t\t\t\tz: 0,\n\t\t\t\t\tcategory: 'T_NK',\n\t\t\t\t\tshape: 'Ref',\n\t\t\t\t\thidden: {\n\t\t\t\t\t\tcategory: false\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsampleId: 'cell3',\n\t\t\t\t\tx: -2.11135267144421,\n\t\t\t\t\ty: -2.33519450621652,\n\t\t\t\t\tz: 0,\n\t\t\t\t\tcategory: 'T_NK',\n\t\t\t\t\tshape: 'Ref',\n\t\t\t\t\thidden: {\n\t\t\t\t\t\tcategory: false\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsampleId: 'cell4',\n\t\t\t\t\tx: 0.551783876521269,\n\t\t\t\t\ty: -1.24685552943596,\n\t\t\t\t\tz: 0,\n\t\t\t\t\tcategory: 'T_NK',\n\t\t\t\t\tshape: 'Ref',\n\t\t\t\t\thidden: {\n\t\t\t\t\t\tcategory: false\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsampleId: 'cell5',\n\t\t\t\t\tx: 1.84959385901015,\n\t\t\t\t\ty: 2.68311790617899,\n\t\t\t\t\tz: 0,\n\t\t\t\t\tcategory: 'T_NK',\n\t\t\t\t\tshape: 'Ref',\n\t\t\t\t\thidden: {\n\t\t\t\t\t\tcategory: false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t}\n}\n\nexport const TermdbSingleCellPlotsExample = {\n\trequest: {\n\t\tbody: TermdbSingleCellPlotsRequestExample\n\t},\n\tresponse: {\n\t\tbody: TermdbSingleCellPlotsResponseExample\n\t}\n}\n", "export type TermChildrenRequest = {\n\t/** a user-defined genome label in the serverconfig.json, hg38, hg19, mm10, etc */\n\tgenome: string\n\t/** a user-defined dataset label in the serverconfig.json, such as ClinVar, SJLife, GDC, etc */\n\tdslabel: string\n\tembedder: string\n\tget_children: number\n\tcohortValues?: string\n\ttid: string\n}\n\ninterface Entries {\n\tname: string\n\tid: string\n\tisleaf: boolean\n\tincluded_types: string[]\n\tchild_types: string[]\n}\n\nexport type TermChildrenResponse = {\n\tlst: Entries[]\n}\n\nexport const termChildrenPayloadExamples = {\n\trequest: {\n\t\ttypeId: 'TermChildrenRequest'\n\t},\n\tresponse: {\n\t\ttypeId: 'TermChildrenResponse'\n\t},\n\texamples: [\n\t\t{\n\t\t\trequest: {\n\t\t\t\tbody: {\n\t\t\t\t\tgenome: 'hg38-test',\n\t\t\t\t\tdslabel: 'TermdbTest',\n\t\t\t\t\tembedder: 'localhost',\n\t\t\t\t\tget_children: 1,\n\t\t\t\t\tcohortValues: 'ABC',\n\t\t\t\t\ttid: 'GO:0000001'\n\t\t\t\t} satisfies TermChildrenRequest // TODO: enable type check\n\t\t\t},\n\t\t\tresponse: {\n\t\t\t\theader: { status: 200 }\n\t\t\t}\n\t\t}\n\t]\n}\n", "import type { TermWrapper } from '../terms/tw.ts'\nimport type { Filter } from '../filter.ts'\nimport type { ErrorResponse } from './errorResponse.ts'\nimport type { DescrStats } from './termdb.descrstats.ts'\n\n/** Common properties shared by both violin and box plots */\ntype CommonProps = {\n\t/** numeric tw to fetch numeric data. tw.q.mode must be continuous */\n\ttw: TermWrapper\n\tdslabel: string\n\tgenome: string\n\t/** overlay tw for multiple violins/boxplots */\n\toverlayTw?: TermWrapper\n\t/** tw to divide to multiple charts */\n\tdivideTw?: TermWrapper\n\t/** mass filter */\n\tfilter?: Filter\n\t/** read-only invisible filter */\n\tfilter0?: any\n\t/** TODO: Needs description FIXME delete */\n\tcurrentGeneNames?: string[]\n\t/** if true, use log scale; if false or undefined, use linear scale */\n\tisLogScale?: boolean\n}\n\n/** Request type for violin plots with required violin-specific parameters */\nexport type ViolinRequest = CommonProps & {\n\t/** Indicates the type of chart to render */\n\tplotType: 'violin'\n\t/** A number representing the dimension perpendicular to the violin spread */\n\taxisHeight?: number\n\t/** A string representing the type of symbol used on the plot */\n\tdatasymbol?: string\n\t/** A number representing the device's pixel ratio */\n\tdevicePixelRatio: number\n\t/** If true, uses KDE method to build plot */\n\tisKDE?: boolean\n\t/** A string with two possible values: 'horizontal' or 'vertical' */\n\torientation: string\n\t/** A number representing the radius of the data symbols */\n\tradius: number\n\t/** A number representing the right margin */\n\trightMargin?: number\n\t/** Term may be scaled from regression analysis */\n\tscale?: any\n\t/** A number representing the width of the stroke */\n\tstrokeWidth?: number\n\t/** A number representing the width of the SVG box */\n\tsvgw: number\n\t/** Number of bins to build the plot. Default is 20. */\n\tticks?: number\n}\n\n/** Request type for box plots with required box-specific parameters */\nexport type BoxRequest = CommonProps & {\n\t/** Indicates the type of chart to render */\n\tplotType: 'box'\n\t/** sort plots by median value */\n\torderByMedian?: boolean\n\t/** Remove outliers from the plot */\n\tremoveOutliers?: boolean\n\t/** If true, show association tests table */\n\tshowAssocTests?: boolean\n}\n\n/**Unified request type for violin and boxplot - union of ViolinRequest and BoxRequest */\nexport type ViolinBoxRequest = ViolinRequest | BoxRequest\n\nexport type ViolinBoxResponse = ViolinResponse | BoxPlotResponse | ErrorResponse\n\n/** Type guard to check if response is an ErrorResponse */\nexport function isErrorResponse(response: ViolinBoxResponse): response is ErrorResponse {\n\treturn 'error' in response && 'status' in response\n}\n\n/** Type guard to check if response is a BoxPlotResponse */\nexport function isBoxPlotResponse(response: ViolinBoxResponse): response is BoxPlotResponse {\n\treturn !isErrorResponse(response) && 'charts' in response && 'descrStats' in response\n}\n\n/** Type guard to check if response is a ViolinResponse */\nexport function isViolinResponse(response: ViolinBoxResponse): response is ViolinResponse {\n\treturn !isErrorResponse(response) && 'min' in response && 'max' in response\n}\n\n/** Violin response types */\ninterface BinsEntries {\n\tx0: number\n\tx1: number\n\tdensity: number\n}\n\ninterface PValueEntries {\n\tvalue?: string\n\thtml?: string\n}\n\ntype ViolinDensity = {\n\tbins: BinsEntries[]\n\tdensityMax: number\n\tdensityMin: number\n}\n\nexport type ViolinPlotEntry = {\n\tcolor: string\n\tchartId: string\n\tdensity: ViolinDensity\n\tlabel: string\n\tplotValueCount: number\n\tseriesId: string\n\tsrc: string\n\tsummaryStats: DescrStats\n}\n\nexport type ViolinResponseChart = {\n\tchartId: string\n\tplots: ViolinPlotEntry[]\n\tpvalues?: PValueEntries[][]\n}\n\nexport type ViolinResponse = {\n\tbins: { [index: string]: any }\n\tcharts: {\n\t\t[index: string]: ViolinResponseChart\n\t}\n\tmin: number\n\tmax: number\n\tuncomputableValues: { [index: string]: number }[] | null\n\tdescrStats: Record<string, DescrStats>\n}\n\n/** Boxplot response types */\nexport type BoxPlotData = {\n\tw1: number | undefined\n\tw2: number | undefined\n\tp05: number\n\tp25: number\n\tp50: number\n\tp75: number\n\tp95: number\n\tiqr: number\n\tout: { value: number }[]\n}\n\nexport type BoxPlotEntry = {\n\tboxplot: BoxPlotData & { label: string }\n\tcolor?: string\n\tdescrStats: DescrStats\n\tisHidden?: boolean\n\tkey: string\n\tseriesId?: string\n}\n\nexport type BoxPlotChartEntry = {\n\tchartId: string\n\tplots: BoxPlotEntry[]\n\tsampleCount: number\n\twilcoxon?: [{ value: string }, { value: string }, { html: string }][]\n}\n\nexport type BoxPlotResponse = {\n\tabsMin?: number\n\tabsMax?: number\n\tbins?: {\n\t\t[index: string]: any\n\t}\n\tcharts: {\n\t\t[chartId: string]: BoxPlotChartEntry\n\t}\n\tdescrStats: Record<string, DescrStats>\n\tuncomputableValues: { label: string; value: number }[] | null\n}\n\n// TODO: write more payload examples to help with automated testing and documentation, for non-prod use only\n\nexport const violinBoxPayload = {\n\trequest: {\n\t\ttypeId: 'ViolinBoxRequest'\n\t},\n\tresponse: {\n\t\ttypeId: 'ViolinBoxResponse'\n\t},\n\texamples: [\n\t\t{\n\t\t\trequest: {\n\t\t\t\tbody: {\n\t\t\t\t\tplotType: 'violin',\n\t\t\t\t\tgenome: 'hg38-test',\n\t\t\t\t\tdslabel: 'TermdbTest',\n\t\t\t\t\ttw: {\n\t\t\t\t\t\tterm: { id: 'aaclassic_5', type: 'float' },\n\t\t\t\t\t\tq: { mode: 'continuous' }\n\t\t\t\t\t},\n\t\t\t\t\tdevicePixelRatio: 2,\n\t\t\t\t\tsvgw: 200,\n\t\t\t\t\torientation: 'horizontal',\n\t\t\t\t\tdatasymbol: 'rug',\n\t\t\t\t\tradius: 5,\n\t\t\t\t\tisLogScale: false\n\t\t\t\t} // satisfies ViolinBoxRequest // TODO: enable type check\n\t\t\t},\n\t\t\tresponse: {\n\t\t\t\theader: { status: 200 }\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\trequest: {\n\t\t\t\tbody: {\n\t\t\t\t\tplotType: 'box',\n\t\t\t\t\tgenome: 'hg38-test',\n\t\t\t\t\tdslabel: 'TermdbTest',\n\t\t\t\t\ttw: {\n\t\t\t\t\t\tterm: { id: 'agedx', type: 'float' },\n\t\t\t\t\t\tq: { mode: 'continuous' }\n\t\t\t\t\t},\n\t\t\t\t\toverlayTw: {\n\t\t\t\t\t\tterm: { id: 'sex', type: 'categorical' }\n\t\t\t\t\t},\n\t\t\t\t\torderByMedian: true\n\t\t\t\t} // satisfies ViolinBoxRequest // TODO: enable type check\n\t\t\t},\n\t\t\tresponse: {\n\t\t\t\theader: { status: 200 }\n\t\t\t}\n\t\t}\n\t]\n}\n", "export const CATEGORICAL = 'categorical'\nexport const CONDITION = 'condition'\nexport const DATE = 'date'\nexport const DNA_METHYLATION = 'dnaMethylation'\n// dt term types, used for filtering variants of a geneVariant term;\n// the matching dt term entries are declared in `#shared/common.js` dtTerms[]\nexport const DTCNV = 'dtcnv'\nexport const DTFUSION = 'dtfusion'\nexport const DTITD = 'dtitd'\nexport const DTSNVINDEL = 'dtsnvindel'\nexport const DTSV = 'dtsv'\nexport const FLOAT = 'float'\nexport const GENE_VARIANT = 'geneVariant'\nexport const GENE_EXPRESSION = 'geneExpression'\nexport const ISOFORM_EXPRESSION = 'isoformExpression'\nexport const INTEGER = 'integer'\nexport const JUNCTION = 'junction'\nexport const METABOLITE_INTENSITY = 'metaboliteIntensity'\nexport const MULTIVALUE = 'multivalue'\nexport const PROTEOME_ABUNDANCE = 'proteomeAbundance'\nexport const PROTEOME_DAP = 'proteomeDAP'\nexport const PSEUDOBULK = 'pseudobulk'\nexport const SAMPLELST = 'samplelst'\nexport const SINGLECELL_CELLTYPE = 'singleCellCellType'\nexport const SINGLECELL_GENE_EXPRESSION = 'singleCellGeneExpression'\nexport const SINGLECELL_NUMERIC_VALUE = 'singleCellNumericValue'\nexport const SNP = 'snp'\nexport const SNP_LIST = 'snplst'\nexport const SNP_LOCUS = 'snplocus'\nexport const SSGSEA = 'ssGSEA'\nexport const SURVIVAL = 'survival'\nexport const TERM_COLLECTION = 'termCollection'\nexport const COHORT = 'cohort'\n\n//Term types should be used gradually using these constants instead of hardcoding the values,\n// eg: type == CATEGORICAL instead of type == 'categorical'\n// NOTE: keep this list complete at declaration, do not add entries to it at runtime,\n// so that consumers see the same keys regardless of module load order\nexport const TermTypes = {\n\tGENE_VARIANT,\n\tGENE_EXPRESSION,\n\tISOFORM_EXPRESSION,\n\tSSGSEA,\n\tDNA_METHYLATION,\n\tCATEGORICAL,\n\tINTEGER,\n\tJUNCTION,\n\tFLOAT,\n\tSNP,\n\tSNP_LIST,\n\tSNP_LOCUS,\n\tCONDITION,\n\tSURVIVAL,\n\tSAMPLELST,\n\tMETABOLITE_INTENSITY,\n\tPROTEOME_ABUNDANCE,\n\tPSEUDOBULK,\n\tSINGLECELL_CELLTYPE,\n\tSINGLECELL_GENE_EXPRESSION,\n\tSINGLECELL_NUMERIC_VALUE,\n\tMULTIVALUE,\n\tDATE,\n\tTERM_COLLECTION,\n\tCOHORT,\n\tDTCNV,\n\tDTFUSION,\n\tDTITD,\n\tDTSNVINDEL,\n\tDTSV\n}\n", "import type { NumericBaseTerm, NumTW, PresetNumericBins, RawNumTW } from '../index.ts'\n\nexport const PseudobulkAssay = ['geneExpression'] as const //Add more assays here\n\nexport type PseudobulkTerm = NumericBaseTerm & {\n\ttype: 'pseudobulk'\n\t/** Corresponds to the singleCell.pseudobulk[assay] */\n\tassay: (typeof PseudobulkAssay)[number]\n\t/** Corresponds to the singleCell.pseudobulk[assay][memberId] */\n\tmemberId: string\n\t/** Corresponds to one key in singleCell.pseudobulk[assay][memberId].categories{} */\n\tcategory: string\n\t/** gene symbol */\n\tgene: string\n\tbins?: PresetNumericBins\n}\n\nexport type PseudobulkTW = NumTW & { term: PseudobulkTerm }\n\nexport type RawPseudobulkTerm = PseudobulkTerm & { name?: string }\n\nexport type RawPseudobulkTW = RawNumTW & { term: RawPseudobulkTerm }\n"],
|
|
5
5
|
"mappings": ";AAyBO,IAAM,0BAA0B;AAAA,EACtC,UAAU;AAAA,IACT;AAAA,MACC,SAAS;AAAA,QACR,MAAM;AAAA,UACL,UAAU;AAAA,UACV,KAAK;AAAA,UACL,YAAY;AAAA,UACZ,OAAO;AAAA,UACP,MAAM;AAAA,UACN,MAAM;AAAA,UACN,YAAY;AAAA,QACb;AAAA;AAAA,MACD;AAAA,MACA,UAAU;AAAA,QACT,QAAQ,EAAE,QAAQ,IAAI;AAAA,MACvB;AAAA,IACD;AAAA,EACD;AACD;;;ACyBO,IAAM,uBAAuB;AAAA,EACnC,SAAS,EAAE,QAAQ,uBAAuB;AAAA,EAC1C,UAAU,EAAE,QAAQ,wBAAwB;AAC7C;;;ACOO,IAAM,kCAAkC;AAAA,EAC9C,SAAS;AAAA,IACR,QAAQ;AAAA,EACT;AAAA,EACA,UAAU;AAAA,IACT,QAAQ;AAAA,EACT;AAAA,EACA,UAAU;AAAA,IACT;AAAA,MACC,SAAS;AAAA,QACR,MAAM;AAAA,UACL,QAAQ;AAAA,UACR,SAAS;AAAA,UACT,UAAU;AAAA,UACV,IAAI,EAAE,IAAI,UAAU;AAAA,UACpB,QAAQ;AAAA,YACP,MAAM;AAAA,YACN,IAAI;AAAA,YACJ,MAAM;AAAA,YACN,KAAK;AAAA,cACJ;AAAA;AAAA,gBAEC,MAAM;AAAA,gBACN,KAAK;AAAA,kBACJ,MAAM;AAAA,oBACL,MAAM;AAAA,oBACN,MAAM;AAAA,oBACN,QAAQ,EAAE,KAAK,EAAE,OAAO,MAAM,GAAG,KAAK,EAAE,OAAO,MAAM,EAAE;AAAA,oBACvD,IAAI;AAAA,oBACJ,QAAQ;AAAA,oBACR,cAAc,EAAE,UAAU,KAAK;AAAA,kBAChC;A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