Class: LDServer

LocusZoom_Adapters~LDServer()

Fetch linkage disequilibrium information from a UMich LDServer-compatible API, relative to a reference variant. If no plot.state.ldrefvar is explicitly provided, this source will attempt to find the most significant GWAS variant (smallest pvalue or largest neg_log_pvalue) and yse that as the LD reference variant.

This source is designed to connect its results to association data, and therefore depends on association data having been loaded by a previous request in the data chain. For custom association APIs, some additional options might need to be be specified in order to locate the most significant SNP. Variant IDs of the form chrom:pos_ref/alt are preferred, but this source will attempt to harmonize other common data formats into something that the LD server can understand.

Constructor

new LDServer()

Parameters:
Name Type Description
config.url string

The base URL for the remote data.

config.params object
Properties
Name Type Attributes Default Description
build <optional>
'GRCh37'

The genome build to use when calculating LD relative to a specified reference variant. May be overridden by a global parameter plot.state.genome_build so that all datasets can be fetched for the appropriate build in a consistent way.

source <optional>
'1000G'

The name of the reference panel to use, as specified in the LD server instance. May be overridden by a global parameter plot.state.ld_source to implement widgets that alter LD display.

population <optional>
'ALL'

The sample population used to calculate LD for a specified source; population names vary depending on the reference panel and how the server was populated wth data. May be overridden by a global parameter plot.state.ld_pop to implement widgets that alter LD display.

method <optional>
'rsquare'

The metric used to calculate LD

id_field <optional>

The association data field that contains variant identifier information. The preferred format of LD server is chrom:pos_ref/alt and this source will attempt to normalize other common formats. This source can auto-detect possible matches for field names containing "variant" or "id"

position_field <optional>

The association data field that contains variant position information. This source can auto-detect possible matches for field names containing "position" or "pos"

pvalue_field <optional>

The association data field that contains pvalue information. This source can auto-detect possible matches for field names containing "pvalue" or "log_pvalue". The suggested LD refvar will be the smallest pvalue, or the largest log_pvalue: this source will auto-detect the word "log" in order to determine the sign of the comparison.

Source:
See:

Methods

combineChainBody()

The LD adapter attempts to intelligently match retrieved LD information to a request for association data earlier in the data chain. Since each layer only asks for the data needed for that layer, one LD call is sufficient to annotate many separate association tracks.

Source:

fetchRequest()

The LDServer API is paginated, but we need all of the data to render a plot. Depaginate and combine where appropriate.

Source:

getCacheKey(state, chain, fields) → {string}

The LD adapter caches based on region, reference panel, and population name

Parameters:
Name Type Description
state
chain
fields
Source:
Returns:
Type
string

(protected) getRefvar() → {Array.<String>}

Get the LD reference variant, which by default will be the most significant hit in the assoc results This will be used in making the original query to the LD server for pairwise LD information.

This is meant to join a single LD request to any number of association results, and to work with many kinds of API. To do this, the datasource looks for fields with special known names such as pvalue, log_pvalue, etc. If your API uses different nomenclature, an option must be specified.

Source:
Returns:

Two strings: 1) the marker id (expected to be in chr:pos_ref/alt format) of the reference variant, and 2) the marker ID as it appears in the original dataset that we are joining to, so that the exact refvar can be marked when plotting the data..

Type
Array.<String>

getURL()

Identify (or guess) the LD reference variant, then add query parameters to the URL to construct a query for the specified region

Source:

normalizeResponse()

The LD API payload does not obey standard format conventions; do not try to transform it.

Source: