Skip to content
Snippets Groups Projects
Commit c15cafa7 authored by Marco Biasini's avatar Marco Biasini
Browse files

Merge hotfix-1.3.1 into develop

parents d7bd83bf f6c3a5e7
Branches
Tags
No related merge requests found
......@@ -26,6 +26,9 @@ Changes In Release 1.3.0
* Update directory layout of OST to be more conformant with the site-package
system of Python: Instead of storing the modules in lib{64}/ost/ost, they
are now in lib{64}/python{{VERSION}}/site-packages/ost
* Added molck, the molecular checker. A small command-line tool to clean PDB
files, e.g. remove atoms with zero occupancy, "virtual atoms", hydrogens
etc.
Changes In Release 1.2.3
--------------------------------------------------------------------------------
......
......@@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR)
project(OpenStructure CXX C)
set (OST_VERSION_MAJOR 1)
set (OST_VERSION_MINOR 3)
set (OST_VERSION_PATCH 0)
set (OST_VERSION_PATCH 1)
set (OST_VERSION_STRING ${OST_VERSION_MAJOR}.${OST_VERSION_MINOR}.${OST_VERSION_PATCH} )
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake_support)
include(OST)
......
......@@ -37,6 +37,16 @@ String BFPathToString(const boost::filesystem::path& path)
#endif
}
inline String BFPathStem(const boost::filesystem::path& path) {
#if BOOST_FILESYSTEM_VERSION<103400
String name = BFPathToString(path);
size_t n = name.rfind('.');
return name.substr(0, n);
#else
return path.stem();
#endif
}
}
......
......@@ -215,4 +215,6 @@ void export_EntityView()
class_<EntityViewList>("EntityViewList", init<>())
.def(vector_indexing_suite<EntityViewList>())
;
to_python_converter<std::pair<EntityView, EntityView>,
PairToTupleConverter<EntityView, EntityView> >();
}
......@@ -208,9 +208,13 @@ void EditorBase::RenumberAllResidues(int start, bool keep_spacing)
ent_.Impl()->RenumberAllResidues(start, keep_spacing);
}
void EditorBase::RenumberChain(const String& name, int start, bool keep_spacing)
void EditorBase::RenumberChain(const ChainHandle& chain, int start, bool keep_spacing)
{
ent_.Impl()->RenumberChain(name, start, keep_spacing);
CheckHandleValidity(chain);
if(chain.GetEntity()!=ent_){
throw Error("Chain does not belong to the editors entity!");
}
chain.Impl()->RenumberAllResidues(start, keep_spacing);
}
void EditorBase::RenameAtom(AtomHandle atom, const String& new_name)
......
......@@ -293,7 +293,7 @@ public:
/// \param keep_spacing
/// If set to false, residues will continously be renumbered ongoing from start.
/// Otherwise the spacings between the residues are kept.
void RenumberChain(const String& name, int start, bool keep_spacing);
void RenumberChain(const ChainHandle& chain, int start, bool keep_spacing);
/// \brief Get edit mode of editor
EditMode GetMode() const {return mode_;}
......
......@@ -98,6 +98,15 @@ inline void DLLEXPORT StoreStrAsAln(String& aln_str1, String& aln_str2,
AlignmentHandle aln=CreateAlignment();
aln.AddSequence(CreateSequence(s1.GetName(), aln_str1));
aln.AddSequence(CreateSequence(s2.GetName(), aln_str2));
if (s1.GetAttachedView()) {
aln.AttachView(0, s1.GetAttachedView());
}
if (s2.GetAttachedView()) {
aln.AttachView(1, s2.GetAttachedView());
}
aln.SetSequenceOffset(0, i);
aln.SetSequenceOffset(1, j);
alignments.push_back(aln);
......
......@@ -80,6 +80,9 @@ ConstSequenceList do_slice_a(ConstSequenceList& t, slice sl)
{
return do_slice<ConstSequenceList>(t, sl);
}
String aln_to_str(const AlignmentHandle& aln) {
return aln.ToString();
}
SequenceList do_slice_b(SequenceList& t, slice sl)
{
......@@ -334,9 +337,6 @@ void export_sequence()
class_<SeqListIter>("SeqListIter", no_init)
.def("next", &SeqListIter::next)
;
to_python_converter<std::pair<mol::EntityView, mol::EntityView>,
PairToTupleConverter<mol::EntityView, mol::EntityView> >();
class_<AlignmentHandle>("AlignmentHandle", init<>())
.def("GetCount", &AlignmentHandle::GetCount)
.add_property("sequence_count", &AlignmentHandle::GetCount)
......@@ -345,10 +345,13 @@ void export_sequence()
.def("GetResidueIndex", &AlignmentHandle::GetResidueIndex)
.def("GetResidue", &AlignmentHandle::GetResidue)
.def("AddSequence", &AlignmentHandle::AddSequence)
.def("GetMatchingBackboneViews", &AlignmentHandle::GetMatchingBackboneViews,
(arg("idx_a")=0, arg("idx_b")=1))
.def("FindSequence", &AlignmentHandle::FindSequence)
.def("FindSequenceIndex", &AlignmentHandle::FindSequenceIndex)
.def("Copy", &AlignmentHandle::Copy)
.def("ToString", &AlignmentHandle::ToString)
.def("ToString", &AlignmentHandle::ToString, (arg("width")=80))
.def("__str__", aln_to_str)
.def("GetLength", &AlignmentHandle::GetLength)
.def("__len__", &AlignmentHandle::GetLength)
.def("GetSequences", &AlignmentHandle::GetSequences)
......
......@@ -41,7 +41,9 @@ SequenceHandle SequenceFromChain(const String& name,
e=residues.end(); i!=e; ++i) {
sequence+=(*i).GetOneLetterCode();
}
return CreateSequence(name, sequence);
SequenceHandle s = CreateSequence(name, sequence);
s.AttachView(chain.Select(""));
return s;
}
......@@ -54,7 +56,9 @@ SequenceHandle SequenceFromChain(const String& name,
e=chain.GetResidueList().end(); i!=e; ++i) {
sequence+=(*i).GetOneLetterCode();
}
return CreateSequence(name, sequence);
SequenceHandle s = CreateSequence(name, sequence);
s.AttachView(chain.Select(""));
return s;
}
}}
......@@ -370,7 +370,7 @@ int main(int argc, char *argv[])
}
if (write_to_file) {
fs::path input_file_path(files[i]);
fs::path input_filename = input_file_path.stem();
fs::path input_filename = BFPathStem(input_file_path);
String input_filename_string=BFPathToString(input_filename);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment