Skip to content

Commit

Permalink
feat: configurable set of available assays for nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlougheed committed Jan 17, 2024
1 parent 62e0b3e commit 7a244e4
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 8 deletions.
17 changes: 17 additions & 0 deletions config.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,28 @@
* This file configures the dataset that this EpiVar node is responsible for hosting.
*/

const ASSAY_RNA_SEQ = "RNA-seq";
const ASSAY_ATAC_SEQ = "ATAC-seq";
const ASSAY_H3K4ME1 = "H3K4me1";
const ASSAY_H3K4ME3 = "H3K4me3";
const ASSAY_H3K27AC = "H3K27ac";
const ASSAY_H3K27ME3 = "H3K27me3";

// noinspection JSUnusedGlobalSymbols
module.exports = {
title: "Aracena 𝘦𝘵 𝘢𝘭.",
assembly: "hg19",

// availableAssays must be a subset or the set of assays supported by EpiVar:
availableAssays: [
ASSAY_RNA_SEQ,
ASSAY_ATAC_SEQ,
ASSAY_H3K4ME1,
ASSAY_H3K4ME3,
ASSAY_H3K27AC,
ASSAY_H3K27ME3,
],

conditions: [
{id: "NI", name: "Non-infected"},
{id: "Flu", name: "Flu"},
Expand Down
15 changes: 8 additions & 7 deletions docs/setting_up_a_node.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

The following assay types can be ingested into an EpiVar node:

- RNA-seq
- ATAC-seq
- H3K4me1
- H3K4me3
- H3K27ac
- H3K27me3
- `RNA-seq`
- `ATAC-seq`
- `H3K4me1`
- `H3K4me3`
- `H3K27ac`
- `H3K27me3`

### Dataset metadata

Expand Down Expand Up @@ -53,7 +53,8 @@ The following assay types can be ingested into an EpiVar node:
- `assay`

- [ ] A dataset configuration file, which takes the form described in the
[example configuration file](/config.example.js).
[example configuration file](/config.example.js). Here, assays available in this node can be specified, as well as
experimental conditions, population groups, and functions for interacting with the genotype VCF file.

This file specifies information about the dataset being hosted by the EpiVar node, including dataset title,
sample groups and experimental treatments (in both of these, each entry has an ID and a name), assembly ID (`hg19` or
Expand Down
17 changes: 17 additions & 0 deletions epivar-prod/node1/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,28 @@
* This file configures the dataset that this EpiVar node is responsible for hosting.
*/

const ASSAY_RNA_SEQ = "RNA-seq";
const ASSAY_ATAC_SEQ = "ATAC-seq";
const ASSAY_H3K4ME1 = "H3K4me1";
const ASSAY_H3K4ME3 = "H3K4me3";
const ASSAY_H3K27AC = "H3K27ac";
const ASSAY_H3K27ME3 = "H3K27me3";

// noinspection JSUnusedGlobalSymbols
module.exports = {
title: "Aracena 𝘦𝘵 𝘢𝘭.",
assembly: "hg19",

// availableAssays must be a subset or the set of assays supported by EpiVar:
availableAssays: [
ASSAY_RNA_SEQ,
ASSAY_ATAC_SEQ,
ASSAY_H3K4ME1,
ASSAY_H3K4ME3,
ASSAY_H3K27AC,
ASSAY_H3K27ME3,
],

conditions: [
{id: "NI", name: "Non-infected"},
{id: "Flu", name: "Flu"},
Expand Down
5 changes: 5 additions & 0 deletions epivar-prod/node2/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@
* This file configures the dataset that this EpiVar node is responsible for hosting.
*/

const ASSAY_RNA_SEQ = "RNA-seq";

// noinspection JSUnusedGlobalSymbols
module.exports = {
title: "Aracena 𝘦𝘵 𝘢𝘭. RNA-seq liftover",
assembly: "hg38",

// availableAssays must be a subset or the set of assays supported by EpiVar:
availableAssays: [ASSAY_RNA_SEQ],

conditions: [
{id: "NI", name: "Non-infected"},
{id: "Flu", name: "Flu"},
Expand Down
15 changes: 15 additions & 0 deletions helpers/assays.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export const ASSAY_RNA_SEQ = "RNA-seq";
export const ASSAY_ATAC_SEQ = "ATAC-seq";
export const ASSAY_H3K4ME1 = "H3K4me1";
export const ASSAY_H3K4ME3 = "H3K4me3";
export const ASSAY_H3K27AC = "H3K27ac";
export const ASSAY_H3K27ME3 = "H3K27me3";

export const ALL_ASSAYS = [
ASSAY_RNA_SEQ,
ASSAY_ATAC_SEQ,
ASSAY_H3K4ME1,
ASSAY_H3K4ME3,
ASSAY_H3K27AC,
ASSAY_H3K27ME3,
];
6 changes: 5 additions & 1 deletion models/assays.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import config from "../config.js";
import {ALL_ASSAYS} from "../helpers/assays.mjs";
import db from "./db.mjs";

const AVAILABLE_ASSAYS_SET = new Set(config.availableAssays ?? ALL_ASSAYS);

export const list = () => {
return db.findAll("SELECT id, name FROM assays ORDER BY id")
.then(rows => rows.map(r => r.name))
.then(rows => rows.map((r) => r.name).filter((a) => AVAILABLE_ASSAYS_SET.includes(a)));
};

export default {
Expand Down

0 comments on commit 7a244e4

Please sign in to comment.