PlinkLDTabixAdapter
Auto-generated config schema for the current JBrowse release — see the
config guide for concepts. Provided by the variants
plugin.
View source.
Example usage
{
type: 'LDTrack',
trackId: 'my_track',
name: 'My track',
assemblyNames: ['hg38'],
adapter: {
type: 'PlinkLDTabixAdapter',
uri: 'https://example.com/study.sorted.ld.gz',
},
}
study.sorted.ld.gz infers PlinkLDTabixAdapter and LDTrack on its own, and
name defaults to the file name. In a config declaring one assembly,
assemblyNames comes from there too — see
the shortest track.
{
trackId: 'my_track',
uri: 'https://example.com/study.sorted.ld.gz',
assemblyNames: ['hg38'],
}
See the Config slots section below for all available configuration fields.
Adapter for reading pre-computed LD data from a PLINK LD table (tabix-indexed), either PLINK 2.0's .vcor or PLINK 1.9's .ld.
The input file should be bgzipped and tabix-indexed:
plink2 --bfile study --r2-unphased --out study
# plink2 writes tabs and comments its own header, so sort-bed takes the table
# as it is; sort-bed is `sort -k1,1 -k2,2n` under LC_ALL=C with the `#` line
# kept on top
jbrowse sort-bed < study.vcor | bgzip > study.sorted.ld.gz
tabix -s 1 -b 2 -e 2 study.sorted.ld.gz
PLINK 1.9 writes the same table space-padded with a bare header, so there it needs a retab first:
plink --bfile study --r2 --out study
awk 'NR == 1 {$1 = "#"$1} {$1 = $1}1' OFS='\t' study.ld |
jbrowse sort-bed | bgzip > study.sorted.ld.gz
Comment the header with # rather than counting it with tabix -S 1. Both keep
it out of the data, but only the commented form is what tabix -H prints and
what readers ask for first, so a -S 1 header is easy to miss — and missing it
means missing the D' column, which is what makes D' available instead of only
r². (Not -c C: that makes C the meta character, so every chr1-style data
row would read as a comment.) A file already indexed with -S 1 still loads.
Expected columns, either spelling: CHR_A BP_A SNP_A CHR_B BP_B SNP_B R2, or plink2's CHROM_A POS_A ID_A CHROM_B POS_B ID_B PHASED_R2 (UNPHASED_R2 for the other statistic). Optional columns: DP / ABS_DPRIME / DPRIME (D'), MAF_A MAF_B / NONMAJ_FREQ_A NONMAJ_FREQ_B. A signed DPRIME is read as its magnitude, which is all a pre-computed cell can be drawn as.
study.vcor before bgzipping, plink2 adding cols= for anything past r²:
#CHROM_A POS_A ID_A CHROM_B POS_B ID_B UNPHASED_R2
1 729679 rs4970383 1 752566 rs3131972 0.0925926
1 729679 rs4970383 1 754182 rs3131969 0.157316
Used by the
variant LD display
(triangular r² heatmap) and by
GWAS Manhattan LD coloring
(LocusZoom-style r² to an index SNP). See either guide for generating the table.
--r2-phased is the statistic the LD display computes from genotypes, so it is
the one whose cells compare with a live triangle.
Related links
- Track: LDTrack
- Display: LDTrackDisplay
- Guide: GWAS track
- Guide: LD across an inversion (mosquitoes)
- Guide: Supported file types
Config slots
These slots go inside the track's adapter:
"adapter": { "type": "PlinkLDTabixAdapter", ... }. It also accepts the
shorthand keys uri,
baseUri, csi in place of writing a location slot out. Slot types
(fileLocation, frozen, ...) are explained in the
config slot types reference. Slots a base
configuration contributes are listed here too, so this table is the whole
surface.
| Slot | Description |
|---|---|
ldLocationfileLocation = { uri: '/path/to/plink.ld.gz', locationType: 'UriLocation' } | Location of the bgzipped PLINK LD table (.ld.gz or .vcor.gz) |
index.indexTypestringEnum (TBI, CSI) = 'TBI' | TBI is the usual tabix output. CSI is required for a reference longer than 512 Mb, which TBI cannot address. |
index.locationfileLocation = { uri: '/path/to/my.gz.tbi', locationType: 'UriLocation' } | location of the tabix index. Only needed when it is not named <file>.tbi (or .csi), which is what the uri shorthand assumes. |