Replacement for g_bond and g_dist.
authorTeemu Murtola <teemu.murtola@gmail.com>
Wed, 14 Aug 2013 18:21:03 +0000 (21:21 +0300)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Fri, 16 Aug 2013 19:03:17 +0000 (21:03 +0200)
Added a proper implementation for the 'distance' tool.
It should now do most of what g_bond or g_dist can do.
The help text related to the distance histogramming is somewhat
different from g_bond, but the behavior is more or less the same; now
the help text just describes how it is actually implemented.

The main things missing are proper legends in the output files, some
statistics output (g_bond), and g_dist -dist and g_dist -lt.
g_dist -dist can already be done with g_select, and g_dist -lt also
makes most sense to implement separately into g_select instead.

Part of #665.

Change-Id: I293cf8f0d30480e1873d5dcdef414f0089f177a6

src/gromacs/trajectoryanalysis/modules/distance.cpp
src/gromacs/trajectoryanalysis/modules/distance.h
src/gromacs/trajectoryanalysis/tests/CMakeLists.txt
src/gromacs/trajectoryanalysis/tests/distance.cpp [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/DistanceModuleTest_ComputesDistances.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/DistanceModuleTest_ComputesMultipleDistances.xml [new file with mode: 0644]

index 0cec0fa583c97c10abcc67f613f7aeac4e02a14a..bc5c7a1e758e6fdbce4e316c3638b5eb8a5a1969 100644 (file)
@@ -63,14 +63,21 @@ namespace analysismodules
 
 const char Distance::name[]             = "distance";
 const char Distance::shortDescription[] =
-    "Calculate distances";
+    "Calculate distances between pairs of positions";
 
 Distance::Distance()
     : TrajectoryAnalysisModule(name, shortDescription),
-      avem_(new AnalysisDataAverageModule())
+      meanLength_(0.1), lengthDev_(1.0), binWidth_(0.001)
 {
-    data_.setColumnCount(0, 4);
-    registerAnalysisDataset(&data_, "distance");
+    averageModule_.reset(new AnalysisDataFrameAverageModule());
+    distances_.addModule(averageModule_);
+    histogramModule_.reset(new AnalysisDataSimpleHistogramModule());
+    distances_.addModule(histogramModule_);
+
+    registerAnalysisDataset(&distances_, "dist");
+    registerAnalysisDataset(&xyz_, "xyz");
+    registerBasicDataset(averageModule_.get(), "average");
+    registerBasicDataset(&histogramModule_->averager(), "histogram");
 }
 
 
@@ -83,42 +90,143 @@ void
 Distance::initOptions(Options *options, TrajectoryAnalysisSettings * /*settings*/)
 {
     static const char *const desc[] = {
-        "g_dist can calculate the distance between two positions as",
-        "a function of time. The total distance and its",
-        "x, y and z components are plotted."
+        "[TT]gmx distance[tt] calculates distances between pairs of positions",
+        "as a function of time. Each selection specifies an independent set",
+        "of distances to calculate. Each selection should consist of pairs",
+        "of positions, and the distances are computed between positions 1-2,",
+        "3-4, etc.[PAR]",
+        "[TT]-oav[tt] writes the average distance as a function of time for",
+        "each selection.",
+        "[TT]-oall[tt] writes all the individual distances.",
+        "[TT]-oxyz[tt] does the same, but the x, y, and z components of the",
+        "distance are written instead of the norm.",
+        "[TT]-oh[tt] writes a histogram of the distances for each selection.",
+        "The location of the histogram is set with [TT]-len[tt] and",
+        "[TT]-tol[tt]. Bin width is set with [TT]-binw[tt].",
     };
 
     options->setDescription(concatenateStrings(desc));
 
-    options->addOption(FileNameOption("o").filetype(eftPlot).outputFile()
-                           .store(&fnDist_).defaultBasename("dist")
-                           .description("Computed distances"));
-    options->addOption(SelectionOption("select").required().valueCount(2)
-                           .store(sel_));
+    options->addOption(FileNameOption("oav").filetype(eftPlot).outputFile()
+                           .store(&fnAverage_).defaultBasename("distave")
+                           .description("Average distances as function of time"));
+    options->addOption(FileNameOption("oall").filetype(eftPlot).outputFile()
+                           .store(&fnAll_).defaultBasename("dist")
+                           .description("All distances as function of time"));
+    options->addOption(FileNameOption("oxyz").filetype(eftPlot).outputFile()
+                           .store(&fnXYZ_).defaultBasename("distxyz")
+                           .description("Distance components as function of time"));
+    options->addOption(FileNameOption("oh").filetype(eftPlot).outputFile()
+                           .store(&fnHistogram_).defaultBasename("disthist")
+                           .description("Histogram of the distances"));
+    // TODO: Consider what is the best way to support dynamic selections.
+    // Again, most of the code already supports it, but it needs to be
+    // considered how should -oall work, and additional checks should be added.
+    options->addOption(SelectionOption("select").storeVector(&sel_)
+                           .required().onlyStatic().multiValue()
+                           .description("Position pairs to calculate distances for"));
+    // TODO: Extend the histogramming implementation to allow automatic
+    // extension of the histograms to cover the data, removing the need for
+    // the first two options.
+    options->addOption(DoubleOption("len").store(&meanLength_)
+                           .description("Mean distance for histogramming"));
+    options->addOption(DoubleOption("tol").store(&lengthDev_)
+                           .description("Width of full distribution as fraction of [TT]-len[tt]"));
+    options->addOption(DoubleOption("binw").store(&binWidth_)
+                           .description("Bin width for histogramming"));
 }
 
 
+namespace
+{
+
+/*! \brief
+ * Checks that selections conform to the expectations of the tool.
+ */
+void checkSelections(const SelectionList &sel)
+{
+    for (size_t g = 0; g < sel.size(); ++g)
+    {
+        if (sel[g].posCount() % 2 != 0)
+        {
+            std::string message = formatString(
+                        "Selection '%s' does not evaluate into an even number of positions "
+                        "(there are %d positions)",
+                        sel[g].name(), sel[g].posCount());
+            GMX_THROW(InconsistentInputError(message));
+        }
+    }
+}
+
+}       // namespace
+
+
 void
 Distance::initAnalysis(const TrajectoryAnalysisSettings &settings,
                        const TopologyInformation         & /*top*/)
 {
-    if (sel_[0].posCount() != 1)
+    checkSelections(sel_);
+
+    distances_.setDataSetCount(sel_.size());
+    xyz_.setDataSetCount(sel_.size());
+    for (size_t i = 0; i < sel_.size(); ++i)
     {
-        GMX_THROW(InvalidInputError("The first selection does not define a single position"));
+        const int distCount = sel_[i].posCount() / 2;
+        distances_.setColumnCount(i, distCount);
+        xyz_.setColumnCount(i, distCount * 3);
     }
-    if (sel_[1].posCount() != 1)
+    const double histogramMin = (1.0 - lengthDev_) * meanLength_;
+    const double histogramMax = (1.0 + lengthDev_) * meanLength_;
+    histogramModule_->init(histogramFromRange(histogramMin, histogramMax)
+                               .binWidth(binWidth_).includeAll());
+
+    if (!fnAverage_.empty())
     {
-        GMX_THROW(InvalidInputError("The second selection does not define a single position"));
+        AnalysisDataPlotModulePointer plotm(
+                new AnalysisDataPlotModule(settings.plotSettings()));
+        plotm->setFileName(fnAverage_);
+        plotm->setTitle("Average distance");
+        plotm->setXAxisIsTime();
+        plotm->setYLabel("Distance (nm)");
+        // TODO: Add legends
+        averageModule_->addModule(plotm);
     }
 
-    data_.addModule(avem_);
-    AnalysisDataPlotModulePointer plotm_(new AnalysisDataPlotModule());
-    plotm_->setSettings(settings.plotSettings());
-    plotm_->setFileName(fnDist_);
-    plotm_->setTitle("Distance");
-    plotm_->setXAxisIsTime();
-    plotm_->setYLabel("Distance (nm)");
-    data_.addModule(plotm_);
+    if (!fnAll_.empty())
+    {
+        AnalysisDataPlotModulePointer plotm(
+                new AnalysisDataPlotModule(settings.plotSettings()));
+        plotm->setFileName(fnAll_);
+        plotm->setTitle("Distance");
+        plotm->setXAxisIsTime();
+        plotm->setYLabel("Distance (nm)");
+        // TODO: Add legends? (there can be a massive amount of columns)
+        distances_.addModule(plotm);
+    }
+
+    if (!fnXYZ_.empty())
+    {
+        AnalysisDataPlotModulePointer plotm(
+                new AnalysisDataPlotModule(settings.plotSettings()));
+        plotm->setFileName(fnAll_);
+        plotm->setTitle("Distance");
+        plotm->setXAxisIsTime();
+        plotm->setYLabel("Distance (nm)");
+        // TODO: Add legends? (there can be a massive amount of columns)
+        xyz_.addModule(plotm);
+    }
+
+    if (!fnHistogram_.empty())
+    {
+        AnalysisDataPlotModulePointer plotm(
+                new AnalysisDataPlotModule(settings.plotSettings()));
+        plotm->setFileName(fnHistogram_);
+        plotm->setTitle("Distance histogram");
+        plotm->setXLabel("Distance (nm)");
+        plotm->setYLabel("Probability");
+        // TODO: Add legends
+        histogramModule_->averager().addModule(plotm);
+    }
 }
 
 
@@ -126,41 +234,56 @@ void
 Distance::analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
                        TrajectoryAnalysisModuleData *pdata)
 {
-    AnalysisDataHandle       dh   = pdata->dataHandle(data_);
-    const Selection         &sel1 = pdata->parallelSelection(sel_[0]);
-    const Selection         &sel2 = pdata->parallelSelection(sel_[1]);
-    rvec                     dx;
-    real                     r;
-    const SelectionPosition &p1 = sel1.position(0);
-    const SelectionPosition &p2 = sel2.position(0);
-
-    if (pbc != NULL)
-    {
-        pbc_dx(pbc, p1.x(), p2.x(), dx);
-    }
-    else
+    AnalysisDataHandle   distHandle = pdata->dataHandle(distances_);
+    AnalysisDataHandle   xyzHandle  = pdata->dataHandle(xyz_);
+    const SelectionList &sel        = pdata->parallelSelections(sel_);
+
+    checkSelections(sel);
+
+    distHandle.startFrame(frnr, fr.time);
+    xyzHandle.startFrame(frnr, fr.time);
+    for (size_t g = 0; g < sel.size(); ++g)
     {
-        rvec_sub(p1.x(), p2.x(), dx);
+        distHandle.selectDataSet(g);
+        xyzHandle.selectDataSet(g);
+        for (int i = 0, n = 0; i < sel[g].posCount(); i += 2, ++n)
+        {
+            const SelectionPosition &p1 = sel[g].position(i);
+            const SelectionPosition &p2 = sel[g].position(i+1);
+            rvec                     dx;
+            if (pbc != NULL)
+            {
+                pbc_dx(pbc, p2.x(), p1.x(), dx);
+            }
+            else
+            {
+                rvec_sub(p2.x(), p1.x(), dx);
+            }
+            real dist = norm(dx);
+            distHandle.setPoint(n, dist);
+            xyzHandle.setPoints(n*3, 3, dx);
+        }
     }
-    r = norm(dx);
-    dh.startFrame(frnr, fr.time);
-    dh.setPoint(0, r);
-    dh.setPoints(1, 3, dx);
-    dh.finishFrame();
+    distHandle.finishFrame();
+    xyzHandle.finishFrame();
 }
 
 
 void
 Distance::finishAnalysis(int /*nframes*/)
 {
+    AbstractAverageHistogram &averageHistogram = histogramModule_->averager();
+    averageHistogram.normalizeProbability();
+    averageHistogram.done();
 }
 
 
 void
 Distance::writeOutput()
 {
-    fprintf(stderr, "Average distance: %f\n", avem_->average(0));
-    fprintf(stderr, "Std. deviation:   %f\n", avem_->stddev(0));
+    // TODO: Print bond length statistics
+    //fprintf(stderr, "Average distance: %f\n", avem_->average(0));
+    //fprintf(stderr, "Std. deviation:   %f\n", avem_->stddev(0));
 }
 
 } // namespace analysismodules
index 6fa5003ca675661f4e203ae02f394219e9f591de..309a61965bcd8098422b9eb35d33062724d1756d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
  * David van der Spoel, Berk Hess, Erik Lindahl, and including many
  * others, as listed in the AUTHORS file in the top-level source
  * directory and at http://www.gromacs.org.
@@ -47,6 +47,7 @@
 #include "../analysismodule.h"
 #include "gromacs/analysisdata/analysisdata.h"
 #include "gromacs/analysisdata/modules/average.h"
+#include "gromacs/analysisdata/modules/histogram.h"
 #include "gromacs/selection/selection.h"
 
 namespace gmx
@@ -76,10 +77,19 @@ class Distance : public TrajectoryAnalysisModule
         virtual void writeOutput();
 
     private:
-        std::string                      fnDist_;
-        Selection                        sel_[2];
-        AnalysisData                     data_;
-        AnalysisDataAverageModulePointer avem_;
+        SelectionList                            sel_;
+        std::string                              fnAverage_;
+        std::string                              fnAll_;
+        std::string                              fnXYZ_;
+        std::string                              fnHistogram_;
+        double                                   meanLength_;
+        double                                   lengthDev_;
+        double                                   binWidth_;
+
+        AnalysisData                             distances_;
+        AnalysisData                             xyz_;
+        AnalysisDataFrameAverageModulePointer    averageModule_;
+        AnalysisDataSimpleHistogramModulePointer histogramModule_;
 
         // Copy and assign disallowed by base.
 };
index ccf7b856078e25e133dbbbeae9a4527f9c5be9a1..bdfc20271c467a68386c442457a324f26c051cc4 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2010,2012, by the GROMACS development team, led by
+# Copyright (c) 2010,2012,2013, by the GROMACS development team, led by
 # David van der Spoel, Berk Hess, Erik Lindahl, and including many
 # others, as listed in the AUTHORS file in the top-level source
 # directory and at http://www.gromacs.org.
@@ -35,6 +35,7 @@
 gmx_add_unit_test(TrajectoryAnalysisUnitTests trajectoryanalysis-test
                   moduletest.cpp
                   angle.cpp
+                  distance.cpp
                   freevolume.cpp
                   select.cpp)
 
diff --git a/src/gromacs/trajectoryanalysis/tests/distance.cpp b/src/gromacs/trajectoryanalysis/tests/distance.cpp
new file mode 100644 (file)
index 0000000..0555114
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2013, by the GROMACS development team, led by
+ * David van der Spoel, Berk Hess, Erik Lindahl, and including many
+ * others, as listed in the AUTHORS file in the top-level source
+ * directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ * \brief
+ * Tests for functionality of the "distance" trajectory analysis module.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_trajectoryanalysis
+ */
+#include <gtest/gtest.h>
+
+#include "gromacs/trajectoryanalysis/modules/distance.h"
+
+#include "testutils/cmdlinetest.h"
+
+#include "moduletest.h"
+
+namespace
+{
+
+using gmx::test::CommandLine;
+
+/********************************************************************
+ * Tests for gmx::analysismodules::Distance.
+ */
+
+//! Test fixture for the angle analysis module.
+typedef gmx::test::TrajectoryAnalysisModuleTestFixture<gmx::analysismodules::Distance>
+    DistanceModuleTest;
+
+TEST_F(DistanceModuleTest, ComputesDistances)
+{
+    const char *const cmdline[] = {
+        "distance",
+        "-select", "atomname S1 S2",
+        "-len", "2", "-binw", "0.5"
+    };
+    setTopology("simple.gro");
+    runTest(CommandLine::create(cmdline));
+}
+
+TEST_F(DistanceModuleTest, ComputesMultipleDistances)
+{
+    const char *const cmdline[] = {
+        "distance",
+        "-select", "atomname S1 S2",
+        "resindex 1 to 4 and atomname CB merge resindex 2 to 5 and atomname CB",
+        "-len", "2", "-binw", "0.5"
+    };
+    setTopology("simple.gro");
+    runTest(CommandLine::create(cmdline));
+}
+
+} // namespace
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/DistanceModuleTest_ComputesDistances.xml b/src/gromacs/trajectoryanalysis/tests/refdata/DistanceModuleTest_ComputesDistances.xml
new file mode 100644 (file)
index 0000000..081d2c0
--- /dev/null
@@ -0,0 +1,176 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="CommandLine">distance -select 'atomname S1 S2' -len 2 -binw 0.5</String>
+  <OutputData Name="Data">
+    <AnalysisData Name="average">
+      <DataFrame Name="Frame0">
+        <Real Name="X">0.000000</Real>
+        <DataValues>
+          <Int Name="Count">1</Int>
+          <DataValue>
+            <Real Name="Value">1.432455</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+    </AnalysisData>
+    <AnalysisData Name="dist">
+      <DataFrame Name="Frame0">
+        <Real Name="X">0.000000</Real>
+        <DataValues>
+          <Int Name="Count">5</Int>
+          <DataValue>
+            <Real Name="Value">1.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3.162278</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.000000</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+    </AnalysisData>
+    <AnalysisData Name="histogram">
+      <DataFrame Name="Frame0">
+        <Real Name="X">0.250000</Real>
+        <DataValues>
+          <Int Name="Count">1</Int>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+            <Real Name="Error">0.000000</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+      <DataFrame Name="Frame1">
+        <Real Name="X">0.750000</Real>
+        <DataValues>
+          <Int Name="Count">1</Int>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+            <Real Name="Error">0.000000</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+      <DataFrame Name="Frame2">
+        <Real Name="X">1.250000</Real>
+        <DataValues>
+          <Int Name="Count">1</Int>
+          <DataValue>
+            <Real Name="Value">1.600000</Real>
+            <Real Name="Error">0.000000</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+      <DataFrame Name="Frame3">
+        <Real Name="X">1.750000</Real>
+        <DataValues>
+          <Int Name="Count">1</Int>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+            <Real Name="Error">0.000000</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+      <DataFrame Name="Frame4">
+        <Real Name="X">2.250000</Real>
+        <DataValues>
+          <Int Name="Count">1</Int>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+            <Real Name="Error">0.000000</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+      <DataFrame Name="Frame5">
+        <Real Name="X">2.750000</Real>
+        <DataValues>
+          <Int Name="Count">1</Int>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+            <Real Name="Error">0.000000</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+      <DataFrame Name="Frame6">
+        <Real Name="X">3.250000</Real>
+        <DataValues>
+          <Int Name="Count">1</Int>
+          <DataValue>
+            <Real Name="Value">0.400000</Real>
+            <Real Name="Error">0.000000</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+      <DataFrame Name="Frame7">
+        <Real Name="X">3.750000</Real>
+        <DataValues>
+          <Int Name="Count">1</Int>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+            <Real Name="Error">0.000000</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+    </AnalysisData>
+    <AnalysisData Name="xyz">
+      <DataFrame Name="Frame0">
+        <Real Name="X">0.000000</Real>
+        <DataValues>
+          <Int Name="Count">15</Int>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">-3.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+    </AnalysisData>
+  </OutputData>
+</ReferenceData>
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/DistanceModuleTest_ComputesMultipleDistances.xml b/src/gromacs/trajectoryanalysis/tests/refdata/DistanceModuleTest_ComputesMultipleDistances.xml
new file mode 100644 (file)
index 0000000..cfc29c5
--- /dev/null
@@ -0,0 +1,269 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="CommandLine">distance -select 'atomname S1 S2' 'resindex 1 to 4 and atomname CB merge resindex 2 to 5 and atomname CB' -len 2 -binw 0.5</String>
+  <OutputData Name="Data">
+    <AnalysisData Name="average">
+      <DataFrame Name="Frame0">
+        <Real Name="X">0.000000</Real>
+        <DataValues>
+          <Int Name="Count">2</Int>
+          <DataValue>
+            <Real Name="Value">1.432455</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.810660</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+    </AnalysisData>
+    <AnalysisData Name="dist">
+      <DataFrame Name="Frame0">
+        <Real Name="X">0.000000</Real>
+        <DataValues>
+          <Int Name="Count">5</Int>
+          <Int Name="DataSet">0</Int>
+          <DataValue>
+            <Real Name="Value">1.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3.162278</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.000000</Real>
+          </DataValue>
+        </DataValues>
+        <DataValues>
+          <Int Name="Count">4</Int>
+          <Int Name="DataSet">1</Int>
+          <DataValue>
+            <Real Name="Value">3.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.414214</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.414214</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.414214</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+    </AnalysisData>
+    <AnalysisData Name="histogram">
+      <DataFrame Name="Frame0">
+        <Real Name="X">0.250000</Real>
+        <DataValues>
+          <Int Name="Count">2</Int>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+            <Real Name="Error">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+            <Real Name="Error">0.000000</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+      <DataFrame Name="Frame1">
+        <Real Name="X">0.750000</Real>
+        <DataValues>
+          <Int Name="Count">2</Int>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+            <Real Name="Error">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+            <Real Name="Error">0.000000</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+      <DataFrame Name="Frame2">
+        <Real Name="X">1.250000</Real>
+        <DataValues>
+          <Int Name="Count">2</Int>
+          <DataValue>
+            <Real Name="Value">1.600000</Real>
+            <Real Name="Error">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.500000</Real>
+            <Real Name="Error">0.000000</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+      <DataFrame Name="Frame3">
+        <Real Name="X">1.750000</Real>
+        <DataValues>
+          <Int Name="Count">2</Int>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+            <Real Name="Error">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+            <Real Name="Error">0.000000</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+      <DataFrame Name="Frame4">
+        <Real Name="X">2.250000</Real>
+        <DataValues>
+          <Int Name="Count">2</Int>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+            <Real Name="Error">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+            <Real Name="Error">0.000000</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+      <DataFrame Name="Frame5">
+        <Real Name="X">2.750000</Real>
+        <DataValues>
+          <Int Name="Count">2</Int>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+            <Real Name="Error">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+            <Real Name="Error">0.000000</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+      <DataFrame Name="Frame6">
+        <Real Name="X">3.250000</Real>
+        <DataValues>
+          <Int Name="Count">2</Int>
+          <DataValue>
+            <Real Name="Value">0.400000</Real>
+            <Real Name="Error">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.500000</Real>
+            <Real Name="Error">0.000000</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+      <DataFrame Name="Frame7">
+        <Real Name="X">3.750000</Real>
+        <DataValues>
+          <Int Name="Count">2</Int>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+            <Real Name="Error">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+            <Real Name="Error">0.000000</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+    </AnalysisData>
+    <AnalysisData Name="xyz">
+      <DataFrame Name="Frame0">
+        <Real Name="X">0.000000</Real>
+        <DataValues>
+          <Int Name="Count">15</Int>
+          <Int Name="DataSet">0</Int>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">-3.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+          </DataValue>
+        </DataValues>
+        <DataValues>
+          <Int Name="Count">12</Int>
+          <Int Name="DataSet">1</Int>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">-1.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">-1.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">-1.000000</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0.000000</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+    </AnalysisData>
+  </OutputData>
+</ReferenceData>