-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'DOR-553_RG_HDR_FOR_CUSTOM_BARCODES' into 'master'
DOR-553 ensure read group header lines include custom barcodes Closes DOR-553 See merge request machine-learning/dorado!897 (cherry picked from commit 862872a) f37cd6a Refactoring to move parsing custom barcodes kits functionality into utils so... 0a9e40a Merge remote-tracking branch 'origin/master' into DOR-553_RG_HDR_FOR_CUSTOM_BARCODES 806ad9b Add barcode arrangements RG header generation when using a custom kit 3f2bc41 Refactored adding read group headers separating custom from default kits to avoid a clunky api cc328db Fix missing include from symbol_test and added missing else clause if no barcoding kit specified cbdd51a Resolved merge conflicts 037257f Updated follwoing review
- Loading branch information
1 parent
ce957ae
commit 7e25c9e
Showing
18 changed files
with
243 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include "parse_custom_sequences.h" | ||
|
||
#include "utils/bam_utils.h" | ||
#include "utils/types.h" | ||
|
||
#include <htslib/sam.h> | ||
|
||
namespace dorado::demux { | ||
|
||
std::unordered_map<std::string, std::string> parse_custom_sequences( | ||
const std::string& sequences_file) { | ||
dorado::HtsFilePtr file(hts_open(sequences_file.c_str(), "r")); | ||
BamPtr record; | ||
record.reset(bam_init1()); | ||
|
||
std::unordered_map<std::string, std::string> sequences; | ||
|
||
int sam_ret_val = 0; | ||
while ((sam_ret_val = sam_read1(file.get(), nullptr, record.get())) != -1) { | ||
if (sam_ret_val < -1) { | ||
throw std::runtime_error("Failed to parse custom sequence file " + sequences_file); | ||
} | ||
std::string qname = bam_get_qname(record.get()); | ||
std::string seq = utils::extract_sequence(record.get()); | ||
sequences[qname] = seq; | ||
} | ||
|
||
return sequences; | ||
} | ||
|
||
} // namespace dorado::demux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
#include <unordered_map> | ||
|
||
namespace dorado::demux { | ||
|
||
std::unordered_map<std::string, std::string> parse_custom_sequences( | ||
const std::string& sequences_file); | ||
|
||
} // namespace dorado::demux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.