From 4bbdb9dea70ba555709983c0a8557fa28f0a09a0 Mon Sep 17 00:00:00 2001 From: Leandro Martinez Date: Tue, 3 Oct 2023 11:36:36 -0300 Subject: [PATCH] change some names --- src/Selection.jl | 3 ++- src/results.jl | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/Selection.jl b/src/Selection.jl index 83a968a1..2e17e8ba 100644 --- a/src/Selection.jl +++ b/src/Selection.jl @@ -13,7 +13,8 @@ struct Selection natomspermol::Int # Number of atoms per molecule index::Vector{Int} # Index of each atom in the full vector of coordinates imol::Vector{Int} # index of the molecule to which each atom belongs - names::Vector{String} # Types of the atoms, to be used in the atom-contributions + groups::Vector{Vector{Int}} + group_names::Vector{String} # Types of the atoms, to be used in the atom-contributions end # Initialize providing the file name, and calling by default PDBTools.select diff --git a/src/results.jl b/src/results.jl index 371c010a..eb8173f7 100644 --- a/src/results.jl +++ b/src/results.jl @@ -116,8 +116,8 @@ The Result{Vector{Float64}} parametric type is necessary only for reading the JS solute::SolSummary # Atomic contributions to the MDDFs - solute_atom::T = zeros(nbins, solute.natomspermol) - solvent_atom::T = zeros(nbins, solvent.natomspermol) + solute_group_contributions = zeros(nbins, solute.ngroups) + solvent_group_contributions = zeros(nbins, solvent.ngroups) # Data to compute a RDF and the KB integral from this count rdf_count::Vector{Float64} = zeros(nbins) @@ -718,13 +718,13 @@ If the solute and solvent selections are provides, pass on the atom names. """ write(R::Result, filename::String, solute::Selection, solvent::Selection) = - write(R, filename, solute_names = solute.names, solvent_names = solvent.names) + write(R, filename, solute_group_names = solute.names, solvent_group_names = solvent.group_names) """ write(R::ComplexMixtures.Result, filename::String; - solute_names::Vector{String} = ["nothing"], - solvent_names::Vector{String} = ["nothing"]) + solute_group_names::Vector{String} = ["nothing"], + solvent_group_names::Vector{String} = ["nothing"]) Optional passing of atom names. @@ -732,8 +732,8 @@ Optional passing of atom names. function write( R::Result, filename::String; - solute_names::Vector{String} = ["nothing"], - solvent_names::Vector{String} = ["nothing"], + solute_group_names::Vector{String} = ["nothing"], + solvent_group_names::Vector{String} = ["nothing"], ) # Names of output files containing atomic contibutions @@ -809,20 +809,20 @@ function write( # Writting gmd per atom contributions for the solvent - open(atom_contributions_solvent, "w") do output + open(group_contributions_solvent, "w") do output println(output, """ - # Solvent atomic contributions to total MDDF. + # Solvent group contributions to total MDDF. # # Trajectory files: $(R.files) # # Atoms: """) for i = 1:size(R.solvent_atom, 2) - if solvent_names[1] == "nothing" + if solvent_group_names[1] == "nothing" println(output, @sprintf("# %9i", i)) else - println(output, @sprintf("# %9i %5s", i, solvent_names[i])) + println(output, @sprintf("# %9i %5s", i, solvent_group_names[i])) end end println(output, "#") @@ -853,10 +853,10 @@ function write( # Atoms """) for i = 1:size(R.solute_atom, 2) - if solute_names[1] == "nothing" + if solute_group_names[1] == "nothing" println(output, @sprintf("# %9i", i)) else - println(output, @sprintf("# %9i %5s", i, solute_names[i])) + println(output, @sprintf("# %9i %5s", i, solute_group_names[i])) end end println(output, "#")