overlap_analysis

Issue #525 resolved
karolk created an issue

Hi,

I am trying to allign two conformational states, using coordinates of a fixed domain, and then calculate difference vector between these two for the whole structures, and then compare this diff.vector to my normal modes.

I tried the following:

1

aln <- struct.aln(closed, open, fixed.inds = closed.inds,mobile.inds = open.inds, max.cycles=0)
closed$xyz <- aln$xyz
xyz <- rbind(open$xyz[aln$a.inds$xyz], closed$xyz[aln$a.inds$xyz])
diff <- difference.vector(xyz)
oa <- overlap(modes, diff)

Then, I am getting error: Error in overlap(modes, diff) : overlap: unequal vector lengths

2

  • I aligned my structures, using a different program

  • I load these in R

  • I calculated diff.vector:

- xyz <- rbind(open$xyz,closed$xyz)
- diff <- difference.vector(xyz)
- oa <- overlap(modes,diff)

Again, the same error: Error in overlap(modes, diff) : overlap: unequal vector lengths

I know what does it mean, but I don't know why.

thanks

Comments (11)

  1. Lars Skjærven

    The dimensions of xyz are not the same as your modes object. Your problem is (probably)open$xyz[aln$a.inds$xyz]. Here a.inds$xyz corresponds to atoms used for superposition. aln$xyz contains the superimposed coordinates. read the docu for this function.

    Note that for comparing a structure difference vector, you should superimpose on all atoms, and not a subset as the struct.aln() function does. set max.cycles to 0, or use pdbfit or fit.xyz.

  2. karolk reporter

    Hi Lars,

    Yes. You are right. Thats way instead of going with option "1", I decided to try option "2" where I compare structures, the whole structures, which are already aligned. The idea here was simple: load two structures and calculate difference vector without aligning them. I will play with different options and I will let you know.

  3. karolk reporter

    I will have to check:). I spent last 2 hours doing ensemble NMA. Amazing tool:). I will let you know tomorrow.

  4. karolk reporter

    Hi,

    Thank you for the suggestions, regarding dim (modes and xyz). Actually, my xyz was empty. That's way it did not work. Nevertheless, I still was not able to get my difference vector, using coordinates, which were aligned in a different program and loaded in R.

    So, option 1: align in R. Here is my code, which uses fit.xyz. I am able to align and computed difference vector for whole proteins, but not for the proteins, which are aligned, using only part of a structure. Actually, fit.xyz fails during alignment.

    open <- read.pdb("open.pdb")
    closed <- read.pdb("closed.pdb")
    
    sele_open_CA <- atom.select(open, elety='CA')
    sele_closed_CA <- atom.select(closed, elety='CA')
    
    # select CAs of  domains, which will be used for alignment
    fitDomain_open <- atom.select(open, chain=c("A","J","K"...), elety = "CA")
    fitDomain_closed <- atom.select(closed, chain=c("A","J","K"...), elety = "CA")
    
    # bind 
    xyz <- rbind(open$xyz[sele_open_CA$xyz], closed$xyz[sele_closed_CA$xyz])
    
    ## Superimpose, using coordinates of fitDomain
    xyz[2,] <- fit.xyz(xyz[1,], xyz[2,], 1:ncol(xyz),fitDomain_open, fitDomain_closed)
    

    And here comes the error: "Error in fit.xyz(xyz[1, ], xyz[2, ], 1:ncol(xyz), fitDomain_open, fitDomain_closed) : length of 'fixed.inds' != length of 'mobile.inds'" It can't be since my fitDomain_open and fitDomain_closed have the same number of elements. I checked:

    fitDomain_open: Call: atom.select.pdb(pdb = open, elety = "CA", chain = c("A", "J", "K", ...))

    Atom Indices#: 2224 ($atom) XYZ Indices#: 6672 ($xyz)

    fitDomain_closed

    Call: atom.select.pdb(pdb = closed, elety = "CA", chain = c("A", "J", "K", ...))

    Atom Indices#: 2224 ($atom) XYZ Indices#: 6672 ($xyz)

    Thanks

  5. karolk reporter

    Hi,

    I refresh this. For reminder, I am trying to align two different conformations of my protein, using fit.xyz and then calculate diff.vector, and then perform overlap analysis. I want to align, using part of a protein only, and this is where the problems start.For the last few days I have tried a number of different options. None of these worked for me.

    Any suggestions will be appreciated.

    Example of another code. In this case the error was: Error in fit.xyz(xyz[1, ], xyz[2, ], 1:ncol(xyz), fixed.inds = caTM.inds.open$xyz, : NA elements selected for fitting (check indices)

    open <- read.pdb("X.pdb")
    clos <- read.pdb("Y.pdb")
    
    ca.inds.open <- atom.select(open, elety='CA')
    ca.inds.clos <- atom.select(clos, elety='CA')
    
    caTM.inds.open <- atom.select(open, chain=c("X","Y","Z"), elety='CA')
    caTM.inds.clos <- atom.select(clos, chain=c("X","Y","Z"), elety='CA')
    
    xyz <- rbind(ca.inds.open$xyz,ca.inds.clos$xyz)
    
    xyz[2,] <- fit.xyz(xyz[1,], xyz[2,], 1:ncol(xyz), fixed.inds=caTM.inds.open$xyz, mobile.inds = caTM.inds.clos$xyz)
    
  6. Lars Skjærven

    Hello, What's your third input argument to fit.xyz() doing? Also, fitDomain_open and fitDomain_closed are associated with the all-atom open and closed pdb objects, not the CA xyz coordinates which are provided to fit.xyz().

    try something in this direction

    open <- read.pdb("open.pdb")
    closed <- read.pdb("closed.pdb")
    
    sele_open_CA <- atom.select(open, elety='CA')
    sele_closed_CA <- atom.select(closed, elety='CA')
    
    open_CA = trim(open, sele_open_CA)
    closed_CA = trim(open, sele_closed_CA)
    
    length(open_CA$xyz)
    length(closed_CA$xyz)
    
    # select CAs of  domains, which will be used for alignment
    fitDomain_open <- atom.select(open_CA, chain=c("A","J","K"))
    fitDomain_closed <- atom.select(closed_CA, chain=c("A","J","K"))
    
    # bind 
    xyz <- rbind(open_CA$xyz, closed_CA$xyz)
    
    ## Superimpose, using coordinates of fitDomain
    xyz[2,] <- fit.xyz(xyz[1,], xyz[2,], fitDomain_open$xyz, fitDomain_closed$xyz)
    
  7. Log in to comment