There are 3 views in the following spec: 1) ideogram, 2) CN point plot, 3) gene annotation. The views are linked using the same linkingId. zoomToGene jumps to a specific gene, the first views go to the right region, but the last one keeps intact.
I built a search bar for jumping to any region. How can I use higlass auto-completion to get gene suggestion and then go to the corresponding location?
export const getOverviewSpec = (hoveredGene, hotGenes, enabled) => {
return {
"arrangement": "vertical",
"title": "Large Rearrangment Auditing",
"assembly": "hg19",
"spacing": 0,
"views": [
{
//"xDomain": { "chromosome": "1" },
"linkingId": "mychoics_plus",
"width": 1000,
"height": 20, // reduce the track height
"data": {
"url": "https://dataviz.brbiotech.com/shared/cytoBand.hg19.tsv",
"type": "csv",
"separator": "\t",
"chromosomeField": "chrom",
"genomicFields": ["chromStart", "chromEnd"]
},
"x": {
"field": "chromStart",
"type": "genomic",
"axis": "none"
},
"xe": { "field": "chromEnd", "type": "genomic" },
"alignment": "overlay",
"tracks": [
{
id: "ov-track-1",
"mark": "text",
"dataTransform": [{ "type": "filter", "field": "gieStain", "oneOf": ["acen"], "not": true }],
"text": { "field": "name", "type": "nominal" },
"color": {
"field": "gieStain",
"type": "nominal",
"domain": ["gneg", "gpos25", "gpos50", "gpos75", "gpos100", "gvar"],
"range": ["black", "black", "black", "black", "white", "black"]
},
"visibility": [
{
"operation": "less-than",
"measure": "width",
"threshold": "|xe-x|",
"transitionPadding": 10,
"target": "mark"
}
],
"style": { "textStrokeWidth": 0 }
},
{
id: "ov-track-2",
"mark": "rect",
"dataTransform": [{ "type": "filter", "field": "gieStain", "oneOf": ["acen"], "not": true }],
"color": {
"field": "gieStain",
"type": "nominal",
"domain": ["gneg", "gpos25", "gpos50", "gpos75", "gpos100", "gvar"],
"range": [
"white",
"#D9D9D9",
"#979797",
"#636363",
"black",
"#A0A0F2"
]
}
},
{
id: "ov-track-3",
"mark": "triangleRight",
"dataTransform": [
{ "type": "filter", "field": "gieStain", "oneOf": ["acen"] },
{ "type": "filter", "field": "name", "include": "q" }
],
"color": { "value": "#B40101" }
},
{
id: "ov-track-4",
"mark": "triangleLeft",
"dataTransform": [
{ "type": "filter", "field": "gieStain", "oneOf": ["acen"] },
{ "type": "filter", "field": "name", "include": "p" }
],
"color": { "value": "#B40101" }
}
],
"size": { "value": 20 },
"stroke": { "value": "gray" },
"strokeWidth": { "value": 0.5 }
},
{
alignment: "overlay",
"linkingId": "mychoics_plus",
genomePositionSearchBox: {
autocompleteServer: 'https://higlass.io/api/v1',
autocompleteId: 'P0PLbQMwTYGy-5uPIQid7A',
chromInfoServer: 'https://higlass.io/api/v1',
chromInfoId: 'hg19'
},
data: {
url: "https://dataviz.brbiotech.com/RS20210907013FFP.panelData.tsv",
type: "csv",
separator: "\t",
sampleLength: 10000,
chromosomeField: "chr",
genomicFields: ["uniProbeStart"],
quantitativeFields: ["CN"]
},
mark: "point",
x: { field: "uniProbeStart", type: "genomic" },
y: { field: "CN", type: "quantitative" },
size: { value: 4 },
tooltip: [
{ field: "chr", type: "nominal", alt: "Chromosome" },
{ field: "uniProbeStart", type: "genomic", alt: "Position" },
{ field: "gene", type: "nominal", alt: "Gene" },
],
opacity: { value: 0.5 },
tracks: [
{
id: "ov-track-5",
color: { value: "#C7D2FE" },
//overlayOnPreviousTrack: true,
},
{
"id": "ov-track-6",
dataTransform: [
{ type: 'filter', field: 'gene', oneOf: [hoveredGene] }
],
"color": { "value": "#6366F1" },
//overlayOnPreviousTrack: true,
},
{
id: "ov-track-6-2",
dataTransform: [
{ type: 'filter', field: 'gene', oneOf: hotGenes }
],
"color": {
"field": "gene",
"type": "nominal",
legend: true,
"domain": hotGenes,
},
//overlayOnPreviousTrack: true,
}
],
style: { inlineLegend: true },
width: 1000,
height: 400
},
{
"alignment": "overlay",
"title": "hg19 | Genes",
"linkingId": "mychoics_plus",
//"xDomain": { "chromosome": "1" },
"data": {
"url": "https://higlass.io/api/v1/tileset_info/?d=OHJakQICQD6gTD7skx4EWA",
"type": "beddb",
"genomicFields": [
{"index": 1, "name": "start"},
{"index": 2, "name": "end"}
],
"valueFields": [
{"index": 5, "name": "strand", "type": "nominal"},
{"index": 3, "name": "name", "type": "nominal"}
],
"exonIntervalFields": [
{"index": 12, "name": "start"},
{"index": 13, "name": "end"}
]
},
"tracks": [
{
id: "ov-track-8",
"dataTransform": [
{"type": "filter", "field": "type", "oneOf": ["gene"]}
],
"mark": "text",
"text": {"field": "name", "type": "nominal"},
"x": {"field": "start", "type": "genomic"},
"xe": {"field": "end", "type": "genomic"},
"style": {"dy": -15, "outline": "black", "outlineWidth": 0}
},
{
id: "ov-track-7",
"dataTransform": [
{"type": "filter", "field": "type", "oneOf": ["gene"]},
{"type": "filter", "field": "strand", "oneOf": ["+"]}
],
"mark": "triangleRight",
"x": {"field": "end", "type": "genomic", "axis": "none"},
"size": {"value": 15}
},
{
id: "ov-track-9",
"dataTransform": [
{"type": "filter", "field": "type", "oneOf": ["gene"]},
{"type": "filter", "field": "strand", "oneOf": ["-"]}
],
"mark": "triangleLeft",
"x": {"field": "start", "type": "genomic"},
"size": {"value": 15},
"style": {
"align": "right",
"outline": "black",
"outlineWidth": 0
}
},
{
id: "ov-track-10",
"dataTransform": [
{"type": "filter", "field": "type", "oneOf": ["exon"]}
],
"mark": "rect",
"x": {"field": "start", "type": "genomic"},
"size": {"value": 15},
"xe": {"field": "end", "type": "genomic"}
},
{
id: "ov-track-11",
"dataTransform": [
{"type": "filter", "field": "type", "oneOf": ["gene"]},
{"type": "filter", "field": "strand", "oneOf": ["+"]}
],
"mark": "rule",
"x": {"field": "start", "type": "genomic"},
"strokeWidth": {"value": 2},
"xe": {"field": "end", "type": "genomic"},
"style": {
"linePattern": {"type": "triangleRight", "size": 3.5},
"outline": "black",
"outlineWidth": 0
}
},
{
id: "ov-track-12",
"dataTransform": [
{"type": "filter", "field": "type", "oneOf": ["gene"]},
{"type": "filter", "field": "strand", "oneOf": ["-"]}
],
"mark": "rule",
"x": {"field": "start", "type": "genomic"},
"strokeWidth": {"value": 2},
"xe": {"field": "end", "type": "genomic"},
"style": {
"linePattern": {"type": "triangleLeft", "size": 3.5},
"outline": "black",
"outlineWidth": 0
}
}
],
"row": {
"field": "strand",
"type": "nominal",
"domain": ["+", "-"]
},
"color": {
"field": "strand",
"type": "nominal",
"domain": ["+", "-"],
},
"visibility": [
{
"operation": "less-than",
"measure": "width",
"threshold": "|xe-x|",
"transitionPadding": 10,
"target": "mark"
}
],
"width": 1000,
"height": 100
},
]
};
};
bug🐛 documentation