Skip to content

Commit

Permalink
better handling of inconsistent assembly_summary file headers
Browse files Browse the repository at this point in the history
  • Loading branch information
muellan committed Feb 29, 2024
1 parent 4c6db91 commit c563174
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
10 changes: 8 additions & 2 deletions src/building.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,16 @@ void add_targets_to_database(database& db,
}

try {
const auto fileId = extract_accession_string(
const auto fileAccession = extract_accession_string(
filename, sequence_id_type::acc_ver);

const taxon_id fileTaxId = find_taxon_id(sequ2taxid, fileId);
const taxon_id fileTaxId = find_taxon_id(sequ2taxid, fileAccession);

if(infoLvl == info_level::verbose) {
std::lock_guard<std::mutex> lock(outputMtx);
cout << " accession '" << fileAccession
<< "' -> taxid " << fileTaxId << endl;
}

sequence_reader reader{filename};

Expand Down
6 changes: 4 additions & 2 deletions src/taxonomy_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,11 @@ void read_sequence_to_taxon_id_mapping(const string& mappingFile,
string header;
getline(is, header);
std::istringstream hs(header);
//get rid of comment chars
hs >> header;
while(hs >> header) {
// handle comment chars
if (header.size() == 1 && header[0] == '#') {
hs >> header;
}
if(header == "taxid") {
taxcol = col;
}
Expand Down
4 changes: 2 additions & 2 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
#define MC_VERSION_H_


#define MC_VERSION 20230309
#define MC_VERSION 20240229

#define MC_DB_VERSION 20200820

#define MC_VERSION_STRING "2.3.1"
#define MC_VERSION_STRING "2.3.2"


#endif

0 comments on commit c563174

Please sign in to comment.