atom.select in a pdbs object

Issue #212 resolved
Former user created an issue

It is possible to use atom.select in a pdbs object by pdbaln? Thanks in advance

Comments (4)

  1. Lars Skjærven

    Nope. But you can easily access various columns in the pdbs object

    > attach(transducin)
    
    # columns for residues 50-75
    > pdbs$resno[1,] %in% 50:75
    
    # access the pdbs object
    > inds <- which(pdbs$resno[1,] %in% 50:75)
    > pdbs$resno[1:5, inds]
           [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
    1TND_A   50   51   52   53   54   55   56   57   58    59    60    61    62
    1TND_B   50   51   52   53   54   55   56   57   58    59    60    61    62
    1TND_C   50   51   52   53   54   55   56   57   58    59    60    61    62
    1TAD_A   50   51   52   53   54   55   56   57   58    59    60    61    62
    1TAD_B   50   51   52   53   54   55   56   57   58    59    60    61    62
    
    # access coordinates
    >  pdbs$xyz[1:5, atom2xyz(inds)]
               [,1]     [,2]     [,3]     [,4]     [,5]     [,6]     [,7]     [,8]
    1TND_A 12.93100 70.15100 33.83400 12.72400 69.66300 30.03400 16.45300 69.69800
    1TND_B 13.07051 70.41223 33.89492 12.59500 69.69973 30.18477 16.32115 69.58301
    1TND_C 13.03299 70.20335 33.87441 12.61042 69.64977 30.15984 16.35614 69.71211
    1TAD_A 12.99333 70.20665 33.82218 12.77226 69.86778 30.03273 16.51921 69.65980
    1TAD_B 13.02699 70.23522 33.85340 12.72837 69.87418 30.07965 16.48783 69.74418
    

    You can also use function trim.pdbs to make a subset of your pdbs object:

    > trim(pdbs, row.inds=1:5, col.inds=inds)
             1        .         .     26 
    1TND_A   KIIHQDGYSLEECLEFIAIIYGNTLQ
    1TND_B   KIIHQDGYSLEECLEFIAIIYGNTLQ
    1TND_C   KIIHQDGYSLEECLEFIAIIYGNTLQ
    1TAD_A   KIIHQDGYSLEECLEFIAIIYGNTLQ
    1TAD_B   KIIHQDGYSLEECLEFIAIIYGNTLQ
             ************************** 
             1        .         .     26 
    
    Call:
      trim.pdbs(pdbs = pdbs, row.inds = 1:5, col.inds = inds)
    
    Class:
      pdbs, fasta
    
    Alignment dimensions:
      5 sequence rows; 26 position columns (26 non-gap, 0 gap) 
    
    + attr: id, xyz, resno, b, chain, ali, resid, call
    

    note that row.inds and col.inds refer to indices of the pdbs$ali matrix in which data for each structure is stored row wise. thus, use the row.inds to fetch a subset of structures, and col.inds to trim the structures to desired residues.

  2. Barry Grant

    Currently not, as we don't have a pdbs method for atom.select(). I can see that this would be useful but potentially confusing as the individual structures stored in a given pdbs object can be quite heterogenous. Can you maybe describe what you would like the ability to select by? For example, would it be sufficient to select based on the first structure only or would the ability to select on any structure be useful?

    Currently if one wanted to select a given residue range in all structures you would query the pdbs$resno component focusing on your favorite structure, e.g.

    ## Quick example **pdbs** class object
    > pdbs <- pdbaln( get.pdb(c("4q21","5p21"), URLonly=TRUE) )
    
    ## Select positions coresponding to residue numbers 90:95 in first structure
    > atom.inds <- which(pdbs$resno[1,] %in% 90:95)
    > xyz.inds <- atom2xyz(atom.inds)
    
    ## RMSD for this segment after fitting on this segment
    > rmsd(pdbs$xyz[,xyz.inds], fit=TRUE )
          [,1]  [,2]
    [1,] 0.000 0.102
    [2,] 0.102 0.000
    
  3. leleonp

    I have the same protein with differents non synonimous variants (wild type and many mutants structures. All the proteins structures were previously refined. I would like to focus in the effect of this mutations in one domain. So in this case i guess trim.pdb could be usefull, because i would like to conserve the initial structure. Thanks

  4. Barry Grant

    Marking as resolved and adding a note to the ToDo wiki page about developing a atom.select.pdbs() in the future.

  5. Log in to comment