Giter Club home page Giter Club logo

Comments (6)

ivanovaos avatar ivanovaos commented on July 18, 2024

Hi @sugyun,

did you install CARNIVAL through github or through bioconductor?
There is an extensive tutorial available here: https://github.com/saezlab/transcriptutorial/ (e.g. https://github.com/saezlab/transcriptutorial/blob/master/scripts/sample_resolution_carnival.R)

If this doesn't help, can you share your dataframes so we can reproduce your error?

from carnival.

sugyun avatar sugyun commented on July 18, 2024

Hi @ivanovaos.
Thank you for your reply.

  1. I installed CARNIVAL through bioconductor.

  2. I uploaded my input dataframes.
    CARNIVALobj.zip
    (unzip and load in R)
    Now, I got the following error message.
    "Error in checkWeightObj(weightObj = weightObj, netObj = netObj) :
    Something wrong with your weight object/network object.
    No weighted node is present in the network.
    You can set the weightObj to NULL."
    I want to put the ROGENy pathway score (not measured protein activities).
    (I know that runCARNIVAL function works when I put some protein activities with uniprot ID.)

  3. When I clicked the github websites you gave above, I got "page not found" message.
    Could you check that it is public github address?

from carnival.

ivanovaos avatar ivanovaos commented on July 18, 2024

Hi @sugyun, you are right, the repository now is private, but this will change soon. The team works now on publishing it. We will let you know when it is ready.

As for now, how did you request the prior knowledge network? Did you do any filtering on omnipath?
CARNIVAL will require you to use weightObj that is matching the nodes in the network, it will help the solver find the optimal solutions faster. So you need to translate the pathways to the most logical representations of them, e.g. see the function below

assignPROGENyScores <- function (progeny = progeny, progenyMembers = progenyMembers, 
                                 id = "gene", access_idx = 1) 
{
  if (id == "uniprot") {
    idx <- which(names(progenyMembers) == "uniprot")
    progenyMembers <- progenyMembers[[idx]]
  }
  else {
    idx <- which(names(progenyMembers) == "gene")
    progenyMembers <- progenyMembers[[idx]]
  }
  members <- matrix(data = , nrow = 1, ncol = 2)
  pathways <- colnames(progeny)
  ctrl <- intersect(x = access_idx, y = 1:nrow(progeny))
  if (length(ctrl) == 0) {
    stop("The indeces you inserted do not correspond to \n              the number of rows/samples")
  }
  for (ii in 1:length(pathways)) {
    mm <- progenyMembers[[which(names(progenyMembers) == 
                                  pathways[ii])]]
    for (jj in 1:length(mm)) {
      members <- rbind(members, c(pathways[ii], mm[jj]))
    }
  }
  members <- members[-1, ]
  scores <- matrix(data = , nrow = nrow(progeny), ncol = nrow(members))
  colnames(scores) <- members[, 2]
  rownames(scores) <- rownames(progeny)
  members <- unique(members)
  for (i in 1:ncol(scores)) {
    for (j in 1:nrow(scores)) {
      scores[j, i] <- as.numeric(progeny[j, members[which(members[, 
                                                                  2] == colnames(scores)[i]), 1]])
    }
  }
  pxList <- list()
  for (ii in 1:length(access_idx)) {
    pxList[[length(pxList) + 1]] <- as.data.frame(t(as.matrix(scores[access_idx[ii], 
                                                                     ])))
  }
  names(pxList) <- rownames(progeny)[ctrl]
  return(pxList)
}

progenylist = assignPROGENyScores(progeny = t(weightObj), 
                                  progenyMembers = progenyMembers, 
                                  id = "uniprot", 
                                  access_idx = 1)

runCARNIVAL(inputObj = NULL, measObj = measObj, netObj = netObj, weightObj = progenylist$sample)

Please let me know if it worked out.

from carnival.

sugyun avatar sugyun commented on July 18, 2024

Hi @ivanovaos.
I don't know input dataframe of assignPROGENyScores function.
Could you provide any example dataframe of 'progeny' and 'progenyMembers'?
(I uploaded my input dataframes above as you requested. Are those dataframes not enough for runCARNIVAL?)

(+) My weightObj contains 2 rows. The first row contains the names of all "pathways" for contextualising the network while the second row contains the "scores" of each "pathways".

from carnival.

sugyun avatar sugyun commented on July 18, 2024

Hi @ivanovaos.
I finally solved the problem!

I used your "assignPROGENyScores" function and used "progenyMembers.RData" in CARNIVAL pacakge.

I uploaded my example code (including code, weightObj, netObj, measObj, and progenyMembers.RData).
examplecode.zip

Thank you so much for your help! :)

from carnival.

ivanovaos avatar ivanovaos commented on July 18, 2024

Happy to hear it was helpful. Thanks for sharing the resulting code!

from carnival.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.