lib/PDB/molecule.rb
# Convert 3-letter residue to 1-letter
# input is a string
Convert 3-letter residue to 1-letter
input is a string
Convert 3 - letter residue to 1 - letter input is a string
def convertTo3Letter(residue, type)
      begin
        if (type == "protein")
          if @@protein.has_key? (residue)
            returnMe = @@protein[residue]
          else
            raise "residue not found in protein sequence"
          end
        elsif (type == "nucleic")
          if @@nucleic.has_key? (residue)
            returnMe = @@nucleic[residue]
          else
            raise "residue not found in nucleic sequence"
          end
        end
      rescue => error
        PDB::report_error("#{error.class} and #{error.message} : #{residue} ")
      end
      returnMe
    end
def convertTo3Letter ( residue , type ) begin if ( type == "protein" ) if @@protein . has_key? ( residue ) returnMe = @@protein [ residue ] else raise "residue not found in protein sequence" end elsif ( type == "nucleic" ) if @@nucleic . has_key? ( residue ) returnMe = @@nucleic [ residue ] else raise "residue not found in nucleic sequence" end end rescue => error PDB :: report_error ( "#{error.class} and #{error.message} : #{residue} " ) end returnMe end
Convert 3-letter residue to 1-letter
input is a string
Convert 3 - letter residue to 1 - letter input is a string
residue
<not_specific>
type
<not_specific>