30 #if BOOST_VERSION >= 105900
31 # include <boost/test/tools/output_test_stream.hpp>
33 # include <boost/test/output_test_stream.hpp>
92 const char* kDataFile =
"data/nt.555.mfsa";
120 boost::test_tools::output_test_stream
out(
"data/sample_parse_seqids_fasta.out");
121 const bool kParseSeqids(
true);
123 writer->Print(m_BioseqHandleWithGi, m_Masks, kParseSeqids);
124 BOOST_CHECK(
out.match_pattern());
132 boost::test_tools::output_test_stream
out(
"data/sample_fasta.out");
133 const bool kParseSeqids(
false);
135 writer->Print(m_BioseqHandleWithLocalId, m_Masks, kParseSeqids);
136 BOOST_CHECK(
out.match_pattern());
143 boost::test_tools::output_test_stream
out(
"data/sample_parse_seqids_acclist.out");
144 const bool kParseSeqids(
true);
146 writer->Print(m_BioseqHandleWithGi, m_Masks, kParseSeqids);
147 BOOST_CHECK(
out.match_pattern());
155 boost::test_tools::output_test_stream
out(
"data/sample_acclist.out");
156 const bool kParseSeqids(
false);
158 writer->Print(m_BioseqHandleWithLocalId, m_Masks, kParseSeqids);
159 BOOST_CHECK(
out.match_pattern());
167 boost::test_tools::output_test_stream
out(
"data/sample_parse_seqids_interval.out");
168 const bool kParseSeqids(
true);
170 writer->Print(m_BioseqHandleWithGi, m_Masks, kParseSeqids);
171 BOOST_CHECK(
out.match_pattern());
179 boost::test_tools::output_test_stream
out(
"data/sample_interval.out");
180 const bool kParseSeqids(
false);
182 writer->Print(m_BioseqHandleWithLocalId, m_Masks, kParseSeqids);
183 BOOST_CHECK(
out.match_pattern());
194 boost::test_tools::output_test_stream
out(
"data/sample_parse_seqids_maskinfo_asn1_text.out");
195 const bool kParseSeqids(
true);
197 "maskinfo_asn1_text",
201 writer->Print(m_BioseqHandleWithGi, m_Masks, kParseSeqids);
202 BOOST_CHECK(
out.match_pattern());
207 boost::test_tools::output_test_stream
out(
"data/sample_maskinfo_asn1_text.out");
208 const bool kParseSeqids(
false);
210 "maskinfo_asn1_text",
214 writer->Print(m_BioseqHandleWithLocalId, m_Masks, kParseSeqids);
215 BOOST_CHECK(
out.match_pattern());
220 const bool kMatchOrSave(
true);
221 const bool kTextOrBin(
false);
222 boost::test_tools::output_test_stream
223 out(
"data/sample_parse_seqids_maskinfo_asn1_bin.out",
224 kMatchOrSave, kTextOrBin);
225 const bool kParseSeqids(
true);
231 writer->Print(m_BioseqHandleWithGi, m_Masks, kParseSeqids);
232 BOOST_CHECK(
out.match_pattern());
237 const bool kMatchOrSave(
true);
238 const bool kTextOrBin(
false);
239 boost::test_tools::output_test_stream
out(
"data/sample_maskinfo_asn1_bin.out",
240 kMatchOrSave, kTextOrBin);
241 const bool kParseSeqids(
false);
247 writer->Print(m_BioseqHandleWithLocalId, m_Masks, kParseSeqids);
248 BOOST_CHECK(
out.match_pattern());
253 boost::test_tools::output_test_stream
out(
"data/sample_parse_seqids_maskinfo_xml.out");
254 const bool kParseSeqids(
true);
260 writer->Print(m_BioseqHandleWithGi, m_Masks, kParseSeqids);
261 BOOST_CHECK(
out.match_pattern());
266 boost::test_tools::output_test_stream
out(
"data/sample_maskinfo_xml.out");
267 const bool kParseSeqids(
false);
273 writer->Print(m_BioseqHandleWithLocalId, m_Masks, kParseSeqids);
274 BOOST_CHECK(
out.match_pattern());
279 boost::test_tools::output_test_stream
out(
281 "data/sample_prefacc_parse_seqids_seqloc_asn1_text.out" :
282 "data/sample_parse_seqids_seqloc_asn1_text.out");
283 const bool kParseSeqids(
true);
285 writer->Print(m_BioseqHandleWithGi, m_Masks, kParseSeqids);
286 BOOST_CHECK(
out.match_pattern());
291 boost::test_tools::output_test_stream
out(
"data/sample_seqloc_asn1_text.out");
292 const bool kParseSeqids(
false);
294 writer->Print(m_BioseqHandleWithLocalId, m_Masks, kParseSeqids);
295 BOOST_CHECK(
out.match_pattern());
296 BOOST_REQUIRE_EQUAL(GetExpectedNumberOfMasks(), m_Masks.size());
297 BOOST_CHECK_EQUAL(GetMaskStart(), m_Masks[0].
first);
298 BOOST_CHECK_EQUAL(GetMaskStop(), m_Masks[0].second);
306 const bool kMatchOrSave(
true);
307 const bool kTextOrBin(
false);
308 boost::test_tools::output_test_stream
311 "data/sample_prefacc_parse_seqids_seqloc_asn1_bin.out" :
312 "data/sample_parse_seqids_seqloc_asn1_bin.out",
315 const bool kParseSeqids(
true);
317 writer->Print(m_BioseqHandleWithGi, m_Masks, kParseSeqids);
318 BOOST_CHECK(
out.match_pattern());
323 const bool kMatchOrSave(
true);
324 const bool kTextOrBin(
false);
325 boost::test_tools::output_test_stream
326 out(
"data/sample_seqloc_asn1_bin.out", kMatchOrSave, kTextOrBin);
327 const bool kParseSeqids(
false);
329 writer->Print(m_BioseqHandleWithLocalId, m_Masks, kParseSeqids);
330 BOOST_CHECK(
out.match_pattern());
335 boost::test_tools::output_test_stream
out(
337 "data/sample_prefacc_parse_seqids_seqloc_xml.out" :
338 "data/sample_parse_seqids_seqloc_xml.out");
339 const bool kParseSeqids(
true);
341 writer->Print(m_BioseqHandleWithGi, m_Masks, kParseSeqids);
342 BOOST_CHECK(
out.match_pattern());
347 boost::test_tools::output_test_stream
out(
"data/sample_seqloc_xml.out");
348 const bool kParseSeqids(
false);
350 writer->Print(m_BioseqHandleWithLocalId, m_Masks, kParseSeqids);
351 BOOST_CHECK(
out.match_pattern());
@ eExtreme_Positional
numerical value
Base class for reading FASTA sequences.
Output filter to print masked sequence locations as Blast-db-mask-info objects.
Output filter to write masked data in fasta format.
Output filter to print masked sequences as sets of intervals.
Output filter to print masked sequence locations as NCBI Seq-loc objects.
Output filter to print masked sequences as sets of intervals one per line.
pair< TSeqPos, TSeqPos > TMaskedInterval
Type representing a masked interval within a sequence.
vector< TMaskedInterval > TMaskList
A type representing the total of masking information about a sequence.
Template class for iteration on objects of class C (non-medifiable version)
std::ofstream out("events_result.xml")
main entry point for tests
Operators to edit gaps in sequences.
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
unsigned int TSeqPos
Type for sequence locations and lengths.
virtual CRef< CSeq_entry > ReadOneSeq(ILineErrorListener *pMessageListener=nullptr)
Read a single effective sequence, which may turn out to be a segmented set.
long TFlags
binary OR of EFlags
CRef< CSeq_loc > SaveMask(void)
Directs the *following* call to ReadOneSeq to note the locations of lowercase letters.
const CSeq_id & GetBestID(void) const
@ fNoParseID
Generate an ID (whole defline -> title)
@ fUniqueIDs
Forbid duplicate IDs.
@ fAssumeNuc
Assume nucs unless accns indicate otherwise.
static bool PreferAccessionOverGi(void)
Check if the option to prefer accession.version over GI is enabled (SeqId/PreferAccessionOverGi or SE...
CConstBeginInfo ConstBegin(const C &obj)
Get starting point of non-modifiable object hierarchy.
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
CSeq_entry_Handle AddTopLevelSeqEntry(CSeq_entry &top_entry, TPriority pri=kPriority_Default, EExist action=eExist_Default)
Add seq_entry, default priority is higher than for defaults or loaders Add object to the score with p...
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
void AddDefaults(TPriority pri=kPriority_Default)
Add default data loaders from object manager.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
@ eBlast_filter_program_dust
bool IsSeq(void) const
Check if variant Seq is selected.
std::istream & in(std::istream &in_, double &x_)
static const int kAlgoId(2)
BOOST_AUTO_TEST_CASE(WriteFastaParseSeqids)
static const string kAlgoOptions("window=64; level=20; linker=1")
CBioseq_Handle m_BioseqHandleWithLocalId
CBioseq_Handle m_BioseqHandleWithGi
TSeqPos GetMaskStop() const
CMaskWriter::TMaskList m_Masks
void x_LoadMaskedBioseqGi555()
CBioseq_Handle x_LoadMaskedBioseq(bool parse_seqids)
void x_LoadMaskedBioseqLocalId()
size_t GetExpectedNumberOfMasks() const
TSeqPos GetMaskStart() const
void x_ConvertMasks(CRef< CSeq_loc > mask)
Utility stuff for more convenient using of Boost.Test library.