@weng-lab/genomebrowser-ui 0.2.7 → 0.2.9

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.
@@ -0,0 +1,17 @@
1
+ # Notes
2
+
3
+ ## Missing data
4
+
5
+ mouse chrom hmm file missing
6
+
7
+ ```json
8
+ {
9
+ "id": "chromhmm-ENCFF491PKK",
10
+ "assay": "chromhmm",
11
+ "url": "https://downloads.wenglab.org/Registry-V4/ENCFF491PKK.bigBed",
12
+ "experimentAccession": "",
13
+ "fileAccession": "ENCFF491PKK"
14
+ },
15
+ ```
16
+
17
+ also intestine 15.5 days sometimes 416's
@@ -5,11 +5,12 @@ import {
5
5
  useGridApiContext,
6
6
  } from "@mui/x-data-grid-premium";
7
7
  import { Stack, capitalize } from "@mui/material";
8
- import Check from "@mui/icons-material/Check";
9
8
  import { AssayIcon, ontologyTypes, assayTypes, lifeStages } from "./constants";
10
- import { BiosampleRowInfo } from "./types";
9
+ import { BiosampleRowInfo, CollectionType } from "./types";
11
10
 
12
- function CoreCollectionCell(params: GridRenderCellParams<BiosampleRowInfo>) {
11
+ const collectionTypes: CollectionType[] = ["Core", "Ancillary", "Partial"];
12
+
13
+ function CollectionCell(params: GridRenderCellParams<BiosampleRowInfo>) {
13
14
  const apiRef = useGridApiContext();
14
15
 
15
16
  if (params.rowNode.type !== "group") {
@@ -30,11 +31,7 @@ function CoreCollectionCell(params: GridRenderCellParams<BiosampleRowInfo>) {
30
31
  childIds[0],
31
32
  ) as BiosampleRowInfo | null;
32
33
 
33
- if (firstChildRow?.coreCollection) {
34
- return <Check color="primary" />;
35
- }
36
-
37
- return null;
34
+ return firstChildRow?.collection ?? null;
38
35
  }
39
36
 
40
37
  const displayNameCol: GridColDef<BiosampleRowInfo> = {
@@ -140,12 +137,13 @@ const lifeStageCol: GridColDef<BiosampleRowInfo> = {
140
137
  valueFormatter: (value) => value && capitalize(value),
141
138
  };
142
139
 
143
- const coreCollectionCol: GridColDef<BiosampleRowInfo> = {
144
- field: "coreCollection",
145
- headerName: "Core Collection",
146
- type: "boolean",
147
- width: 120,
148
- renderCell: (params) => <CoreCollectionCell {...params} />,
140
+ const collectionCol: GridColDef<BiosampleRowInfo> = {
141
+ field: "collection",
142
+ headerName: "Collection",
143
+ type: "singleSelect",
144
+ valueOptions: collectionTypes,
145
+ width: 100,
146
+ renderCell: (params) => <CollectionCell {...params} />,
149
147
  };
150
148
 
151
149
  const experimentCol: GridColDef<BiosampleRowInfo> = {
@@ -167,7 +165,7 @@ const idCol: GridColDef<BiosampleRowInfo> = {
167
165
  export const sortedByAssayColumns: GridColDef<BiosampleRowInfo>[] = [
168
166
  displayNameCol,
169
167
  sortedByAssayOntologyCol,
170
- coreCollectionCol,
168
+ collectionCol,
171
169
  sampleTypeCol,
172
170
  lifeStageCol,
173
171
  sortedByAssayAssayCol,
@@ -179,7 +177,7 @@ export const sortedByAssayColumns: GridColDef<BiosampleRowInfo>[] = [
179
177
  /** Default columns (ontology as top-level grouping) */
180
178
  export const defaultColumns: GridColDef<BiosampleRowInfo>[] = [
181
179
  defaultAssayCol,
182
- coreCollectionCol,
180
+ collectionCol,
183
181
  sampleTypeCol,
184
182
  lifeStageCol,
185
183
  defaultOntologyCol,
@@ -24,7 +24,7 @@ import { BiosampleTreeItem } from "./BiosampleTreeItem";
24
24
  * @returns Array of flattened BiosampleRowInfo objects, one per assay
25
25
  */
26
26
  function flattenTrackIntoRows(track: BiosampleTrackInfo): BiosampleRowInfo[] {
27
- const { ontology, lifeStage, sampleType, displayName, core } = track;
27
+ const { ontology, lifeStage, sampleType, displayName, collection } = track;
28
28
 
29
29
  // Sort assays so cCRE comes first, then maintain original order for the rest
30
30
  const sortedAssays = [...track.assays].sort((a, b) => {
@@ -46,7 +46,7 @@ function flattenTrackIntoRows(track: BiosampleTrackInfo): BiosampleRowInfo[] {
46
46
  experimentAccession,
47
47
  fileAccession,
48
48
  url,
49
- coreCollection: core ?? false,
49
+ collection,
50
50
  }),
51
51
  );
52
52
  }
@@ -2,6 +2,8 @@
2
2
  * Types for biosample folder data
3
3
  */
4
4
 
5
+ export type CollectionType = "Core" | "Ancillary" | "Partial";
6
+
5
7
  /**
6
8
  * Assay information from the JSON data
7
9
  */
@@ -23,7 +25,7 @@ export type BiosampleTrackInfo = {
23
25
  sampleType: string;
24
26
  displayName: string;
25
27
  assays: BiosampleAssayInfo[];
26
- core?: boolean;
28
+ collection: CollectionType;
27
29
  };
28
30
 
29
31
  /**
@@ -39,7 +41,7 @@ export type BiosampleRowInfo = {
39
41
  experimentAccession: string;
40
42
  fileAccession: string;
41
43
  url: string;
42
- coreCollection: boolean;
44
+ collection: CollectionType;
43
45
  };
44
46
 
45
47
  /**
package/test/main.tsx CHANGED
@@ -79,7 +79,7 @@ function injectCallbacks(track: Track, callbacks: TrackCallbacks): Track {
79
79
 
80
80
  function Main() {
81
81
  const [open, setOpen] = useState(false);
82
- const currentAssembly: Assembly = "GRCh38";
82
+ const currentAssembly: Assembly = "mm10";
83
83
 
84
84
  const browserStore = createBrowserStoreMemo({
85
85
  // chr7:19,695,494-19,699,803
package/vite.config.ts CHANGED
@@ -30,6 +30,9 @@ export default defineConfig({
30
30
  },
31
31
  },
32
32
  },
33
+ server: {
34
+ allowedHosts: true,
35
+ },
33
36
  build: {
34
37
  lib: {
35
38
  entry: path.resolve(__dirname, "src/lib.ts"),