Skip to content
Snippets Groups Projects
Commit d0ae487e authored by Ansgar Philippsen's avatar Ansgar Philippsen
Browse files

added a io/mae profiling test

parent 6085483b
No related branches found
No related tags found
No related merge requests found
......@@ -63,7 +63,6 @@ bool Builder::DoesPeptideBondExist(const mol::AtomHandle& n,
bool Builder::IsBondFeasible(const mol::AtomHandle& atom_a,
const mol::AtomHandle& atom_b)
{
Real len=geom::Length2(atom_a.GetPos()-atom_b.GetPos());
Real radii=0.0;
if (atom_a.GetRadius()>0.0) {
radii=atom_a.GetRadius();
......@@ -75,9 +74,9 @@ bool Builder::IsBondFeasible(const mol::AtomHandle& atom_a,
} else {
return false;
}
radii*=0.5;
Real upper_bound=1.5*radii*radii;
Real lower_bound=0.25*radii*radii;
Real len=geom::Length2(atom_a.GetPos()-atom_b.GetPos());
Real lower_bound=radii*radii*0.0625;
Real upper_bound=lower_bound*6.0;
return (len<=upper_bound && len>=lower_bound);
}
......
......@@ -330,14 +330,19 @@ bool EntityIOMAEHandler::ProvidesExport(const boost::filesystem::path& loc,
mol::EntityHandle LoadMAE(const String& file_name)
{
Profile profile_load("LoadMAE");
//conop::BuilderP builder = conop::Conopology::Instance().GetBuilder();
conop::BuilderP builder(new conop::HeuristicBuilder);
MAEReader reader(file_name);
mol::EntityHandle ent=mol::CreateEntity();
mol::XCSEditor editor=ent.EditXCS(mol::BUFFERED_EDIT);
reader.Import(ent);
conop::Conopology::Instance().ConnectAll(builder,ent);
{
Profile profile("import MAE");
reader.Import(ent);
}
{
Profile profile("connect all");
conop::Conopology::Instance().ConnectAll(builder,ent);
}
return ent;
}
......
......@@ -11,4 +11,8 @@ set(OST_IO_UNIT_TESTS
# missing: test_star_parser.cc
ost_unittest(io "${OST_IO_UNIT_TESTS}")
target_link_libraries(io_tests ost_mol)
target_link_libraries(io_tests ost_seq)
\ No newline at end of file
target_link_libraries(io_tests ost_seq)
add_executable(test_mae_standalone test_mae_standalone.cc)
target_link_libraries(test_mae_standalone ost_mol)
target_link_libraries(test_mae_standalone ost_io)
#include <ost/log.hh>
#include <ost/conop/conop.hh>
#include <ost/io/entity_io_mae_handler.hh>
using namespace ost;
int main(int argc, char** argv)
{
if(argc>1) {
mol::EntityHandle eh=io::LoadMAE(argv[1]);
}
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment