Learn R Programming

SOMMD (version 0.1.2)

average.neur.property: Compute average property

Description

Function to compute the average value of a property for each neuron.

Usage

average.neur.property(SOM, P)

Value

The a vector with the per-neuron average of the property.

Arguments

SOM

the SOM object to cluster

P

the property for each frame of the simulation

Author

Stefano Motta stefano.motta@unimib.it

Examples

Run this code
#Read trajectory
trj <- read.trj(trjfile = system.file("extdata", "HIF2a-MD.xtc", package = "SOMMD"),
  topfile = system.file("extdata", "HIF2a.gro", package = "SOMMD"))
#Read example SOM data
som_model <- readRDS(system.file("extdata", "SOM_HIFa.rds", package = "SOMMD"))
#Compute distance between two atoms in every frame of the simulation
Distance <- apply(trj$coord[c(162,1794),,], 3, dist)
#Compute average property value for each neuron
avg.p <- average.neur.property(som_model, Distance)

Run the code above in your browser using DataLab