Skip to contents

Links class stores and analyzes gene regulatory networks. It contains GRN links (edges) for each cluster and provides methods for filtering, merging, and computing network metrics.

Public fields

links_dict

Named list of link data frames (one per cluster)

filtered_links

Filtered links after applying thresholds

merged_score

Merged network scores across clusters

TFdict

TF-target dictionary

cluster_column

Cluster column name

raw_count

Raw link counts per cluster

Methods


Method new()

Create a new Links object

Usage

Links$new(links_dict = NULL, TFdict = NULL, cluster_column = NULL)

Arguments

links_dict

Named list of link data frames

TFdict

TF dictionary

cluster_column

Cluster column name


Filter links by statistical significance and coefficient threshold

Usage

Links$filter_links(p = 0.001, threshold_number = 10000, min_coef = 0)

Arguments

p

Percentile threshold for filtering (0-1)

threshold_number

Maximum number of links to keep per cluster

min_coef

Minimum absolute coefficient


Method get_network_score()

Get network scores for each gene

Computes degree, betweenness, eigenvector centrality for genes.

Usage

Links$get_network_score()


Get links as combined data frame

Usage

Links$get_links_df(filtered = TRUE)

Arguments

filtered

Use filtered links

Returns

Data frame with all links


Method get_degree_distribution()

Get degree distribution statistics

Usage

Links$get_degree_distribution(cluster = NULL, mode = "all")

Arguments

cluster

Specific cluster (NULL for all)

mode

Degree mode: "all", "in", "out"

Returns

Data frame with degree statistics


Method compare_gene()

Compare network metrics between clusters

Usage

Links$compare_gene(gene)

Arguments

gene

Gene to compare

Returns

Data frame with per-cluster metrics


Method get_top_genes()

Get top genes by network metric

Usage

Links$get_top_genes(metric = "degree_all", cluster = NULL, n = 20)

Arguments

metric

Metric name (degree_all, betweenness, eigenvector)

cluster

Specific cluster (NULL for all)

n

Number of top genes

Returns

Data frame with top genes


Method get_regulators()

Get regulators of a target gene

Usage

Links$get_regulators(target, cluster = NULL)

Arguments

target

Target gene name

cluster

Specific cluster (NULL for all)

Returns

Data frame with regulator information


Method get_targets()

Get targets of a regulator

Usage

Links$get_targets(source, cluster = NULL)

Arguments

source

Regulator gene name

cluster

Specific cluster (NULL for all)

Returns

Data frame with target information


Method to_igraph()

Export to igraph object

Usage

Links$to_igraph(cluster = NULL)

Arguments

cluster

Specific cluster (NULL = merge all)

Returns

igraph object


Method save()

Save Links object

Usage

Links$save(file_path)

Arguments

file_path

Path to save file


Method print()

Print Links summary

Usage

Links$print()


Method clone()

The objects of this class are cloneable with this method.

Usage

Links$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.