-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathexample_descriptor_molecule_name.cpp
More file actions
93 lines (74 loc) · 2.97 KB
/
Copy pathexample_descriptor_molecule_name.cpp
File metadata and controls
93 lines (74 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// (c) Copyright BCL @ Vanderbilt University 2014
// (c) BCL Homepage: http://www.meilerlab.org/bclcommons
// (c) BCL Code Repository: https://github.com/BCLCommons/bcl
// (c)
// (c) The BioChemical Library (BCL) was originally developed by contributing members of the Meiler Lab @ Vanderbilt University.
// (c)
// (c) The BCL is now made available as an open-source software package distributed under the permissive MIT license,
// (c) developed and maintained by the Meiler Lab at Vanderbilt University and contributing members of the BCL Commons.
// (c)
// (c) External code contributions to the BCL are welcome. Please visit the BCL Commons GitHub page for information on how you can contribute.
// (c)
// (c) This file is part of the BCL software suite and is made available under the MIT license.
// (c)
// include example header
#include "example.h"
// include the header of the class which this example is for
#include "descriptor/bcl_descriptor_molecule_name.h"
// includes from bcl - sorted alphabetically
#include "chemistry/bcl_chemistry_fragment_ensemble.h"
// external includes - sorted alphabetically
namespace bcl
{
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//!
//! @example example_descriptor_molecule_name.cpp
//!
//! @author kothiwsk
//! @date Feb 17, 2014
//! @remarks status complete
//! @remarks reviewed by nobody on
//!
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class ExampleDescriptorMoleculeName :
public ExampleInterface
{
public:
ExampleDescriptorMoleculeName *Clone() const
{
return new ExampleDescriptorMoleculeName( *this);
}
/////////////////
// data access //
/////////////////
//! @brief returns class name
//! @return the class name as const ref std::string
const std::string &GetClassIdentifier() const
{
return GetStaticClassName( *this);
}
int Run() const
{
// create a property that retrieves the name
descriptor::CheminfoID name_retriever( "Name");
const std::string test_name( " test name");
chemistry::FragmentComplete fragment_with_name( chemistry::AtomVector< chemistry::AtomComplete>(), test_name);
// ensure that each is defined
BCL_ExampleAssert( name_retriever.IsDefined(), true);
// check the descriptor string
BCL_ExampleCheck( name_retriever.GetString(), "Name(size=240)");
// try each out on a small molecule
BCL_ExampleCheck
(
std::string ( name_retriever->SumOverObject( fragment_with_name).Begin()),
util::TrimString( fragment_with_name.GetName())
);
return 0;
} // Run
static const ExampleClass::EnumType s_Instance;
}; //end ExampleDescriptorMoleculeName
const ExampleClass::EnumType ExampleDescriptorMoleculeName::s_Instance
(
GetExamples().AddEnum( ExampleDescriptorMoleculeName())
);
} // namespace bcl