NCBI C++ Toolkit Cross Reference

  C++/src/app/streamtest/process_prosplign.hpp


/* * =========================================================================== * * 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. * * =========================================================================== * * Author: * * File Description: * * =========================================================================== */ #ifndef __process_prosplign__hpp__ #define __process_prosplign__hpp__ // ============================================================================ class CProsplignProcess // ============================================================================ : public CScopedProcess { public: // ------------------------------------------------------------------------ CProsplignProcess() // ------------------------------------------------------------------------ : CScopedProcess() , m_out( 0 ) {}; // ------------------------------------------------------------------------ ~CProsplignProcess() // ------------------------------------------------------------------------ { }; // ------------------------------------------------------------------------ void ProcessInitialize( const CArgs& args ) // ------------------------------------------------------------------------ { CScopedProcess::ProcessInitialize( args ); m_out = args["o"] ? &(args["o"].AsOutputFile()) : &cout; }; // ------------------------------------------------------------------------ void ProcessFinalize() // ------------------------------------------------------------------------ { } // ------------------------------------------------------------------------ virtual void SeqEntryInitialize( CRef<CSeq_entry>& se ) // ------------------------------------------------------------------------ { CScopedProcess::SeqEntryInitialize( se ); }; // ------------------------------------------------------------------------ void SeqEntryProcess() // ------------------------------------------------------------------------ { try { CRef<CSeq_loc> nucloc; VISIT_ALL_BIOSEQS_WITHIN_SEQENTRY (bit, *m_entry) { const CBioseq& bioseq = *bit; if (bioseq.IsNa()) { const CBioseq_Handle& bs = (*m_scope).GetBioseqHandle (bioseq); nucloc.Reset( bs.GetRangeSeq_loc (0, bs.GetInst_Length())); } } VISIT_ALL_BIOSEQS_WITHIN_SEQENTRY (bit, *m_entry) { const CBioseq& bioseq = *bit; if (bioseq.IsAa()) { FOR_EACH_SEQID_ON_BIOSEQ (sit, bioseq) { const CSeq_id& protid = **sit; CProSplign prosplign; CRef<CSeq_align> alignment = prosplign.FindAlignment( *m_scope, protid, *nucloc ); *m_out << MSerial_AsnText << *alignment << endl; ++m_objectcount; break; } } } } catch (CException& e) { LOG_POST(Error << "error processing seqentry: " << e.what()); } }; protected: CNcbiOstream* m_out; }; #endif

source navigation ]   [ diff markup ]   [ identifier search ]   [ freetext search ]   [ file search ]  

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.