NCBI C++ ToolKit
psl_reader.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: psl_reader.cpp 93579 2021-05-01 20:54:52Z stakhovv $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Author: Frank Ludwig
27  *
28  * File Description:
29  * PSL file reader
30  *
31  */
32 
33 #include <ncbi_pch.hpp>
34 #include <corelib/ncbistd.hpp>
35 
38 
40 #include "psl_data.hpp"
41 
43 BEGIN_objects_SCOPE // namespace ncbi::objects::
44 
45 // ----------------------------------------------------------------------------
48  const string& name,
49  const string& title,
50  SeqIdResolver seqResolver,
51  CReaderListener* pListener) :
52 // ----------------------------------------------------------------------------
53  CReaderBase(flags, name, title, seqResolver, pListener)
54 {
55 }
56 
57 
58 // ----------------------------------------------------------------------------
60 // ----------------------------------------------------------------------------
61 {
62 }
63 
64 // ----------------------------------------------------------------------------
65 void
67  const TReaderData& readerData,
68  CSeq_annot& annot)
69 // ----------------------------------------------------------------------------
70 {
71  CPslData pslData(m_pMessageHandler.get());
72  auto& aligns = annot.SetData().SetAlign();
73  for (auto line: readerData) {
74  CRef<CSeq_align> pSeqAlign(new CSeq_align);
75  pslData.Initialize(line);
76  pslData.ExportToSeqAlign(mSeqIdResolve, *pSeqAlign);
77  aligns.push_back(pSeqAlign);
78  }
79 }
80 
81 END_objects_SCOPE
void Initialize(const CPslReader::TReaderLine &)
Definition: psl_data.cpp:75
void ExportToSeqAlign(CPslReader::SeqIdResolver, CSeq_align &seqAlign)
Definition: psl_data.cpp:212
virtual ~CPslReader()
Definition: psl_reader.cpp:59
void xProcessData(const TReaderData &, CSeq_annot &)
Definition: psl_reader.cpp:66
CPslReader(TReaderFlags flags, const string &name="", const string &title="", SeqIdResolver seqResolver=CReadUtil::AsSeqId, CReaderListener *pListener=nullptr)
Definition: psl_reader.cpp:46
Defines and provides stubs for a general interface to a variety of file readers.
Definition: reader_base.hpp:63
unique_ptr< CReaderMessageHandler > m_pMessageHandler
long TReaderFlags
Definition: reader_base.hpp:84
SeqIdResolver mSeqIdResolve
vector< TReaderLine > TReaderData
Definition: reader_base.hpp:70
CRef –.
Definition: ncbiobj.hpp:618
Include a standard set of the NCBI C++ Toolkit most basic headers.
static uch flags
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
void SetData(TData &value)
Assign a value to Data data member.
Definition: Seq_annot_.cpp:244
Modified on Fri Sep 20 14:57:32 2024 by modify_doxy.py rev. 669887