Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poc/methylation #301

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@molgenis/vip-report-template",
"version": "5.8.0",
"version": "5.8.0 - methylation",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"version": "5.8.0 - methylation",
"version": "5.8.0-methylation",

"description": "Report Template for Variant Call Format (VCF) Report Generator",
"scripts": {
"build": "vite build",
Expand Down Expand Up @@ -36,11 +36,11 @@
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.5.1",
"@fortawesome/free-solid-svg-icons": "^6.5.1",
"@molgenis/vip-report-api": "^4.8.0",
"@molgenis/vip-report-api": "link:..\\vip-report-api",
"@molgenis/vip-report-vcf": "^1.8.0",
"@solidjs/router": "^0.9.1",
"base64-js": "^1.5.1",
"igv": "^2.15.11",
"igv": "link:..\\igv.js",
"solid-js": "^1.8.7"
},
"lint-staged": {
Expand Down
26 changes: 8 additions & 18 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { WindowApiClient } from "@molgenis/vip-report-api/src/WindowApiClient";
import { WindowApiClient } from "../../vip-report-api/src/WindowApiClient";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this required when using a linked library?


// lazy import MockApiClient to ensure that it is excluded from the build artifact
const api = import.meta.env.PROD
Expand Down
23 changes: 19 additions & 4 deletions src/components/GenomeBrowser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import igv, { Browser } from "igv";
import api from "../Api";
import { fromByteArray } from "base64-js";
import { writeVcf } from "@molgenis/vip-report-vcf/src/VcfWriter";
import { ComposedQuery, Sample } from "@molgenis/vip-report-api/src/Api";
import { ComposedQuery, Sample } from "../../../vip-report-api/src/Api";

async function createVcf(contig: string, position: number, samples: Sample[]): Promise<Uint8Array> {
const query: ComposedQuery = {
Expand Down Expand Up @@ -78,11 +78,26 @@ const createBrowserConfig = async (contig: string, position: number, samples: Sa
};

const updateBrowser = async (browser: Browser, samples: Sample[]): Promise<void> => {
const data = await Promise.all([...samples.map((sample) => api.getCram(sample.person.individualId))]);
const crams = data.slice(0);
const cramData = await Promise.all([...samples.map((sample) => api.getCram(sample.person.individualId))]);
const crams = cramData.slice(0);

const bedmethylData = await Promise.all([...samples.map((sample) => api.getBedmethyl(sample.person.individualId))]);
const bedmethyls = bedmethylData.slice(0);

for (let i = 0; i < samples.length; ++i) {
const cram = crams[i];
const bedmethyl = bedmethyls[i];

if (bedmethyl !== null) {
const sampleId = samples[i].person.individualId;
await browser.loadTrack({
type: "annotation",
format: "bedMethyl",
name: `Bedmethyl (${sampleId})`,
url: "data:application/octet-stream;base64," + fromByteArray(bedmethyl),
checkSequenceMD5: false,
});
}

if (cram !== null) {
const sampleId = samples[i].person.individualId;
Expand All @@ -93,7 +108,7 @@ const updateBrowser = async (browser: Browser, samples: Sample[]): Promise<void>
url: "data:application/octet-stream;base64," + fromByteArray(cram.cram),
indexURL: "data:application/octet-stream;base64," + fromByteArray(cram.crai),
checkSequenceMD5: false, // disable verifying the MD5 checksum of the reference sequence underlying a slice
colorBy: "strand",
colorBy: "basemod2",
});
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/record/info/GnomAD.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export const GnomAD: Component<FieldProps> = (props) => {
<Anchor href={href}>
<FieldValueFloat value={af()} />
</Anchor>
<Show when={qc().length > 0}>
<abbr title={"Failed quality control filters: " + qc().join(", ")} class="ml-1 is-clickable">
<Show when={qc() != null && qc().length > 0}>
<abbr title="Failed quality control filters: <workaround:disabled>" class="ml-1 is-clickable">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note to self: due to a bug in vip-report-template that has been fixed on the main branch

<i class="fas fa-circle-exclamation has-text-warning" />
</abbr>
</Show>
Expand Down
Loading