Class: BaseLZAdapter

LocusZoom_Adapters~BaseLZAdapter(config, limit_fieldsopt)

new BaseLZAdapter(config, limit_fieldsopt)

Parameters:
Name Type Attributes Default Description
config object
Properties
Name Type Attributes Default Description
cache_enabled <optional>
true
cache_size <optional>
3
url <optional>
prefix_namespace <optional>
true

Whether to modify the API response by prepending namespace to each field name. Most adapters will do this by default, so that each field is unambiguously defined based on where it comes from. (this helps to disambiguate two providers that return similar field names, like assoc:variant and catalog:variant) Typically, this is only disabled if the response payload is very unusual

limit_fields Array.<String> <optional>
null

If an API returns far more data than is needed, this can be used to simplify the payload by excluding unused fields. This can help to reduce memory usage for really big server responses like LD.

Source:

Methods

_findPrefixedKey(a_record, fieldname)

Convenience method, manually called in LZ sources that deal with dependent data.

In the last step of fetching data, LZ adds a prefix to each field name. This means that operations like "build query based on prior data" can't just ask for "log_pvalue" because they are receiving "assoc:log_pvalue" or some such unknown prefix.

This helper lets us use dependent data more easily. Not every adapter needs to use this method.

Parameters:
Name Type Description
a_record Object

One record (often the first one in a set of records)

fieldname String

The desired fieldname, eg "log_pvalue"

Source: