From 0d6c6b879a31c2e90996d2c7727c61fe24ea2fe3 Mon Sep 17 00:00:00 2001 From: Marco Biasini <marco.biasini@unibas.ch> Date: Mon, 18 Oct 2010 13:49:54 +0200 Subject: [PATCH] Revert "make AttachView stricter" --- modules/seq/base/doc/seq.rst | 6 ------ modules/seq/base/src/impl/sequence_impl.cc | 22 +++------------------- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/modules/seq/base/doc/seq.rst b/modules/seq/base/doc/seq.rst index 7a849093b..243ec0d49 100644 --- a/modules/seq/base/doc/seq.rst +++ b/modules/seq/base/doc/seq.rst @@ -322,12 +322,6 @@ an alignment: Attach the given view to the sequence at index `seq_index`. - The method now checks for agreement of the one letter code in the structure - and the character in the sequence. If there is a mismatch, AttachView throws - an IntegrityError telling you where in the sequence the problem was - detected. The one letter code of the residue and the character in the - sequence agree, if either one of the is X or they are identical. - .. method:: Cut(start, end) Removes the columns in the half-closed interval `start`, `end` from the diff --git a/modules/seq/base/src/impl/sequence_impl.cc b/modules/seq/base/src/impl/sequence_impl.cc index 15fc8f986..a99ea9b63 100644 --- a/modules/seq/base/src/impl/sequence_impl.cc +++ b/modules/seq/base/src/impl/sequence_impl.cc @@ -233,26 +233,10 @@ mol::EntityView SequenceImpl::GetAttachedView() const void SequenceImpl::AttachView(const mol::EntityView& view) { - static const char* msg_1="Expected 1 chain, but %d chains found"; - if (view.IsValid() && view.GetChainCount()!=1) { - throw IntegrityError(str(format(msg_1) % view.GetChainCount())); - } + static const char* msg="Expected 1 chain, but %d chains found"; attached_view_=view; - if (!attached_view_.IsValid()) { - return; - } - for (size_t i=0; i<seq_string_.size(); ++i) { - if (mol::ResidueView res=this->GetResidue(i)) { - char olc1=res.GetOneLetterCode(); - char olc2=seq_string_[i]; - if (olc1!='X' && olc2!='X' && olc1!=olc2) { - std::stringstream ss; - ss << "One letter code of residue and sequence does not agree " - "at position " << i << " in sequence (" << res.GetOneLetterCode() - << "!=" << seq_string_[i] << ")"; - throw IntegrityError(ss.str()); - } - } + if (view.IsValid() && attached_view_.GetChainCount()!=1) { + throw IntegrityError(str(format(msg) % attached_view_.GetChainCount())); } } -- GitLab