interfaces.cmtk.nx

AverageNetworks

Link to code

Calculates and outputs the average network given a set of input NetworkX gpickle files

This interface will only keep an edge in the averaged network if that edge is present in at least half of the input networks.

Example

>>> import nipype.interfaces.cmtk as cmtk
>>> avg = cmtk.AverageNetworks()
>>> avg.inputs.in_files = ['subj1.pck', 'subj2.pck']
>>> avg.run()                 # doctest: +SKIP

Inputs:

[Mandatory]
in_files: (a list of items which are a pathlike object or string
          representing an existing file)
        Networks for a group of subjects

[Optional]
resolution_network_file: (a pathlike object or string representing an
          existing file)
        Parcellation files from Connectome Mapping Toolkit. This is not
        necessary, but if included, the interface will output the
        statistical maps as networkx graphs.
group_id: (a unicode string, nipype default value: group1)
        ID for group
out_gpickled_groupavg: (a pathlike object or string representing a
          file)
        Average network saved as a NetworkX .pck
out_gexf_groupavg: (a pathlike object or string representing a file)
        Average network saved as a .gexf file

Outputs:

gpickled_groupavg: (a pathlike object or string representing a file)
        Average network saved as a NetworkX .pck
gexf_groupavg: (a pathlike object or string representing a file)
        Average network saved as a .gexf file
matlab_groupavgs: (a list of items which are a pathlike object or
          string representing a file)

NetworkXMetrics

Link to code

Calculates and outputs NetworkX-based measures for an input network

Example

>>> import nipype.interfaces.cmtk as cmtk
>>> nxmetrics = cmtk.NetworkXMetrics()
>>> nxmetrics.inputs.in_file = 'subj1.pck'
>>> nxmetrics.run()                 # doctest: +SKIP

Inputs:

[Mandatory]
in_file: (a pathlike object or string representing an existing file)
        Input network

[Optional]
out_k_core: (a pathlike object or string representing a file, nipype
          default value: k_core)
        Computed k-core network stored as a NetworkX pickle.
out_k_shell: (a pathlike object or string representing a file, nipype
          default value: k_shell)
        Computed k-shell network stored as a NetworkX pickle.
out_k_crust: (a pathlike object or string representing a file, nipype
          default value: k_crust)
        Computed k-crust network stored as a NetworkX pickle.
treat_as_weighted_graph: (a boolean, nipype default value: True)
        Some network metrics can be calculated while considering only a
        binarized version of the graph
compute_clique_related_measures: (a boolean, nipype default value:
          False)
        Computing clique-related measures (e.g. node clique number) can be
        very time consuming
out_global_metrics_matlab: (a pathlike object or string representing
          a file)
        Output node metrics in MATLAB .mat format
out_node_metrics_matlab: (a pathlike object or string representing a
          file)
        Output node metrics in MATLAB .mat format
out_edge_metrics_matlab: (a pathlike object or string representing a
          file)
        Output edge metrics in MATLAB .mat format
out_pickled_extra_measures: (a pathlike object or string representing
          a file, nipype default value: extra_measures)
        Network measures for group 1 that return dictionaries stored as a
        Pickle.

Outputs:

gpickled_network_files: (a list of items which are a pathlike object
          or string representing a file)
matlab_matrix_files: (a list of items which are a pathlike object or
          string representing a file)
global_measures_matlab: (a pathlike object or string representing a
          file)
        Output global metrics in MATLAB .mat format
node_measures_matlab: (a pathlike object or string representing a
          file)
        Output node metrics in MATLAB .mat format
edge_measures_matlab: (a pathlike object or string representing a
          file)
        Output edge metrics in MATLAB .mat format
node_measure_networks: (a list of items which are a pathlike object
          or string representing a file)
edge_measure_networks: (a list of items which are a pathlike object
          or string representing a file)
k_networks: (a list of items which are a pathlike object or string
          representing a file)
k_core: (a pathlike object or string representing a file)
        Computed k-core network stored as a NetworkX pickle.
k_shell: (a pathlike object or string representing a file)
        Computed k-shell network stored as a NetworkX pickle.
k_crust: (a pathlike object or string representing a file)
        Computed k-crust network stored as a NetworkX pickle.
pickled_extra_measures: (a pathlike object or string representing a
          file)
        Network measures for the group that return dictionaries, stored as a
        Pickle.
matlab_dict_measures: (a list of items which are a pathlike object or
          string representing a file)

add_dicts_by_key()

Link to code

Combines two dictionaries and adds the values for those keys that are shared

add_edge_data()

Link to code

add_node_data()

Link to code

average_networks()

Link to code

Sums the edges of input networks and divides by the number of networks Writes the average network as .pck and .gexf and returns the name of the written networks

compute_dict_measures()

Link to code

Returns a dictionary

compute_edge_measures()

Link to code

These return edge-based measures

compute_network_measures()

Link to code

compute_node_measures()

Link to code

These return node-based measures

compute_singlevalued_measures()

Link to code

Returns a single value per network

fix_keys_for_gexf()

Link to code

GEXF Networks can be read in Gephi, however, the keys for the node and edge IDs must be converted to strings

read_unknown_ntwk()

Link to code

remove_all_edges()

Link to code