Use pdbfit() to an specific range of residues.

Issue #389 resolved
Victor Fica created an issue

Hi, I am recently using bio3d, i want to use pdbfit to an specific range of residues. I have a list of class "pdbs" obtained by pdbaln(files), the average sequence lenght is 216, but i want to fit only the first 110 residues of all pdbs.

Anny help would be great :)

Comments (3)

  1. Lars Skjærven

    Hi Victor, Use the inds argument for this. Note that inds refers to the columns of the pdbs$xyz matrix, and thus not the residue numbers of the PDB files. Note also gaps here. See attached example:

    > attach(transducin)
    
    # check for gaps
    > print(pdbs, alignment=F)
    
    Call:
      pdbaln(files = files, fit = TRUE, ncore = 8)
    
    Class:
      pdbs, fasta
    
    Alignment dimensions:
      53 sequence rows; 354 position columns (305 non-gap, 49 gap) 
    
    + attr: xyz, resno, b, chain, id, ali, resid, sse, call
    
    > plot(pdbs)
    > gaps.pos = gap.inspect(pdbs$xyz)
    > gaps.res = gap.inspect(pdbs$ali)
    
    > length(gaps.pos$f.inds)
    [1] 915
    > length(gaps.res$f.inds)
    [1] 305
    
    # fit on all non-gap containing columns
    > pdbfit(pdbs, inds=gaps.pos$f.inds) #, outpath="fit1")
    
    # fit on the first 60 columns
    > pdbfit(pdbs, inds=gaps.pos$f.inds[1:60]) #, outpath="fit2")
    
    # this corresponds to residues 31-50
    > pdbs$resno[1:5, gaps.res$f.inds[1:20]]
           [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
    1TND_A   31   32   33   34   35   36   37   38   39    40    41    42    43
    1TND_B   31   32   33   34   35   36   37   38   39    40    41    42    43
    1TND_C   31   32   33   34   35   36   37   38   39    40    41    42    43
    1TAD_A   31   32   33   34   35   36   37   38   39    40    41    42    43
    1TAD_B   31   32   33   34   35   36   37   38   39    40    41    42    43
           [,14] [,15] [,16] [,17] [,18] [,19] [,20]
    1TND_A    44    45    46    47    48    49    50
    1TND_B    44    45    46    47    48    49    50
    1TND_C    44    45    46    47    48    49    50
    1TAD_A    44    45    46    47    48    49    50
    1TAD_B    44    45    46    47    48    49    50
    
    # superimpose on core atoms
    > core <- core.find(pdbs)
    > pdbfit(pdbs, core)
    
  2. Log in to comment