lib/PDB/molecule.rb
# locate a pair of residues in sequence
# residues must be in three letter codes
# returns starting index if found, otherwise -1
locate a pair of residues in sequence
residues must be in three letter codes
returns starting index if found, otherwise -1
locate a pair of residues in sequence residues must be in three letter codes returns starting index if found otherwise - 1
def findDoublet(doublet, startAt)
      first = doublet[0..2]
      last = doublet[3..5]
      tempArray = @residues.to_a
      totalInArray = @residues.length
      for i in startAt...(totalInArray-1)
        if tempArray[i].resname == first && tempArray[i+1].resname == last
          return i
        end
      end
      return -1 
    end
def findDoublet ( doublet , startAt ) first = doublet [ 0 .. 2 ] last = doublet [ 3 .. 5 ] tempArray = @residues . to_a totalInArray = @residues . length for i in startAt ... ( totalInArray - 1 ) if tempArray [ i ] . resname == first && tempArray [ i + 1 ] . resname == last return i end end return - 1 end
locate a pair of residues in sequence
residues must be in three letter codes
returns starting index if found, otherwise -1
locate a pair of residues in sequence residues must be in three letter codes returns starting index if found otherwise - 1
# puts "#{tempArray[i]} #{tempArray[i+1]}" # found it so break and return index # nothing found
doublet
<not_specific>
startAt
<not_specific>