@@ -381,7 +381,8 @@ const string ModuleBasicStatistics::module_name = "Basic Statistics";
381381ModuleBasicStatistics::
382382ModuleBasicStatistics (const FalcoConfig &config)
383383: Module(ModuleBasicStatistics::module_name) {
384- filename_stripped = config.filename_stripped ;
384+ is_nanopore = config.nanopore ;
385+ filename_stripped = config.filename_stripped ;
385386}
386387
387388void
@@ -396,32 +397,37 @@ ModuleBasicStatistics::summarize_module(FastqStats &stats) {
396397 // These seem to always be the same on FastQC
397398 // File type
398399 file_type = " Conventional base calls" ;
399-
400- // File encoding
401- const char lowest_char = stats.lowest_char ;
402-
403- // copied from FastQC:
404- static const size_t SANGER_ENCODING_OFFSET = 33 ;
405- static const char ILLUMINA_1_3_ENCODING_OFFSET = 64 ;
406- if (lowest_char < 33 ) {
407- throw runtime_error (" No known encoding with chars < 33. Yours was " +
408- std::to_string (lowest_char) + " )" );
409- }
410- else if (lowest_char < 64 ) {
411- file_encoding = " Sanger / Illumina 1.9" ;
412- stats.encoding_offset = SANGER_ENCODING_OFFSET - Constants::quality_zero;
413- }
414- else if (lowest_char == ILLUMINA_1_3_ENCODING_OFFSET+1 ) {
415- file_encoding = " Illumina 1.3" ;
416- stats.encoding_offset = ILLUMINA_1_3_ENCODING_OFFSET - Constants::quality_zero;
417- }
418- else if (lowest_char <= 126 ) {
419- file_encoding = " Illumina 1.5" ;
420- stats.encoding_offset = ILLUMINA_1_3_ENCODING_OFFSET - Constants::quality_zero;
400+ if (is_nanopore) {
401+ file_encoding = " Oxford Nanopore" ;
402+ // stats.encoding_offset = ?
421403 }
422404 else {
423- throw runtime_error (" No known encodings with chars > 126 (Yours was " +
424- std::to_string (lowest_char) + " )" );
405+ // File encoding
406+ const char lowest_char = stats.lowest_char ;
407+
408+ // copied from FastQC:
409+ static const size_t SANGER_ENCODING_OFFSET = 33 ;
410+ static const char ILLUMINA_1_3_ENCODING_OFFSET = 64 ;
411+ if (lowest_char < 33 ) {
412+ throw runtime_error (" No known encoding with chars < 33. Yours was " +
413+ std::to_string (lowest_char) + " )" );
414+ }
415+ else if (lowest_char < 64 ) {
416+ file_encoding = " Sanger / Illumina 1.9" ;
417+ stats.encoding_offset = SANGER_ENCODING_OFFSET - Constants::quality_zero;
418+ }
419+ else if (lowest_char == ILLUMINA_1_3_ENCODING_OFFSET+1 ) {
420+ file_encoding = " Illumina 1.3" ;
421+ stats.encoding_offset = ILLUMINA_1_3_ENCODING_OFFSET - Constants::quality_zero;
422+ }
423+ else if (lowest_char <= 126 ) {
424+ file_encoding = " Illumina 1.5" ;
425+ stats.encoding_offset = ILLUMINA_1_3_ENCODING_OFFSET - Constants::quality_zero;
426+ }
427+ else {
428+ throw runtime_error (" No known encodings with chars > 126 (Yours was " +
429+ std::to_string (lowest_char) + " )" );
430+ }
425431 }
426432
427433 // Poor quality reads
0 commit comments