Namespace: plot

plco.plot

Sub-module grouping plotting methods.

Properties:
Name Type Description
manhattan function

plco.plot.manhattan

manhattan2 function

plco.plot.manhattan2

qq function

plco.plot.qq

qq2 function

plco.plot.qq2

pca function

plco.plot.pca

pca2 function

plco.plot.pca2

barchart function

plco.plot.barchart

Source:

Members

(static) helpers

A collection of helper methods for plotting, not intended to be used on its own.

Source:

Methods

(static) barchart(div_id, phenotype_id, to_jsonopt, customLayoutopt, customConfigopt)

Generates a Plotly barchart showing the breakdown of participants by gender and ancestry for that phenotype.

Parameters:
Name Type Attributes Default Description
div_id string

The id of the div element, if it does not exist, a new div will be created.

phenotype_id number

A phenotype id.

to_json boolean <optional>
false

Optional. If true, returns a stringified JSON object containing traces and layout. Else, returns a div element containing the Plotly graph.

customLayout object <optional>
{}

Optional. Contains Plotly supported layout key-values pair that will overwrite the default layout. Commonly overwritten values may include height and width of the graph. See: https://plotly.com/javascript/reference/layout/ for more details. Also, set to_json to true to see what the default layout is.

customConfig object <optional>
{}

Optional. Contains Plotly supported config key-values pair that will overwrite the default config. See: https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js#L22-L86 for full details.

Source:
Returns:

A div element or a string if to_json is true.

(static) manhattan(div_id, phenotype_idopt, sexopt, ancestryopt, p_value_nlog_minopt, chromosomeopt, to_jsonopt, customLayoutopt, customConfigopt)

Generates a Plotly manhattan plot at the given div element with support for a single input.

Parameters:
Name Type Attributes Default Description
div_id string

The id of the div element. If it does not exist, a new div will be created.

phenotype_id number <optional>
3080

A phenotype id.

sex string <optional>
female

A sex, which may be "all, "female", or "male".

ancestry string <optional>
european

An ancestry, which may be "african_american", "east_asian" or "european".

p_value_nlog_min number <optional>
2

A numeric value >= 0 specifying the minimum -log10(p) for variants.

chromosome integer <optional>

Optional A single chromosome. If no chromosome argument is passed, then assume all chromosomes.

to_json boolean <optional>
false

Optional If true, returns a stringified JSON object containing traces and layout. If false, returns a div element containing the Plotly graph.

customLayout object <optional>
{}

Optional. Contains Plotly supported layout key-values pair that will overwrite the default layout. Commonly overwritten values may include height and width of the graph. See: https://plotly.com/javascript/reference/layout/ for more details. Also, set to_json to true to see what the default layout is.

customConfig object <optional>
{}

Optional. Contains Plotly supported config key-values pair that will overwrite the default config. See: https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js#L22-L86 for full details.

Source:
Returns:

A div element or a string if 'to_json' is true.

Example
plco.plot.manhattan()
plco.plot.manhattan('plot', 3080, "female", "european", 2, 18)

(static) manhattan2(div_id, arrayOfObjects, p_value_nlog_minopt, chromosomeopt, to_jsonopt, customLayoutopt, customConfigopt)

Generates a Plotly manhattan plot at the given div element with support for multiple inputs.

Parameters:
Name Type Attributes Default Description
div_id string

The id of the div element. If it does not exist, a new div will be created.

arrayOfObjects Array

Accepts an array of objects containing the following keys: phenotype_id, sex, ancestry.

p_value_nlog_min number <optional>
2

A numeric value >= 0 specifying the minimum -log10(p) for variants.

chromosome number <optional>

Optional. Leave it undefined to plot all chromosomes. Else use an integer [1-22].

to_json boolean <optional>
false

Optional If true, returns a stringified JSON object containing traces and layout. If false, returns a div element containing the Plotly graph.

customLayout object <optional>
{}

Optional. Contains Plotly supported layout key-values pair that will overwrite the default layout. Commonly overwritten values may include height and width of the graph. See: https://plotly.com/javascript/reference/layout/ for more details. Also, set to_json to true to see what the default layout is.

customConfig object <optional>
{}

Optional. Contains Plotly supported config key-values pair that will overwrite the default config. See: https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js#L22-L86 for full details.

Source:
Returns:

A div element or a string if 'to_json' is true.

Example
await plco.plot.manhattan2('plot', [{phenotype_id: 3080, ancestry: 'european', sex: 'female'},{phenotype_id: 3080, ancestry: 'east_asian', sex: 'female'}])

(static) pca(div_id, phenotype_id, sex, ancestry, to_jsonopt, customLayoutopt, customConfigopt)

Generates a Plotly PCA plot at the given div element with support for a single input.

Parameters:
Name Type Attributes Default Description
div_id string

The id of the div element, if it does not exist, a new div will be created.

phenotype_id number

A phenotype id.

sex string

A sex, which may be "all", "female", or "male".

ancestry string

A character vector specifying ancestries to retrieve data for.

to_json boolean <optional>
false

Optional. If true, returns a stringified JSON object containing traces and layout. Else, returns a div element containing the Plotly graph.

customLayout object <optional>
{}

Optional. Contains Plotly supported layout key-values pair that will overwrite the default layout. Commonly overwritten values may include height and width of the graph. See: https://plotly.com/javascript/reference/layout/ for more details. Also, set to_json to true to see what the default layout is.

customConfig object <optional>
{}

Optional. Contains Plotly supported config key-values pair that will overwrite the default config. See: https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js#L22-L86 for full details.

Source:
Returns:

A div element or a string if to_json is true.

Example
await plco.plot.pca('plot', 3080, 'female', 'east_asian')

(static) pca2(div_id, arrayOfObjects, to_jsonopt, customLayoutopt, customConfigopt)

Generates a Plotly PCA plot at the given div element with support for multiple inputs.

Parameters:
Name Type Attributes Default Description
div_id string

The id of the div element, if it does not exist, a new div will be created.

arrayOfObjects Array

Accepts an array of objects containing the following keys: phenotype_id, sex, ancestry.

to_json boolean <optional>
false

Optional. If true, returns a stringified JSON object containing traces and layout. Else, returns a div element containing the Plotly graph.

customLayout object <optional>
{}

Optional. Contains Plotly supported layout key-values pair that will overwrite the default layout. Commonly overwritten values may include height and width of the graph. See: https://plotly.com/javascript/reference/layout/ for more details. Also, set to_json to true to see what the default layout is.

customConfig object <optional>
{}

Optional. Contains Plotly supported config key-values pair that will overwrite the default config. See: https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js#L22-L86 for full details.

Source:
Returns:

A div element or a string if to_json is true.

Example
await plco.plot.pca2('plot', [{phenotype_id: 3080, sex: 'female', ancestry: 'east_asian'}, {phenotype_id: 3080, sex: 'female', ancestry: 'european'}])

(static) qq(div_id, phenotype_idopt, sexopt, ancestryopt, to_jsonopt, customLayoutopt, customConfigopt)

Generates a Plotly quartile-quartile plot at the given div element with support for a single input.

Parameters:
Name Type Attributes Default Description
div_id string

The id of the div element, if it does not exist, a new div will be created.

phenotype_id number <optional>
3080

A phenotype id.

sex string <optional>
female

A sex, which may be "all", "female", or "male".

ancestry string <optional>
east_asian

A character vector specifying ancestries to retrieve data for.

to_json boolean <optional>
false

Optional. If true, returns a stringified JSON object containing traces and layout. Else, returns a div element containing the Plotly graph.

customLayout object <optional>
{}

Optional. Contains Plotly supported layout key-values pair that will overwrite the default layout. Commonly overwritten values may include height and width of the graph. See: https://plotly.com/javascript/reference/layout/ for more details. Also, set to_json to true to see what the default layout is.

customConfig object <optional>
{}

Optional. Contains Plotly supported config key-values pair that will overwrite the default config. See: https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js#L22-L86 for full details.

Source:
Returns:

A div element or a string if to_json is true.

Example
await plco.plot.qq('plot', 3080, 'female', 'east_asian')

(static) qq2(div_id, arrayOfObjects, to_jsonopt, customLayoutopt, customConfigopt)

Generates a Plotly quartile-quartile plot at the given div element with support for multiple inputs.

Parameters:
Name Type Attributes Default Description
div_id string

The id of the div element, if it does not exist, a new div will be created.

arrayOfObjects Array

Accepts an array of objects containing the following keys: phenotype_id, sex, ancestry.

to_json boolean <optional>
false

Optional. If true, returns a stringified JSON object containing traces and layout. Else, returns a div element containing the Plotly graph.

customLayout object <optional>
{}

Optional. Contains Plotly supported layout key-values pair that will overwrite the default layout. Commonly overwritten values may include height and width of the graph. See: https://plotly.com/javascript/reference/layout/ for more details. Also, set to_json to true to see what the default layout is.

customConfig object <optional>
{}

Optional. Contains Plotly supported config key-values pair that will overwrite the default config. See: https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js#L22-L86 for full details.

Source:
Returns:

A div element or a string if to_json is true.

Example
await plco.plot.qq2('plot', [{phenotype_id:3080, sex:'female', ancestry:'east_asian'}, {phenotype_id:3080, sex:'female', ancestry:'european'}, {phenotype_id: 3550, sex:'all', ancestry:'east_asian'}])