Test

From "A B C"
Revision as of 07:12, 17 September 2020 by Boris (talk | contribs)
Jump to navigation Jump to search


Sample Journal


 



 

<my activity>

Objective
text ...

Time estimated: XXX h; taken XXX h;
Date started: 2020-MM-DD; completed: 2020-MM-DD

Progress


Activity 1
Notes ...
Activity 2
Notes ...

Conclusion and outlook


Describe ...


 



(Example Journal Entry) Explore Cytoscape

Objective
Write R code to generate a random network. Explore it with Cytoscape.

Time estimated: 2 h; taken 4 h;
Date started: 2017-09-16; completed: 2017-09-18

Progress


R code for a random network.
Cytoscape can read networks in SIF format. Wrote the following code to generate N random nodes with random interactions and write them to file.

My R code below ...

N <- 15  # number of nodes
nMin <- 1 # minimum number of edges
nMax <- 5 # maximum number of edges
OUT <- "myRandomSIF.txt"
# Create N random strings from three uppercase characters
# First make more than we need, because some might not be unique ...
nodes <- character(2*N)
set.seed(161803)
for (i in 1:(2*N)) {
  nodes[i] <- paste0(sample(LETTERS, 1),
                     sample(LETTERS, 1),
                     sample(LETTERS, 1))
}
set.seed(NULL)
nodes <- unique(nodes) # throw away duplicates ...
nodes <- nodes[1:N]    # ... and keep only N
# Create SIF output
mySIF <- character()
set.seed(112358)
for (myA in nodes) {  # for each node
  for (i in 1:sample(nMin:nMax, 1)) { # for a random number of interactors ...
    myB <- sample(nodes, 1)           # ... randomly choose interactor ...
                                      # ... create record and apend to mySIF
    mySIF <- c(mySIF, sprintf("%s\tpp\t%s", myA, myB)) # myA, "pp", myB
                                                       # separated by tabs
  }
}
set.seed(NULL)
# write mySIF to file
writeLines(mySIF, OUT)
Install Cytoscape
Straightforward installation of Cytoscape 3.5.1 from http://www.cytoscape.org
Visualize and explore options


 

Conclusion and outlook


  • Creating layouts, applying styles, adding nodes and edges with Cytoscape seems straightforward and creates evocative images.
  • Analyzing and interpreting the network needs more thought. Need to explore ideas and tools for network analysis next - e.g. clustering tools, enrichment tools, motif discovery ...
  • Next: write some code to create attribute values for nodes, import the values, and have Cytoscape style the nodes accordingly.


 

Notes and References


 


CreativeCommonsBy.png This copyrighted material is licensed under a Creative Commons Attribution 4.0 International License. Follow the link to learn more.