/usr/include/pbseq/alignment/files/ReaderAgglomerate.hpp is in libblasr-dev 0~20161219-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | #ifndef _BLASR_READER_AGGLOMERATE_HPP_
#define _BLASR_READER_AGGLOMERATE_HPP_
#include <cstdlib>
// pbdata
#include "../../pbdata/Enumerations.h"
#include "../../pbdata/reads/ReadType.hpp"
#include "../../pbdata/FASTAReader.hpp"
#include "../../pbdata/FASTQReader.hpp"
#include "../../pbdata/CCSSequence.hpp"
#include "../../pbdata/SMRTSequence.hpp"
#include "../../pbdata/StringUtils.hpp"
// hdf
#include "../../hdf/HDFBasReader.hpp"
#include "../../hdf/HDFCCSReader.hpp"
#include "BaseSequenceIO.hpp"
#ifdef USE_PBBAM
#include <pbbam/DataSet.h>
#include <pbbam/EntireFileQuery.h>
#include <pbbam/PbiFilter.h>
#include <pbbam/PbiFilterQuery.h>
#include "../query/SequentialZmwGroupQuery.h"
#include "../query/PbiFilterZmwGroupQuery.h"
#include <pbbam/BamRecord.h>
// the following added to support Polymerase read for unrolled mode
#include <pbbam/virtual/ZmwReadStitcher.h> // new interface
#endif
class ReaderAgglomerate : public BaseSequenceIO {
FASTAReader fastaReader;
FASTQReader fastqReader;
int readQuality;
int stride;
int start;
float subsample;
bool useRegionTable;
bool ignoreCCS;
ReadType::ReadTypeEnum readType;
bool unrolled; // indicate if unrolled mode; needed because GetNext() must know about the mode
std::string scrapsFileName; // Needed for unrolled to initiate if in PBBAM
public:
//
// Create interfaces for reading hdf
//
T_HDFBasReader<SMRTSequence> hdfBasReader;
HDFCCSReader<CCSSequence> hdfCcsReader;
vector<SMRTSequence> readBuffer;
vector<CCSSequence> ccsBuffer;
string readGroupId;
public:
void SetToUpper();
void InitializeParameters();
ReaderAgglomerate();
ReaderAgglomerate(float _subsample);
ReaderAgglomerate(int _stride);
ReaderAgglomerate(int _start, int _stride);
void GetMovieName(string &movieName);
/// Get BindingKit, SequencingKit and Base Caller Version from h5.
///
/// /param [out] sequencingKit - sequencingKit from
/// /ScanData/RunInfo/SequencingKit.
///
/// /param [out] bindingKit - BindingKit from
/// /ScanData/RunInfo/BindingKit.
///
/// /param [out] baseCallerVersion - Base Caller Version
/// from /PulseData/BaseCalls/ChangeListID.
///
void GetChemistryTriple(string & bindingKit,
string & sequencingKit,
string & baseCallerVersion);
bool FileHasZMWInformation();
void SkipReadQuality();
void IgnoreCCS();
void UseCCS();
int Initialize(string &pFileName);
bool SetReadFileName(string &pFileName);
void SetScrapsFileName(string &pFileName); // needed for unrolled
int Initialize(FileType &pFileType, string &pFileName);
bool HasRegionTable();
int Initialize(bool unrolled_mode = false); // add unrolled mode, to indicate we need to initialize VP/VPC|Reader
ReaderAgglomerate &operator=(ReaderAgglomerate &rhs);
bool Subsample(float rate);
// Set read type to SUBREAD, CCS, or UNKNOWN.
void SetReadType(const ReadType::ReadTypeEnum & readType_);
// returns read type, SUBREAD, CCS, or UNKNOWN
ReadType::ReadTypeEnum GetReadType();
public:
int GetNext(FASTASequence &seq);
int GetNext(FASTQSequence &seq);
int GetNext(SMRTSequence &seq);
int GetNext(CCSSequence &seq);
int GetNext(vector<SMRTSequence> & reads);
template<typename T_Sequence>
int GetNext(T_Sequence & seq, int & randNum);
int GetNextBases(SMRTSequence & seq, bool readQVs);
int Advance(int nSteps);
void Close();
#ifdef USE_PBBAM
public:
// Define reader to fetch sequences from bam.
PacBio::BAM::DataSet * dataSetPtr;
PacBio::BAM::EntireFileQuery * entireFileQueryPtr;
PacBio::BAM::EntireFileQuery::iterator entireFileIterator;
PacBio::BAM::PbiFilterQuery * pbiFilterQueryPtr;
PacBio::BAM::PbiFilterQuery::iterator pbiFilterIterator;
PacBio::BAM::SequentialZmwGroupQuery * sequentialZmwQueryPtr;
PacBio::BAM::SequentialZmwGroupQuery::iterator sequentialZmwIterator;
PacBio::BAM::PbiFilterZmwGroupQuery * pbiFilterZmwQueryPtr;
PacBio::BAM::PbiFilterZmwGroupQuery::iterator pbiFilterZmwIterator;
// the following to added to support Polymerase reads in unrolled mode
PacBio::BAM::ZmwReadStitcher * VPReader; // new interface
PacBio::BAM::ZmwReadStitcher * VPCReader; // new interface
#endif
};
template<typename T_Sequence>
int ReadChunkByNReads(ReaderAgglomerate &reader, vector<T_Sequence> &reads, int maxNReads);
template<typename T_Sequence>
int ReadChunkBySize (ReaderAgglomerate &reader, vector<T_Sequence> &reads, int maxMemorySize);
#include "ReaderAgglomerateImpl.hpp"
#endif
|