seqid_doc.cpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:5k
- /*
- * ===========================================================================
- * PRODUCTION $Log: seqid_doc.cpp,v $
- * PRODUCTION Revision 1000.3 2004/06/01 20:44:40 gouriano
- * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.12
- * PRODUCTION
- * ===========================================================================
- */
- /* $Id: seqid_doc.cpp,v 1000.3 2004/06/01 20:44:40 gouriano Exp $
- * ===========================================================================
- *
- * PUBLIC DOMAIN NOTICE
- * National Center for Biotechnology Information
- *
- * This software/database is a "United States Government Work" under the
- * terms of the United States Copyright Act. It was written as part of
- * the author's official duties as a United States Government employee and
- * thus cannot be copyrighted. This software/database is freely available
- * to the public for use. The National Library of Medicine and the U.S.
- * Government have not placed any restriction on its use or reproduction.
- *
- * Although all reasonable efforts have been taken to ensure the accuracy
- * and reliability of the software and data, the NLM and the U.S.
- * Government do not and cannot warrant the performance or results that
- * may be obtained by using this software or data. The NLM and the U.S.
- * Government disclaim all warranties, express or implied, including
- * warranties of performance, merchantability or fitness for any particular
- * purpose.
- *
- * Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- * Authors: Mike DiCuccio
- *
- * File Description:
- * CSeqIdDocument -- document specific for sequence data
- */
- #include <ncbi_pch.hpp>
- #include "seqid_doc.hpp"
- #include <gui/plugin/PluginValue.hpp>
- #include <objmgr/scope.hpp>
- #include <objmgr/util/sequence.hpp>
- #include <objects/seqset/Seq_entry.hpp>
- #include <objects/seqloc/Seq_id.hpp>
- #include <serial/serial.hpp>
- #include <serial/objostr.hpp>
- BEGIN_NCBI_SCOPE
- CSeqIdDocument::CSeqIdDocument(CScope& scope, const CSeq_id& id)
- {
- m_Scope.Reset(&scope);
- m_Id.Reset(const_cast<CSeq_id*> (&id));
- CBioseq_Handle handle = m_Scope->GetBioseqHandle(*m_Id);
- const CSeq_id& best_id = sequence::GetId(handle, sequence::eGetId_Best);
- best_id.GetLabel(&m_ShortTitle);
- m_Title = m_ShortTitle + ": " + sequence::GetTitle(handle);
- }
- CSeqIdDocument::~CSeqIdDocument()
- {
- }
- // serialization: write our contents to a stream
- void CSeqIdDocument::Write(CObjectOStream& os) const
- {
- if ( !m_Scope || !m_Id ) {
- return;
- }
- CBioseq_Handle handle = m_Scope->GetBioseqHandle(*m_Id);
- os << handle.GetTopLevelSeqEntry();
- }
- END_NCBI_SCOPE
- /*
- * ===========================================================================
- * $Log: seqid_doc.cpp,v $
- * Revision 1000.3 2004/06/01 20:44:40 gouriano
- * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.12
- *
- * Revision 1.12 2004/05/21 22:27:40 gorelenk
- * Added PCH ncbi_pch.hpp
- *
- * Revision 1.11 2004/03/05 17:29:59 dicuccio
- * Use sequence::GetId() instead of CSeq_id::GetStringDescr()
- *
- * Revision 1.10 2003/11/04 17:20:18 dicuccio
- * Removed unnecessary #includes
- *
- * Revision 1.9 2003/11/04 12:44:09 friedman
- * Explicit destructor added
- *
- * Revision 1.8 2003/10/07 13:36:09 dicuccio
- * Renamed CPluginURL* to CPluginValue*. Moved validation code into CPluginUtils
- *
- * Revision 1.7 2003/07/19 00:41:38 dicuccio
- * Removed dead includes. Changed encoding for long title to include accession
- *
- * Revision 1.6 2003/06/25 17:02:54 dicuccio
- * Split CPluginHandle into a handle (pointer-to-implementation) and
- * implementation file. Lots of #include file clean-ups.
- *
- * Revision 1.5 2003/06/02 16:06:18 dicuccio
- * Rearranged src/objects/ subtree. This includes the following shifts:
- * - src/objects/asn2asn --> arc/app/asn2asn
- * - src/objects/testmedline --> src/objects/ncbimime/test
- * - src/objects/objmgr --> src/objmgr
- * - src/objects/util --> src/objmgr/util
- * - src/objects/alnmgr --> src/objtools/alnmgr
- * - src/objects/flat --> src/objtools/flat
- * - src/objects/validator --> src/objtools/validator
- * - src/objects/cddalignview --> src/objtools/cddalignview
- * In addition, libseq now includes six of the objects/seq... libs, and libmmdb
- * replaces the three libmmdb? libs.
- *
- * Revision 1.4 2003/05/19 13:35:59 dicuccio
- * Moved gui/core/plugin/ -> gui/plugin/. Merged gui/core/algo, gui/core/doc/,
- * and gui/core/view/ into one library (gui/core/)
- *
- * Revision 1.3 2003/04/29 14:46:09 dicuccio
- * Removed last vestiges of old typing system
- *
- * Revision 1.2 2003/04/24 19:40:57 ucko
- * Fix capitalization of seqid_doc.hpp.
- *
- * Revision 1.1 2003/04/24 16:25:00 dicuccio
- * Initial revision
- *
- * ===========================================================================
- */