Optional LocusZoom extension: must be included separately, and after LocusZoom has been loaded
This plugin exports helper function, as well as a few optional extra helpers for rendering the plot. The GWAS parsers can be used without registering the plugin.
To use in an environment without special JS build tooling, simply load the extension file as JS from a CDN (after any dependencies):
<script src="https://cdn.jsdelivr.net/npm/locuszoom@INSERT_VERSION_HERE/dist/ext/lz-parsers.min.js" type="application/javascript"></script>
To use with ES6 modules, import the helper functions and use them with your layout:
import { install, makeGWASParser, makeBed12Parser, makePlinkLDParser } from 'locuszoom/esm/ext/lz-parsers';
LocusZoom.use(install);
Features provided
- module:LocusZoom_Adapters~UserTabixLD (if the module:ext/lz-tabix-source extension is loaded first)
- Source:
Methods
(inner) makeBed12Parser(options)
Parse a BED file, according to the widely used UCSC (quasi-)specification
NOTE: This original version is aimed at tabix region queries, and carries an implicit assumption that data is the only thing that will be parsed. It makes no attempt to identify or handle header rows / metadata fields.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
options |
object |
Properties
|
- Source:
Returns:
function A configured parser function that runs on one line of text from an input file
(inner) makeGWASParser(options) → {function}
Specify how to parse a GWAS file, given certain column information. Outputs an object with fields in portal API format.
All column options must be provided as 1-indexed column IDs (human-friendly argument values)
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Properties
|
- Source:
Returns:
A parser function that can be called on each line of text with the provided options
- Type
- function
(inner) makePlinkLdParser(options) → {function}
Parse the output of plink v1.9 R2 calculations relative to one (or a few) target SNPs. See: https://www.cog-genomics.org/plink/1.9/ld and reformatting commands at https://www.cog-genomics.org/plink/1.9/other
Parameters:
Name | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
Properties
|
- Source:
Returns:
A configured parser function that runs on one line of text from an input file
- Type
- function