Last data update: 2014.03.03

R: Returns a List of Contacts for a given Contact Map
get.contact.listR Documentation

Returns a List of Contacts for a given Contact Map

Description

From a given contact map a list of contacts is computed.

Usage

get.contact.list(cm, d = NULL, single = TRUE, val = 1)

Arguments

cm

binary matrix which specifies which amino acid position are in contact

d

vector specifying the last amino acids of each chain

single

bool, if TRUE only indices i < j are returned

val

numeric value, indices of matrix entries with this value are returned

Details

All amino acid pairs with cm[i,j] == val are extracted from the cm. Each pair is listed once [i,j] = [j,i] (if single = TRUE) with i < j. If d is specified the contacts of the off-diagonal (peptide bonds) are left out, otherwise they will be returned as well. The values of d are the indices of the off-diagonal entries that do not represent a peptide bond.

Value

Return value is a list with the indices of all pairs of amino acids that fulfill the above stated condition.

Author(s)

Franziska Hoffgaard

See Also

build.contacts, simc

Examples

mat<-matrix(c(0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0,
              0, 1, 0, 1, 0, 0), ncol = 5)
get.contact.list(mat)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BioPhysConnectoR)
Loading required package: snow
Loading required package: matrixcalc
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/BioPhysConnectoR/get.contact.list.Rd_%03d_medium.png", width=480, height=480)
> ### Name: get.contact.list
> ### Title: Returns a List of Contacts for a given Contact Map
> ### Aliases: get.contact.list
> ### Keywords: utilities
> 
> ### ** Examples
> 
> mat<-matrix(c(0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0,
+               0, 1, 0, 1, 0, 0), ncol = 5)
> get.contact.list(mat)
[[1]]
[1] 1 3

[[2]]
[1] 2 3

[[3]]
[1] 1 4

[[4]]
[1] 1 5

[[5]]
[1] 3 5

> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>