Compute the pairwise Hamming or Jaccard distance between binary edge weights of the same genes in two different network topologies (denoted as adj_mat_qry and adj_mat_sbj).

network_dist_pairwise_genes(
  adj_mat_qry,
  adj_mat_sbj,
  dist_type = "hamming",
  print_message = TRUE
)

Arguments

adj_mat_qry

a binary adjacency matrix generated with network_rescale and network_make_binary.

adj_mat_sbj

a binary adjacency matrix with the same genes as in adj_mat_qry, but with differnt binary edge weights generated with network_rescale and network_make_binary.

dist_type

a distance method that shall be applied on the binary values for each gene. Available options are:

  • dist_type = "hamming": computes the hamming.distance for each gene between the two input matrices

  • dist_type = "jaccard": computes the jaccard for each gene between the two input matrices

print_message

shall massages be printed? Default is print_message = TRUE.

Author

Hajk-Georg Drost

Examples

## Import and rescale PIDC network # path to PIDC output file pidc_output <- system.file('beeline_examples/PIDC/outFile.txt', package = 'edgynode') # import PIDC specific output pidc_parsed <- pidc(pidc_output)
#> Repairing names...
#> New names: #> * `` -> ...1 #> * `` -> ...2 #> * `` -> ...3 #> * `` -> ...4 #> * `` -> ...5 #> * ...
#Set diagonal values diag(pidc_parsed) <- 1 # rescaling PIDC output pidc_rescaled <- network_rescale(pidc_parsed) pidc_binary_adj_mat <- network_make_binary(pidc_rescaled, threshold = "median")
#> network_make_binary() applies the median value over all values in the input matrix an uses [45.73] as cut-off threshold to transform the input weighted adjacency matrix into a binary adjacency matrix.
# compute hamming distances for each gene between input matrices network_dist_pairwise_genes(pidc_binary_adj_mat, pidc_binary_adj_mat, dist_type = "hamming")
#> - adj_mat_qry: nrow = (19) and ncol(19)
#> - adj_mat_sbj: nrow = (19) and ncol(19)
#> The Hamming Distances for each gene between the two input matrices are computed.
#> UGR_qry_vs_UGR_sbj WT1mKTS_qry_vs_WT1mKTS_sbj #> 0 0 #> GATA4_qry_vs_GATA4_sbj WT1pKTS_qry_vs_WT1pKTS_sbj #> 0 0 #> FOXL2_qry_vs_FOXL2_sbj DMRT1_qry_vs_DMRT1_sbj #> 0 0 #> DKK1_qry_vs_DKK1_sbj RSPO1_qry_vs_RSPO1_sbj #> 0 0 #> CTNNB1_qry_vs_CTNNB1_sbj WNT4_qry_vs_WNT4_sbj #> 0 0 #> NR0B1_qry_vs_NR0B1_sbj SRY_qry_vs_SRY_sbj #> 0 0 #> NR5A1_qry_vs_NR5A1_sbj DHH_qry_vs_DHH_sbj #> 0 0 #> PGD2_qry_vs_PGD2_sbj AMH_qry_vs_AMH_sbj #> 0 0 #> FGF9_qry_vs_FGF9_sbj SOX9_qry_vs_SOX9_sbj #> 0 0 #> CBX2_qry_vs_CBX2_sbj #> 0
# compute jaccard distances for each gene between input matrices network_dist_pairwise_genes(pidc_binary_adj_mat, pidc_binary_adj_mat, dist_type = "jaccard")
#> - adj_mat_qry: nrow = (19) and ncol(19)
#> - adj_mat_sbj: nrow = (19) and ncol(19)
#> The Jaccard Similarity Coefficients for each gene between the two input matrices are computed.
#> UGR_qry_vs_UGR_sbj WT1mKTS_qry_vs_WT1mKTS_sbj #> 1 1 #> GATA4_qry_vs_GATA4_sbj WT1pKTS_qry_vs_WT1pKTS_sbj #> 1 1 #> FOXL2_qry_vs_FOXL2_sbj DMRT1_qry_vs_DMRT1_sbj #> 1 1 #> DKK1_qry_vs_DKK1_sbj RSPO1_qry_vs_RSPO1_sbj #> 1 1 #> CTNNB1_qry_vs_CTNNB1_sbj WNT4_qry_vs_WNT4_sbj #> 1 1 #> NR0B1_qry_vs_NR0B1_sbj SRY_qry_vs_SRY_sbj #> 1 1 #> NR5A1_qry_vs_NR5A1_sbj DHH_qry_vs_DHH_sbj #> 1 1 #> PGD2_qry_vs_PGD2_sbj AMH_qry_vs_AMH_sbj #> 1 1 #> FGF9_qry_vs_FGF9_sbj SOX9_qry_vs_SOX9_sbj #> 1 1 #> CBX2_qry_vs_CBX2_sbj #> 1