Utilities¶
Utilities for VarGenPath.
-
vargenpath.utils.extend_vargen_network(linkset_path, client)[source]¶ Extend network with linkset in xgmml format. CytargetLinker provide a number of linksets that can be downloaded and used. https://cytargetlinker.github.io/pages/linksets
- Parameters
client (
CyRestClient) – cystoscape client.linkset_path (
str) – the path to the linkset used to extended the network.
- Return type
dict- Returns
-
vargenpath.utils.file_reader(file)[source]¶ Read text file.
- Parameters
file (
File) – text file containing the variants.- Return type
list- Returns
a list of variants.
-
vargenpath.utils.get_associated_genes(variants_list)[source]¶ Get variant gene information from BioMart. More information on BioMart here: https://www.ensembl.org/info/data/biomart/index.html
- Parameters
variants_list (
list) – the list with variant ids.- Return type
DataFrame- Returns
dataframe with variant and gene information
-
vargenpath.utils.save_image(*, network_image, image_type='SVG (*.svg)')[source]¶ Save network image. Types that can be used are JPEG (.jpeg, *.jpg), PDF (.pdf), PNG (.png), PostScript (.ps), SVG (*.svg)
- Parameters
network_image (
str) – path to save the network image.image_type (
str) – type of image to be saved.
- Return type
str- Returns
-
vargenpath.utils.save_network(*, network_path, file_type)[source]¶ Save network file.
- Parameters
network_path – path to save the network file.
file_type – type of file to be saved.
- Return type
str- Returns
-
vargenpath.utils.save_session(*, session_file, client)[source]¶ Save cystoscape session.
- Parameters
session_file (
str) – path to save the session.client (
CyRestClient) – cystoscape client.
- Return type
str- Returns
-
vargenpath.utils.var_genes_network(*, variants_genes_df, network_name='VarGenPath network', client)[source]¶ Create cytoscape network from dataframe.
- Parameters
variants_genes_df (
DataFrame) – dataframe containing the vaiants, genes and their interactionnetwork_name (
str) – the name of the network.client – the cystocape client.
- Return type
dict- Returns
cytoscape network