You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It points to a value of the sv_id column in a BEDPE file (doc).
If we just set a new value (setSelectedSvId('new-id')), Chromoscope will display the given SV with a thicker edge, as implemented in track/sv.ts:
...(selected ? {opacity: {value: 1},strokeWidth: {value: 2}} : {}),// 2px for selected SV, others are 1px
Highlighting a Selected Point Mutation
You will need to create a React State that stores the selected point mutation. Since our data for point mutations does not have any IDs (like sv_id for SVs), we will need to have that information in the data. In my prototype, I used an (absolute) position of a point mutation (i.e., a numeric position without chr names) to select a specific point mutation in the Gosling spec:
{"field": "POS","type": "filter","oneOf": [117997039// select a mutation with this exact position]}
To highlight the point mutation, small changes are needed in track/mutation.ts. These changes basically select a specific mutation and overlay a larger circle behind the original one.
We want to draw dashed vertical lines that represent the breakpoints of a selected SV across linear tracks (specifically, genes, indels, CNVs, Point Mutations, Gain, and LOH tracks). This can be done by adding rule tracks to those tracks.
Similar to how we add chromosome "boundaries" (i.e., vertical grey lines that represent the ends of chromosomes)
And call this function right after another function that draws a track that you want to draw dashed lines. E.g., to draw vertical lines on a CNV track,
Refer to this online diff that shows what I changed in the Gosling spec to test highlighting SV and point mutations:
https://www.diffchecker.com/QhkJWny9/
You can find a demo visualization of the updated Spec here.
Highlighting a Selected SV
There already is a React State that stores the selected SV ID (code):
It points to a value of the
sv_id
column in a BEDPE file (doc).If we just set a new value (
setSelectedSvId('new-id')
), Chromoscope will display the given SV with a thicker edge, as implemented in track/sv.ts:Highlighting a Selected Point Mutation
You will need to create a React State that stores the selected point mutation. Since our data for point mutations does not have any IDs (like
sv_id
for SVs), we will need to have that information in the data. In my prototype, I used an (absolute) position of a point mutation (i.e., a numeric position without chr names) to select a specific point mutation in the Gosling spec:To highlight the point mutation, small changes are needed in track/mutation.ts. These changes basically select a specific mutation and overlay a larger circle behind the original one.
Highlighting Break Points of a Selected SV
We want to draw dashed vertical lines that represent the breakpoints of a selected SV across linear tracks (specifically, genes, indels, CNVs, Point Mutations, Gain, and LOH tracks). This can be done by adding
rule
tracks to those tracks.Similar to how we add chromosome "boundaries" (i.e., vertical grey lines that represent the ends of chromosomes)
chromoscope/src/mid-spec.ts
Lines 132 to 143 in 01f6807
chromoscope/src/track/boundary.ts
Lines 6 to 44 in 01f6807
You can create a function that returns the spec to draw dashed vertical line for the breakpoints.
And call this function right after another function that draws a track that you want to draw dashed lines. E.g., to draw vertical lines on a CNV track,
We have a React State that stores the breakpoint positions
chromoscope/src/App.tsx
Line 131 in 01f6807
So, we can probably use this state as the parameter of the
tracks.breakpoints
function to know where to draw vertical lines.The text was updated successfully, but these errors were encountered: