Genonets API

Analysis constants

The following constants can be used to specify the analyses to perform:

class genonets.constants.AnalysisConstants
ALL
PEAKS
PATHS
EPISTASIS
ROBUSTNESS
EVOLVABILITY
ACCESSIBILITY
NEIGHBOR_ABUNDANCE
PHENOTYPIC_DIVERSITY
STRUCTURE
OVERLAP

Genonets interface methods

The following methods are available via the Genonets API.

class genonets.interface.Genonets(args, process=False, parallel=False)

Encapsulates the Genonets public API.

analyze(genotype_sets=0, analyses=0, parallel=False)

Performs all analyses provided in the list of analysis types, on the given genotype sets.

This method can only be used if create has already been called on the same Genonets object.

Parameters
  • genotype_sets – List of names of the genotype sets for which the genotype networks should be created. If a value is not explicitly specified for this parameter, genotype networks are constructed for all genotype sets available in the parsed data.

  • analyses – List of analysis type constants. These constants are defined in the class genonets.genonets_constants.AnalysisConstants. If the value for this parameter is not explicitly set, all available analyses are performed.

  • parallel – Flag to indicate whether or not parallel processing should be used.

Returns

No return value.

create(genotype_sets=0, parallel=False)

Create genotype networks for the given list of genotype set names.

Parameters
  • genotype_sets – List of names of the genotype sets for which the genotype networks should be created. If a value is not explicitly specified for this parameter, genotype networks are constructed for all genotype sets available in the parsed data.

  • parallel – Flag to indicate whether or not parallel processing should be used.

Returns

No return value

dominant_network(genotype_set)

Get the igraph object for the dominant network corresponding to the given genotype set name.

The dominant network refers to the giant component in the network.

Note: This method can only be used if the genotype network corresponding to the requested genotype set name has already been created.

Parameters

genotype_set – Name of the genotype set for which the genotype network is requested.

Returns

Object of type igraph.Graph.

genotype_network(genotype_set)

Get the igraph object for the network corresponding to the given genotype set name.

The igraph object in this case refers to the entire network, i.e., all connected components.

Note: This method can only be used if the genotype network corresponding to the requested genotype set name has already been created.

Parameters

genotype_set – Name of the genotype set for which the genotype network is requested.

Returns

Object of type igraph.Graph.

genotype_sets()

Get a list of names of all genotype sets for which genotype networks have been created.

Returns

List of names of genotype sets.

phenotype_network(collection_name='phenotype_network', genotype_sets=0)

Create the phenotype network from the given list of genotype sets.

Parameters
  • collection_name – The name to be assigned to the phenotype network.

  • genotype_sets – List of names of the genotype sets for which the phenotype network should be created. If a value is not explicitly specified for this parameter, all available genotype sets are considered.

Returns

igraph.Graph object representing the phenotype network.

save(genotype_sets=0)

Write the genotype networks corresponding to the given genotype sets to file.

The networks are saved in GML format. For networks with more than one components, separate files are generated for the entire network and the dominant network.

Note: This method can be used only after analyze() has been called on the given genotype sets.

Parameters

genotype_sets – List of names of genotype sets for which the genotype should be written to file. If a value is not explicitly specified for this parameter, result files are written for all genotype sets.

Returns

No return value.

save_genotype_results(genotype_sets=0)

Write the genotype level results to files.

A results file is generated for each genotype set.

Note: This method can be used only after analyze() has been called on the given genotype sets.

Parameters

genotype_sets – List of names of genotype sets for which to generate the result files. If a value is not explicitly specified for this parameter, result files are written for all genotype sets.

Returns

No return value.

save_network_results(genotype_sets=0)

Write the genotype set level results to file.

A file named ‘Genotype_set_measures.txt’ is generated in the output directory specified at the time of the Genonets object creation.

Note: This method can be used only after analyze() has been called on the given genotype sets.

Parameters

genotype_sets – List of names of genotype sets for which to generate the result files. If a value is not explicitly specified for this parameter, result files are written for all genotype sets.

Returns

No return value.

save_phenotype_network()

Write the phenotype network to file in GML format.

Note: This method can only be used after the phenotype network has been created.

Returns

No return value.