Torsional PCA error

Issue #436 resolved
Mamta Mohan created an issue

Hello,

I am trying to calculate torsional PCA.

I am following tutorial: http://thegrantlab.org/bio3d/html/pca.tor.html

Particular tutorial guide through calculation of PCA from torsional data from multiple pdbs.

However I decide to use a single PCA to calculate PCs in dihedtral space.

I am getting error listed below:

torsionData <- t(apply(pdb$xyz[, gaps.pos$f.inds], 1, torsion.xyz, atm.inc=1)) Error in apply(pdb$xyz[, gaps.pos$f.inds], 1, torsion.xyz, atm.inc = 1) : dim(X) must have a positive length

I understand I have to select only CA type because first argument in apply should be a matrix. I tried selecting CA only and trying to pass it as an argument but it does not work.

pdb.c <- atom.select(pdb, elety="CA")

This is not in matrix.

I calculated gaps for single pdb because gaps.pos$f.inds is required for non-gap column

gaps.pos <- gap.inspect(pdb$xyz) ---- because gaps.pos$f.inds is required

Build Torsion data : Calculate torsion for each atom at position xyz

torsionData <- t(apply(pdb$xyz[, gaps.pos$f.inds], 1, torsion.xyz, atm.inc=1))

I checked pdb$xyz[, gaps.pos$f.inds] at command line. It seems to give a vector which seems to have correct values.

but the argument in apply statement does not work. So I thought maybe calculating them separately and passing data to torsion.xyz might work. but it does not.

torsion.angles = pdb$xyz[, gaps.pos$f.inds] ---- gives me a vector of [1:4017]

torsion.data = torsion.xyz(torsion.angles, atm.inc=1) --- gives me a vector of [1:1339] with NA in certain positions.

So I know passing this to pca.tor is not going to work.

I would appreciate it you can help me this issue.

I would appreciate your response.

Comments (5)

  1. Lars Skjærven

    Hi Mamta, You need multiple conformations of your protein to calculate the PCs of the torsion angles. L

  2. Mamta Mohan reporter

    Thank you for your response.

    ok. So call will not work for single pdb.

    I will try on dcd then.

  3. Log in to comment