@@ -228,6 +228,7 @@ TEST_F(sequence_file_input_f, record_reading)
228228{
229229 /* record based reading */
230230 seqan3::sequence_file_input fin{std::istringstream{input}, seqan3::format_fasta{}};
231+ fin.options .fasta_ignore_blank_before_id = true ;
231232
232233 size_t counter = 0 ;
233234 for (auto & rec : fin)
@@ -246,6 +247,7 @@ TEST_F(sequence_file_input_f, record_reading_struct_bind)
246247{
247248 /* record based reading */
248249 seqan3::sequence_file_input fin{std::istringstream{input}, seqan3::format_fasta{}};
250+ fin.options .fasta_ignore_blank_before_id = true ;
249251
250252 size_t counter = 0 ;
251253 for (auto & [ seq, id, qual ] : fin)
@@ -275,6 +277,7 @@ TEST_F(sequence_file_input_f, record_reading_custom_options)
275277 /* record based reading */
276278 seqan3::sequence_file_input fin{istream, seqan3::format_fasta{}};
277279 fin.options .truncate_ids = true ;
280+ fin.options .fasta_ignore_blank_before_id = true ;
278281
279282 auto it = fin.begin ();
280283 EXPECT_EQ ((*it).id (), " ID1" );
@@ -284,9 +287,34 @@ TEST_F(sequence_file_input_f, record_reading_custom_options)
284287 EXPECT_EQ ((*it).id (), " ID3" );
285288}
286289
290+ TEST_F (sequence_file_input_f, record_reading_keep_blank_before_id)
291+ {
292+ std::istringstream istream{std::string
293+ {
294+ " > ID1 lala\n "
295+ " ACGTTTTTTTTTTTTTTT\n "
296+ " > ID2\n "
297+ " ACGTTTTTTT\n "
298+ " > ID3 lala\n "
299+ " ACGTTTA\n "
300+ }};
301+
302+ /* record based reading */
303+ seqan3::sequence_file_input fin{istream, seqan3::format_fasta{}};
304+
305+ auto it = fin.begin ();
306+ EXPECT_EQ ((*it).id (), " ID1 lala" );
307+ ++it;
308+ EXPECT_EQ ((*it).id (), " ID2" );
309+ ++it;
310+ EXPECT_EQ ((*it).id (), " ID3 lala" );
311+ }
312+
313+
287314TEST_F (sequence_file_input_f, file_view)
288315{
289316 seqan3::sequence_file_input fin{std::istringstream{input}, seqan3::format_fasta{}};
317+ fin.options .fasta_ignore_blank_before_id = true ;
290318
291319 auto minimum_length_filter = std::views::filter ([] (auto const & rec)
292320 {
@@ -347,13 +375,15 @@ TEST_F(sequence_file_input_f, decompression_by_filename_gz)
347375 }
348376
349377 seqan3::sequence_file_input fin{filename.get_path ()};
378+ fin.options .fasta_ignore_blank_before_id = true ;
350379
351380 decompression_impl (*this , fin);
352381}
353382
354383TEST_F (sequence_file_input_f, decompression_by_stream_gz)
355384{
356385 seqan3::sequence_file_input fin{std::istringstream{input_gz}, seqan3::format_fasta{}};
386+ fin.options .fasta_ignore_blank_before_id = true ;
357387
358388 decompression_impl (*this , fin);
359389}
@@ -367,6 +397,7 @@ TEST_F(sequence_file_input_f, read_empty_gz_file)
367397 ' \x00 ' , ' \x00 ' , ' \x00 ' , ' \x00 ' , ' \x00 ' , ' \x00 ' , ' \x00 ' , ' \x00 '
368398 };
369399 seqan3::sequence_file_input fin{std::istringstream{empty_zipped_file}, seqan3::format_fasta{}};
400+ fin.options .fasta_ignore_blank_before_id = true ;
370401
371402 EXPECT_TRUE (fin.begin () == fin.end ());
372403}
@@ -394,6 +425,7 @@ TEST_F(sequence_file_input_f, bgzf_decompression_by_filename_bgzf)
394425 }
395426
396427 seqan3::sequence_file_input fin{filename.get_path ()};
428+ fin.options .fasta_ignore_blank_before_id = true ;
397429
398430 decompression_impl (*this , fin);
399431}
@@ -408,12 +440,15 @@ TEST_F(sequence_file_input_f, bgzf_decompression_by_filename_gz)
408440 }
409441
410442 seqan3::sequence_file_input fin{filename.get_path ()};
443+ fin.options .fasta_ignore_blank_before_id = true ;
444+
411445 decompression_impl (*this , fin);
412446}
413447
414448TEST_F (sequence_file_input_f, decompression_by_stream_bgzf)
415449{
416450 seqan3::sequence_file_input fin{std::istringstream{input_bgzf}, seqan3::format_fasta{}};
451+ fin.options .fasta_ignore_blank_before_id = true ;
417452
418453 decompression_impl (*this , fin);
419454}
@@ -454,13 +489,15 @@ TEST_F(sequence_file_input_f, decompression_by_filename_bz2)
454489 }
455490
456491 seqan3::sequence_file_input fin{filename.get_path ()};
492+ fin.options .fasta_ignore_blank_before_id = true ;
457493
458494 decompression_impl (*this , fin);
459495}
460496
461497TEST_F (sequence_file_input_f, decompression_by_stream_bz2)
462498{
463499 seqan3::sequence_file_input fin{std::istringstream{input_bz2}, seqan3::format_fasta{}};
500+ fin.options .fasta_ignore_blank_before_id = true ;
464501
465502 decompression_impl (*this , fin);
466503}
@@ -472,6 +509,7 @@ TEST_F(sequence_file_input_f, read_empty_bz2_file)
472509 ' \x42 ' , ' \x5a ' , ' \x68 ' , ' \x39 ' , ' \x17 ' , ' \x72 ' , ' \x45 ' , ' \x38 ' , ' \x50 ' , ' \x90 ' , ' \x00 ' , ' \x00 ' , ' \x00 ' , ' \x00 '
473510 };
474511 seqan3::sequence_file_input fin{std::istringstream{empty_zipped_file}, seqan3::format_fasta{}};
512+ fin.options .fasta_ignore_blank_before_id = true ;
475513
476514 EXPECT_TRUE (fin.begin () == fin.end ());
477515}
0 commit comments