centres.ppRoll: Centres-of-Geometry: Rolling Window

View source: R/centres.roll.R

centres.ppRollR Documentation

Centres-of-Geometry: Rolling Window

Description

Computes the geometric centres using a rolling window on a polypeptide chain

Usage

## S3 method for class 'ppRoll'
centres(x, window, ...)

## Default S3 method:
centres.ppRoll(x, window = 34, na.rm = TRUE, ...)

## S3 method for class 'atoms'
centres.ppRoll(x, window = 34, chain = NULL, na.rm = TRUE, ...)

## S3 method for class 'pdb'
centres.ppRoll(x, window = 34, chain = NULL, na.rm = TRUE, ...)

Arguments

x

an R object containing atomic coordinates (with additional class ppRoll).

window

size of the rolling window, specified as number of amino-acids;

...

further arguments passed to or from other methods.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

chain

apply only to the respective chains, by default all chains;

Details

‘centres.ppRoll’ is a generic function to compute the geometric centres using a rolling window on an object containing atomic coordinates for a polypeptide chain. Due to limitations by CRAN check, the function is further referred as ‘centres’.

The function may be useful to visualize the overall protein structure, but in a less cluttered way. Unlike the protein backbone, the centres may capture better the bulk of the protein.

Value

Return an object of class ‘coords’ containing the coordinates of the centres.

See Also

coords, atoms, pdb.

Examples

### Example 1: Toll-Like Receptor 2
# Download pdb file for TLR2: 2Z81;
# Read the pdb-file:
# x = read.pdb("pdb2z81.ent")

# Compute the centres:
# tmp = centres.ppRoll(x)

# Visualize the structure:
# visualize(x, type="p", pbc.box = FALSE)
# lines3d(tmp, lwd = 5, col = "red")

# Add Another "strand":
# tmp = centres.ppRoll(x, window = 8)
# lines3d(tmp, lwd = 5, col = "#FA3296")

Rpdb documentation built on March 16, 2026, 5:07 p.m.