mst_from_trj: Create the minimum spanning tree from time series

Description Usage Arguments Details Value See Also Examples

View source: R/loader.R

Description

mst_from_trj creates a minimum spanning tree from a time series (e.g. a trajectory in molecular dynamics) using different distance metrics between pairwise snapshots.

Usage

1
2
3
4
5
mst_from_trj(trj, distance_method = 5, distance_weights = NULL,
  clu_radius = NULL, clu_hardcut = NULL, normalize_d = TRUE,
  birch_clu = FALSE, min_span_tree = TRUE, mode = "fortran",
  rootmax_rad = NULL, tree_height = NULL, n_search_attempts = NULL,
  cores = NULL, logging = FALSE)

Arguments

trj

Input trajectory (variables on the columns and equal-time spaced snpashots on the row). It must be a matrix or a data.frame of numeric.

distance_method

Distance metric between snapshots. This value can be set 1 (dihedral angles) or 5 (root mean square deviation).

distance_weights

Vector of weights to be applied in order to compute averaged weighted distance using multiple distance_method. Each value must be between 0 and 1. This option works only if birch_clu=F.

clu_radius

This numeric argument is used in the clustering step in order to make clusters of the same radius at the base level.

clu_hardcut

This option is used only with birch_clu=F and defines the inter-clusters distance threshold.

normalize_d

A logical that indicates whether the distances must be normalized or not. Usually used with averaging.

birch_clu

A logical that indicates whether the algorithm will use a birch-tree like clustering step (short spanning tree - fast) or it will be generated using a simple leader clustering algorithm (minimum spanning tree).

min_span_tree

This option is used only with birch_clu=F and defines if the returning adjacency list must be a minimum spanning tree.

mode

It takes a string in input and can be either "fortran" (highly advised and default) or "R".

rootmax_rad

If birch_clu=T this option defines the maximum radius at the root level of the tree in the advanced clustering algorithm.

tree_height

If birch_clu=T this option defines the height of the tree in the advanced clustering algorithm.

n_search_attempts

If birch_clu=T a number of search attempts must be provided for the minimum spanning tree search.

cores

If mode="R" a complete adjacency matrix can be created in parallel using multiple cores (anyhow slower than "fortran" mode).

logging

If logging=T the function will print to file the fortran messages ("campari.log").

Details

For details, please refer to the main documentation of the original campari software http://campari.sourceforge.net/documentation.html.

Value

If no netcdf support is available the function will return a list with 3 arguments: node degrees, adjacency list and associated distances. If netcdf support is activated the function will dump the mst in the file "DUMPLING.nc".

See Also

adjl_from_progindex, gen_progindex, gen_annotation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
adjl <- mst_from_trj(trj = matrix(rnorm(1000), nrow = 100, ncol = 10))

## Not run: 
adjl <- mst_from_trj(trj = matrix(rnorm(1000),ncol=10,nrow=100),
distance_method = 5, clu_radius = 100, clu_hardcut = 100,
birch_clu = FALSE, mode = "fortran", logging = FALSE)

adjl <- adjl_from_trj(trj = matrix(rnorm(1000),ncol=10,nrow=100),
distance_method = 5, clu_radius = 0.1,
birch_clu = TRUE, mode = "fortran", rootmax_rad = 1.3, logging = FALSE,
tree_height = 5, n_search_attempts = 50)

## End(Not run)

CampaR1 documentation built on May 30, 2017, 2:51 a.m.