Skip to content

Commit bfcf94c

Browse files
authored
Merge pull request #148 from elmedjadjirayane/main
change type for chromosome input in locuszoom and upgrade to version…
2 parents 4a591f1 + c769a6a commit bfcf94c

10 files changed

Lines changed: 147 additions & 56 deletions

File tree

packages/locuszoom/.gitignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,12 @@ node_modules
1515
npm-debug.log*
1616
pnpm-debug.log*
1717
yarn-debug.log*
18-
yarn-error.log*
18+
yarn-error.log*
19+
20+
# Playwright
21+
/test-results/
22+
/playwright-report/
23+
/blob-report/
24+
/playwright/.cache/
25+
/playwright/.auth/
26+
/.github/
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// @ts-check
2+
import { test, expect } from '@playwright/test';
3+
4+
test('Run plot', async ({ page }) => {
5+
6+
// Test variables
7+
8+
const URL = 'http://localhost:5173/';
9+
const CHR_INPUT = 'raya560ne.2.1.2'; // a chromosome
10+
const POINT = '#lz-plot_association_associationpvalues_-RAYA560NE21261284_TC' // a point in the plot
11+
const POINT_LOCATOR = page.locator(POINT);
12+
const PHENO_STAT = '×phenRAYA560NE.2.1.2:61284_T/'; // stats' table for the point
13+
const PHENO_STAT_TO_CLICK = page.getByText(PHENO_STAT)
14+
15+
// Test execution
16+
17+
await page.goto(URL);
18+
await page.getByRole('button').click();
19+
await page.getByRole('textbox', { name: 'Please Input' }).nth(1).fill(CHR_INPUT);
20+
await expect(POINT_LOCATOR).toBeVisible();
21+
await POINT_LOCATOR.click();
22+
await PHENO_STAT_TO_CLICK.click();
23+
await expect(PHENO_STAT_TO_CLICK).toBeVisible();
24+
await page.getByRole('button', { name: '×' }).click();
25+
await expect(PHENO_STAT_TO_CLICK).toBeHidden();
26+
});
27+

packages/locuszoom/package.json

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,38 @@
11
{
2-
"name": "@galaxyproject/locuszoom",
3-
"version": "0.0.7",
4-
"type": "module",
5-
"license": "MIT",
6-
"files": [
7-
"static"
8-
],
9-
"scripts": {
10-
"dev": "vite",
11-
"build": "vite build",
12-
"preview": "vite preview",
13-
"prettier": "prettier --config ./prettier.config.js --write 'package.json' '**/*.{js,jsx,ts,tsx,json,css,md,vue}'",
14-
"test": "vitest --run",
15-
"test:watch": "vitest --watch",
16-
"test:ui": "vitest --ui"
17-
},
18-
"devDependencies": {
19-
"@types/node": "^22.9.0",
20-
"@vitejs/plugin-vue": "^5.0.5",
21-
"@vitest/ui": "^3.0.9",
22-
"autoprefixer": "^10.4.19",
23-
"galaxy-charts": "^0.0.73",
24-
"galaxy-charts-xml-parser": "^1.0.3",
25-
"jsdom": "^25.0.1",
26-
"locuszoom": "^0.14.0",
27-
"postcss": "^8.4.40",
28-
"prettier": "^3.3.3",
29-
"tailwindcss": "^3.4.7",
30-
"typescript": "^5.5.4",
31-
"vite": "^6.2.2",
32-
"vitest": "^3.0.9",
33-
"vue": "^3.4.31"
34-
}
2+
"name": "@galaxyproject/locuszoom",
3+
"version": "0.0.8",
4+
"type": "module",
5+
"license": "MIT",
6+
"files": [
7+
"static"
8+
],
9+
"scripts": {
10+
"dev": "vite",
11+
"build": "vite build",
12+
"preview": "vite preview",
13+
"prettier": "prettier --config ./prettier.config.js --write 'package.json' '**/*.{js,jsx,ts,tsx,json,css,md,vue}'",
14+
"test": "npm run test:unit && npm run test:e2e",
15+
"test:e2e": "npx playwright test",
16+
"test:unit": "vitest run",
17+
"test:watch": "vitest --watch",
18+
"test:ui": "vitest --ui"
19+
},
20+
"devDependencies": {
21+
"@playwright/test": "^1.58.0",
22+
"@types/node": "^22.9.0",
23+
"@vitejs/plugin-vue": "^5.0.5",
24+
"@vitest/ui": "^3.0.9",
25+
"autoprefixer": "^10.4.19",
26+
"galaxy-charts": "^0.0.73",
27+
"galaxy-charts-xml-parser": "^1.0.3",
28+
"jsdom": "^25.0.1",
29+
"locuszoom": "^0.14.0",
30+
"postcss": "^8.4.40",
31+
"prettier": "^3.3.3",
32+
"tailwindcss": "^3.4.7",
33+
"typescript": "^5.5.4",
34+
"vite": "^6.2.2",
35+
"vitest": "^3.0.9",
36+
"vue": "^3.4.31"
37+
}
3538
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from "@playwright/test";
2+
3+
export default defineConfig({
4+
testIgnore: ["src/**"],
5+
timeout: 120000, // 120 seconds per test
6+
use: {
7+
headless: !!process.env.CI,
8+
},
9+
snapshotPathTemplate: "{testDir}/test-data/{arg}.png",
10+
});

packages/locuszoom/public/locuszoom.xml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
<input>
2222
<label>Select a chromosome</label>
2323
<name>chromosome</name>
24-
<type>integer</type>
25-
<min>1</min>
26-
<value>1</value>
24+
<type>string</type>
2725
</input>
2826
<input>
2927
<label>Select start position</label>
@@ -97,7 +95,7 @@
9795
<param name="dataset_id" value="http://cdn.jsdelivr.net/gh/galaxyproject/galaxy-test-data/1.gwas_tabix.gz" ftype="gwas_tabix.gz" />
9896
</test>
9997
</tests>
100-
<help format="markdown"><![CDATA[
98+
<help format="markdown"><![CDATA[
10199
# What is LocusZoom?
102100
103101
LocusZoom is a specialized tool designed to create interactive Manhattan plots for visualizing results from genome-wide association studies (GWAS).
@@ -117,5 +115,5 @@ For more information:
117115
118116
Boughton, A. P. et al. LocusZoom.js: interactive and embeddable visualization of genetic association study results. Bioinformatics (2021) doi:10.1093/bioinformatics/btab186.
119117
120-
]]></help>
118+
]]> </help>
121119
</visualization>

packages/locuszoom/src/Plugin.vue

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ LocusZoom.use(LzTabixSource);
1010
1111
const TabixUrlSource = LocusZoom.Adapters.get("TabixUrlSource");
1212
13+
// Test files paths
14+
15+
const BGZIP_PRIMARY_DATASET_PATH = "http://localhost:5173/test-data/weird.gwas_bgzip";
16+
const TABIX_SECONDARY_DATASET_PATH = "http://localhost:5173/test-data/weird.gwas_bgzip.tbi";
17+
1318
// Patch URLFetchable prototype by accessing it through a reader instance
1419
let hasURLFetchablePrototypeBeenPatched = false;
1520
@@ -160,7 +165,31 @@ const props = defineProps({
160165
161166
const errorMessage = ref("");
162167
168+
// Functions to retrieve URLs
169+
170+
function getPrimaryURL(root,primaryID) {
171+
if (primaryID==="__test__"){
172+
return BGZIP_PRIMARY_DATASET_PATH;
173+
}
174+
else {
175+
return `${root}api/datasets/${primaryID}/display`;
176+
}
177+
178+
}
179+
180+
function getSecondaryURL(root,primaryID, secondaryID) {
181+
if (primaryID==="__test__"){
182+
return TABIX_SECONDARY_DATASET_PATH;
183+
}
184+
else {
185+
return `${root}api/datasets/${secondaryID}/display`;
186+
}
187+
188+
}
189+
163190
function render() {
191+
const bgzipURL = getPrimaryURL(props.root,props.datasetId);
192+
const tabixURL = getSecondaryURL(props.root,props.datasetId, props.settings.tabix?.id);
164193
const id = props.settings.tabix?.id;
165194
const chrIn = props.settings.chromosome;
166195
const startIn = props.settings.start;
@@ -173,7 +202,7 @@ function render() {
173202
const is_neg_log_pvalue = props.settings.is_neg_log_pvalue;
174203
const beta_col = props.settings.beta_col;
175204
const stderr_beta_col = props.settings.stderr_beta_col;
176-
if (!id) {
205+
if (tabixURL.includes("/api/datasets/undefined/display")) {
177206
errorMessage.value = "Please select a Tabix file.";
178207
return;
179208
}
@@ -199,8 +228,8 @@ function render() {
199228
let data_sources = new LocusZoom.DataSources().add("assoc", [
200229
"TabixUrlSource",
201230
{
202-
url_data: `${props.root}api/datasets/${props.datasetId}/display`,
203-
url_tbi: `${props.root}api/datasets/${id}/display`,
231+
url_data: bgzipURL,
232+
url_tbi: tabixURL,
204233
parser_func: gwasParser,
205234
overfetch: 0,
206235
},

packages/locuszoom/src/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ async function main() {
1111
// Construct the incoming data object with mock configuration and data
1212
const dataIncoming = {
1313
visualization_config: {
14-
dataset_id: "b620c45fba703209", // id of primary_dataset.bgzip
14+
dataset_id: process.env.dataset_id || "__test__", // id of primary_dataset.bgzip
1515
// Placeholder for additional visualization settings
1616
settings: {
17-
tabix: { id: "abd164196b68b912" }, // id of secondary_dataset.tbi
17+
tabix: {}, // id of secondary_dataset.tbi
1818
},
1919
},
2020
// Parse and load the visualization XML configuration
8.15 KB
Binary file not shown.
156 Bytes
Binary file not shown.

packages/locuszoom/yarn.lock

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@
4242
"@babel/helper-validator-identifier" "^7.24.7"
4343
to-fast-properties "^2.0.0"
4444

45-
"@esbuild/darwin-arm64@0.25.1":
45+
"@esbuild/linux-x64@0.25.1":
4646
version "0.25.1"
47-
resolved "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.1.tgz"
48-
integrity sha512-5hEZKPf+nQjYoSr/elb62U19/l1mZDdqidGfmFutVUjjUZrOazAtwK+Kr+3y0C/oeJfLlxo9fXb1w7L+P7E4FQ==
47+
resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.1.tgz"
48+
integrity sha512-xbfUhu/gnvSEg+EGovRc+kjBAkrvtk38RlerAzQxvMzlB4fXpCFCeUAYzJvrnhFtdeyVCDANSjJvOvGYoeKzFA==
4949

5050
"@hapi/hoek@^9.0.0":
5151
version "9.3.0"
@@ -129,15 +129,22 @@
129129
resolved "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz"
130130
integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==
131131

132+
"@playwright/test@^1.58.0":
133+
version "1.58.0"
134+
resolved "https://registry.npmjs.org/@playwright/test/-/test-1.58.0.tgz"
135+
integrity sha512-fWza+Lpbj6SkQKCrU6si4iu+fD2dD3gxNHFhUPxsfXBPhnv3rRSQVd0NtBUT9Z/RhF/boCBcuUaMUSTRTopjZg==
136+
dependencies:
137+
playwright "1.58.0"
138+
132139
"@polka/url@^1.0.0-next.24":
133140
version "1.0.0-next.28"
134141
resolved "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.28.tgz"
135142
integrity sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==
136143

137-
"@rollup/rollup-darwin-arm64@4.35.0":
144+
"@rollup/rollup-linux-x64-gnu@4.35.0":
138145
version "4.35.0"
139-
resolved "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.35.0.tgz"
140-
integrity sha512-Uk+GjOJR6CY844/q6r5DR/6lkPFOw0hjfOIzVx22THJXMxktXG6CbejseJFznU8vHcEBLpiXKY3/6xc+cBm65Q==
146+
resolved "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.35.0.tgz"
147+
integrity sha512-Pim1T8rXOri+0HmV4CdKSGrqcBWX0d1HoPnQ0uw0bdp1aP5SdQVNBy8LjYncvnLgu3fnnCt17xjWGd4cqh8/hA==
141148

142149
"@types/estree@^1.0.0", "@types/estree@1.0.6":
143150
version "1.0.6"
@@ -1320,11 +1327,6 @@ fs.realpath@^1.0.0:
13201327
resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
13211328
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==
13221329

1323-
fsevents@~2.3.2, fsevents@~2.3.3:
1324-
version "2.3.3"
1325-
resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz"
1326-
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==
1327-
13281330
function-bind@^1.1.2:
13291331
version "1.1.2"
13301332
resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz"
@@ -1660,7 +1662,7 @@ json-stable-stringify-without-jsonify@^1.0.1:
16601662
"jszlib@git+https://github.com/dasmoth/jszlib.git#4e562c7":
16611663
version "0.2.1"
16621664
resolved "git+ssh://git@github.com/dasmoth/jszlib.git"
1663-
integrity sha512-L+slw277qqgqWvyz6srOUOqHnbuyLBGPkgzM7IgxCTb/MVTNiy11iQ15mS+dO2f8UIjKBb4z8AgO3vshLrjXVg==
1665+
integrity sha512-uvBAyIcKCRxAWN6fpZMzC5GOrFzWsTehZW6DkRn9RKfJ4QcSsHZFqnlFmHQOxSIkO4tWQ0FxGLNKJQ1pKy3PeA==
16641666

16651667
just-clone@^3.2.1:
16661668
version "3.2.1"
@@ -1976,6 +1978,20 @@ pirates@^4.0.1:
19761978
resolved "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz"
19771979
integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==
19781980

1981+
playwright-core@1.58.0:
1982+
version "1.58.0"
1983+
resolved "https://registry.npmjs.org/playwright-core/-/playwright-core-1.58.0.tgz"
1984+
integrity sha512-aaoB1RWrdNi3//rOeKuMiS65UCcgOVljU46At6eFcOFPFHWtd2weHRRow6z/n+Lec0Lvu0k9ZPKJSjPugikirw==
1985+
1986+
playwright@1.58.0:
1987+
version "1.58.0"
1988+
resolved "https://registry.npmjs.org/playwright/-/playwright-1.58.0.tgz"
1989+
integrity sha512-2SVA0sbPktiIY/MCOPX8e86ehA/e+tDNq+e5Y8qjKYti2Z/JG7xnronT/TXTIkKbYGWlCbuucZ6dziEgkoEjQQ==
1990+
dependencies:
1991+
playwright-core "1.58.0"
1992+
optionalDependencies:
1993+
fsevents "2.3.2"
1994+
19791995
postcss-import@^15.1.0:
19801996
version "15.1.0"
19811997
resolved "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz"

0 commit comments

Comments
 (0)