bafTrack = ({
name: "bafTrack",
layer: [
{
data: { url: "raw_S96.tsv" },
transform: [{ type: "filter", expr: "datum.baf !== null" }],
title: "Single probe",
mark: {
type: "point",
geometricZoomBound: 4
},
encoding: {
x: {
chrom: "chr",
pos: "pos",
type: "locus"
},
y: { field: "baf", type: "quantitative", title: null },
color: { value: "#7090c0" },
size: { value: 100 },
opacity: { value: 0.3 }
}
},
{
title: "Mean BAF",
mark: {
type: "rule",
minLength: 3.0
},
encoding: {
y: {
field: "bafMean",
type: "quantitative",
scale: { domain: [0, 1] },
title: "B-allele frequency"
},
size: { value: 3 },
color: { value: "black" }
}
},
{
title: "Mean BAF",
mark: {
type: "rule",
minLength: 3.0
},
encoding: {
y: {
expr: "1 - datum.bafMean",
type: "quantitative",
title: null
},
size: { value: 3 },
color: { value: "black" }
}
}
]
})