lib/rubabel/molecule/fragmentable.rb in rubabel-0.2.2 vs lib/rubabel/molecule/fragmentable.rb in rubabel-0.3.0
- old
+ new
@@ -29,11 +29,11 @@
# splits the molecule between the carbon and carbon_nbr, adds a double
# bond between the carbon and oxygen, and moves whatever was on the
# oxygen (e.g., an OH or a charge) to the carbon_nbr. Returns two new
# molecules.
def carbonyl_oxygen_dump(carbon, oxygen, carbon_nbr)
- appendage = oxygen.atoms.find {|a| a.el != :c }
+ appendage = oxygen.atoms.find {|a| a.el != :C }
if oxygen.charge != 0
ocharge = oxygen.charge
end
nmol = self.dup
new_oxygen = nmol.atom(oxygen.id)
@@ -102,10 +102,10 @@
fragment_sets = []
if opts[:rules].any? {|r| [:cod, :codoo].include?(r) }
self.each_match("C[O;h1,O]", only_uniqs) do |carbon, oxygen|
- carbon.atoms.select {|a| a.el == :c }.each do |carbon_nbr|
+ carbon.atoms.select {|a| a.el == :C }.each do |carbon_nbr|
fragment_sets << carbonyl_oxygen_dump(carbon, oxygen, carbon_nbr)
end
end
end
if opts[:rules].any? {|r| [:oxe].include?(r) }