Skip to content

How to run ICMgs with a graph object as input? #3

Description

@mschubert

I'm trying to build an ICMg model where my network is an igraph object, but the function only takes matrices as network objects.

So I tried using the same code that is used by detect.response to convert one to the other:

datamatrix = netresponse:::check.matrix(my_expression_matrix)

tmp = netresponse:::check.network(network, datamatrix, verbose = TRUE)
network = tmp$formatted
network.orig = tmp$original
delta = tmp$delta
network.nodes = tmp$nodes
rm(tmp)

samples = rownames(datamatrix)
datamatrix = matrix(datamatrix[, network.nodes], nrow(datamatrix))
colnames(datamatrix) = network.nodes
rownames(datamatrix) = samples
rm(samples)

result = ICMg.combined.sampler(t(network), datamatrix, C=20)

However, this fails - and I'm not sure why.

For the conversion, I assumed the following:

  • my_expression_matrix is [samples x observations]
  • network can be any igraph object
  • osmo$ppi is [link x (in,out)] where values are numeric (not name) row index in osmo$exp
  • osmo$exp is [observations x samples] - the documentation states [nodes x observations], but the way I interpret it nodes and observations are the same thing

Is this correct?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions