<commit_before>module PDB
  class Atom

    attr_accessor :atom_number, :chain, :xpos, :ypos, :zpos, :occ, :temp, :alt
    attr_reader :atom_type, :residue, :residue_type, :resid, :icode, :mass, :atom

    @@masses = Hash.new

    @@masses["H"]  = 1.008
    @@masses["LI"] = 6.941
    @@masses["C"]  = 12.011
    @@masses["N"]  = 14.007
    @@masses["O"]  = 15.999
    @@masses["NA"] = 22.990
    @@masses["SI"] = 28.086
    @@masses["P"]  = 30.974
    @@masses["S"]  = 32.066
    @@masses["CL"] = 35.453
    @@masses["K"]  = 39.098
    @@masses["CA"] = 40.078
    @@masses["SE"] = 78.971

    def initialize(line)

      if !(line =~ /ATOM/)
        raise ("Not a PDB formatted line")
      end

      @atom_number = line[6,5].to_i
      @atom_type = line[12,4].strip

      @residue = line[17,3].strip # such as GLY, ADE

      @residue_type = "" # protein, nucleic acid, etc

      @alt = line[16].strip # alternate location

      @resid = line[22,4].to_i
      @icode = line[26].strip # insertion
      @chain = line[21].strip


      @xpos = line[30,8].to_f
      @ypos = line[38,8].to_f
      @zpos = line[46,8].to_f

      @atom = line[76,2].strip
      @old = line

      #if (@atom =~ /[0-9]+/)
        @atom = ""
      #end

      if @atom_type == "O1P"
        @atom_type = "OP1"
        @atom = "P"
      end

      if @atom_type == "O2P"
        @atom_type = "OP2"
        @atom = "P"
      end

      @occ = line[54,6].to_f
      @temp = line[60,6].to_f

      setMass()

    end

    def setResidueType(type)
      @residue_type = type
    end<commit_msg>fixed bug withh @old variable which should hold only the orignal atom specification, instead it was holding the line<commit_after>module PDB
  class Atom

    attr_accessor :atom_number, :chain, :xpos, :ypos, :zpos, :occ, :temp, :alt
    attr_reader :atom_type, :residue, :residue_type, :resid, :icode, :mass, :atom

    @@masses = Hash.new

    @@masses["H"]  = 1.008
    @@masses["LI"] = 6.941
    @@masses["C"]  = 12.011
    @@masses["N"]  = 14.007
    @@masses["O"]  = 15.999
    @@masses["NA"] = 22.990
    @@masses["SI"] = 28.086
    @@masses["P"]  = 30.974
    @@masses["S"]  = 32.066
    @@masses["CL"] = 35.453
    @@masses["K"]  = 39.098
    @@masses["CA"] = 40.078
    @@masses["SE"] = 78.971

    def initialize(line)

      if !(line =~ /ATOM/)
        raise ("Not a PDB formatted line")
      end

      @atom_number = line[6,5].to_i
      @atom_type = line[12,4].strip

      @residue = line[17,3].strip # such as GLY, ADE

      @residue_type = "" # protein, nucleic acid, etc

      @alt = line[16].strip # alternate location

      @resid = line[22,4].to_i
      @icode = line[26].strip # insertion
      @chain = line[21].strip


      @xpos = line[30,8].to_f
      @ypos = line[38,8].to_f
      @zpos = line[46,8].to_f

      @atom = line[76,2].strip
      @old = line[76,2].strip

      #if (@atom =~ /[0-9]+/)
        @atom = ""
      #end

      if @atom_type == "O1P"
        @atom_type = "OP1"
        @atom = "P"
      end

      if @atom_type == "O2P"
        @atom_type = "OP2"
        @atom = "P"
      end

      @occ = line[54,6].to_f
      @temp = line[60,6].to_f

      setMass()

    end

    def setResidueType(type)
      @residue_type = type
    end
{'fraction_non_alphanumeric': 0.17930610991710164, 'fraction_numerical': 0.06478354313785692, 'mean_word_length': 2.1206896551724137, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '865010', 'n_tokens_mistral': 1480, 'n_tokens_neox': 1273, 'n_words': 275}