Skip to content

Commit

Permalink
Avoid using species as Species doesn't work in rmgmolecule
Browse files Browse the repository at this point in the history
  • Loading branch information
hwpang committed Oct 14, 2023
1 parent 2ad8713 commit 1bbc02e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/Parse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,12 @@ export getatomdictsmiles
getatomdictinchi(inchi) = getatomdictfromrdkit(Chem.AddHs(Chem.MolFromInchi(inchi)))
export getatomdictinchi
function getatomdictadjlist(adjlist)
mol = species.Species().from_adjacency_list(adjlist).molecule[1]
_ , cutting_label_list = fragment.Fragment().detect_cutting_label(adjlist)
if isempty(cutting_label_list)
mol = molecule.Molecule().from_adjacency_list(adjlist)
else
mol = fragment.Fragment().from_adjacency_list(adjlist)
end
if pybuiltin(:isinstance)(mol, molecule.Molecule)
getatomdictfromrmg(mol)
elseif pybuiltin(:isinstance)(mol, fragment.Fragment)
Expand Down
7 changes: 6 additions & 1 deletion src/fluxdiagrams.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ function drawspc(spc::Species,path::String=".")
end
end
if spc.adjlist != ""
mol = species.Species().from_adjacency_list(spc.adjlist).molecule[1]
_ , cutting_label_list = fragment.Fragment().detect_cutting_label(spc.adjlist)
if isempty(cutting_label_list)
mol = molecule.Molecule().from_adjacency_list(spc.adjlist)
else
mol = fragment.Fragment().from_adjacency_list(spc.adjlist)
end
elseif spc.inchi != ""
mol = molecule.Molecule().from_inchi(spc.inchi)
elseif spc.smiles != ""
Expand Down
2 changes: 0 additions & 2 deletions src/rmstest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ const pydot = PyNULL()
copy!(Chem,pyimport_conda("rdkit.Chem","rdkit","rmg"))
try
copy!(molecule, pyimport("rmgpy.molecule"))
copy!(species, pyimport("rmgpy.species"))
copy!(fragment, pyimport("rmgpy.molecule.fragment"))
catch e
copy!(molecule, pyimport_conda("molecule.molecule", "rmgmolecule", "hwpang"))
copy!(species, pyimport_conda("molecule.species", "rmgmolecule", "hwpang"))
copy!(fragment, pyimport_conda("molecule.molecule.fragment", "rmgmolecule", "hwpang"))
end
copy!(pydot,pyimport_conda("pydot","pydot","rmg"))
Expand Down

0 comments on commit 1bbc02e

Please sign in to comment.