sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
ec4ddfdd74271de9b56208b1704d170e816557c987dd7e1a6105bdb3ad0ffd27
C/C++
1,356
48
#pragma once #include <spdlog/spdlog.h> namespace dorado::utils { // Initialises the default logger to point to stderr. void InitLogging(); enum class VerboseLogLevel : int { none = 0, debug = 1, trace = 2, }; void SetVerboseLogging(VerboseLogLevel level); /// <summary> /// Ensure a minimum logging lev...
3bd17ab99db8f93d84190025177c4c83983879e0c25e5e9713b2df473e822635
C/C++
1,363
32
#pragma once #include <cstdint> #include <utility> #include <vector> namespace dorado::utils { // Create overlapping (== overlap) chunks of equal length (== chunk_size) and return begin // positions, where the last chunk pair will have a bigger overlap. // std::vector<std::size_t> generate_chunks(std::size_t num_sam...
1c3cc625cf92a2f09a95cd2cddce97323bfe3371072315057c4f64544c8771a9
C/C++
1,381
49
#ifndef _INCLUDE_EVENT_H_ #define _INCLUDE_EVENT_H_ #include <stdbool.h> #define EVENT_HEAD 0x78A2 /* ʼþÀàÐÍ */ typedef enum { EVENT_CONNECT = (unsigned short)0x4121, EVENT_START = (unsigned short)0x5214, EVENT_STOP = (unsigned short)0x7521,...
4d5011d1a9502c18530b48cda4ccc4db2696778bfa0efdcb4758fbbafebb0340
C/C++
1,394
59
#pragma once #include <cmath> #include <string> #include <vector> // Forward declaration of toml::value taken from toml_fwd.hpp namespace toml { template <typename TypeConfig> class basic_value; struct type_config; using value = basic_value<type_config>; } // namespace toml namespace dorado::config { // Activatio...
b403464706ddc362a168c5924a68703e2225a43e7e1c256806ac53f8929761c0
C/C++
1,412
39
#pragma once #include <iosfwd> #include <string> #include <vector> namespace dorado::poly_tail { struct PolyTailConfig { std::string rna_adapter = "GGTTGTTTCTGTTGGTGCTG"; // RNA std::string front_primer = "TTTCTGTTGGTGCTGATATTGCTTT"; // SSP std::str...
ed48d8ea7ebadd3bd6130abec83637ac3c73267a76d330391f7a7d3d7752c761
C/C++
1,414
54
#pragma once #include <cstddef> #include <memory> #include <string_view> namespace dorado::utils::concurrency { class TaskPool; // These are the threads that will execute the tasks. class WorkerPool { struct WorkerState; const std::unique_ptr<WorkerState[]> m_states; const std::size_t m_num_workers; pr...
313a07f2213025edfb7604e45b473b7a2ff54d3d037a6721a21c170fb9e28b7e
C/C++
1,426
46
#pragma once #include <map> #include <mutex> #include <optional> #include <string> #include <unordered_map> #include <utility> #include <vector> namespace dorado::basecall { class ChunkBenchmarks final { public: using ChunkTimings = std::unordered_map<int, float>; using ModelName = std::string; using GPU...
e8254ec64339a33dc13e5a68d6b804b3e31728f0d8fe2c6aaf5706a7be1fedba
C/C++
1,434
50
#pragma once #include "demux/BarcodeClassifierSelector.h" #include "read_pipeline/base/MessageSink.h" #include "utils/concurrency/AsyncExecutor.h" #include <atomic> #include <map> #include <mutex> #include <string> namespace dorado { namespace demux { struct BarcodingInfo; } class BarcodeClassifierNode : public Me...
5078f8e7e14f2c9113f969aa55bd14007b28f7b2e49ec7ccc7d5792b3163abbe
C/C++
1,445
61
#ifndef EVENT_H #define EVENT_H #include <QByteArray> #define EVENT_HEAD 0x78A2 typedef enum { EVENT_CONNECT = (unsigned short)0x4121, EVENT_START = (unsigned short)0x5214, EVENT_STOP = (unsigned short)0x7521, EVENT_ERROR ...
15b4b242823e3df7dacd8423c5154bcf392430e9e33bff639f48a7f701e33657
C/C++
1,451
51
#pragma once #include "ModelRunnerBase.h" #include <ATen/core/TensorBody.h> #include <c10/cuda/CUDAStream.h> #include <atomic> #include <filesystem> #include <memory> #include <tuple> #include <vector> namespace dorado::basecall { class CudaCaller; class CudaModelRunner final : public ModelRunnerBase { public: ...
ae726ce61e4b8d16aed033332014c0017a6ad964e419382fc54516e2f272032e
C/C++
1,456
57
#pragma once #include "cigar.h" #include <iosfwd> #include <string> #include <string_view> #include <vector> namespace dorado::utils { struct Overlap; struct PafEntry { std::string qname{"*"}; int qlen = 0; int qstart = 0; int qend = 0; char strand{'*'}; std::string tname{"*"}; int tlen...
3faa680872cf6eeb90bd98f1c4fc42c75c213f657ed18e0b506ac7db7becb7bf
C/C++
1,458
43
/** ****************************************************************************** * @file usbd_cdc_if_template.h * @author MCD Application Team * @brief Header for usbd_cdc_if_template.c file. ****************************************************************************** * @attention * * ...
a6e225079228a55ff0077477bf7d7d0b2c74e9b8d2441c659dee522da745b663
C/C++
1,461
48
#pragma once #include "ReadCommon.h" #include <atomic> #include <cstdint> #include <limits> #include <memory> #include <string> namespace dorado { // Class representing a simplex read, including raw data class SimplexRead { public: ReadCommon read_common; float digitisation; // Loaded from source file ...
73a13a566fa6c64ffa9eeed17d6ea6ad18b47bd08ea5861b4371388e0bad1ec8
C/C++
1,463
47
#pragma once #include "ModelRunnerBase.h" #include "config/BasecallModelConfig.h" #include "utils/stats.h" #include <torch/nn.h> #include <atomic> #include <string> namespace dorado::basecall::decode { class Decoder; } // namespace dorado::basecall::decode namespace dorado::basecall { class ModelRunner final : p...
53dc01aefc071c6e7270ba8dcbec0643636213f8771197a96529dc4678e2b79b
C/C++
1,480
47
#pragma once #include "splitter/ReadSplitter.h" #include <ATen/core/TensorBody.h> #include <algorithm> #include <cassert> #include <cstdint> #include <optional> namespace dorado::splitter { template <class FilterF> auto filter_ranges(const PosRanges& ranges, FilterF filter_f) { PosRanges filtered; std::cop...
862c7a8708f8511cce93a38641b38f682b353b4fd291ad3b1864b0c85e01548b
C/C++
1,482
33
#ifndef NEON_SSE_H #define NEON_SSE_H #include <arm_neon.h> typedef uint8x16_t __m128i; static inline __m128i _mm_load_si128(const __m128i *ptr) { return vld1q_u8((const uint8_t *) ptr); } static inline __m128i _mm_set1_epi32(int n) { return vreinterpretq_u8_s32(vdupq_n_s32(n)); } static inline void _mm_store_si128(...
7b374ad4d44141e621b194d1f87504670c591dd64fdbebe3b5d09273eaff58fe
C/C++
1,487
59
#pragma once #include "RNNStack.h" #include <torch/nn.h> #include <vector> namespace dorado::nn { struct FLSTMLayerImpl : torch::nn::Module { FLSTMLayerImpl(int C, int K, at::TensorOptions opts); at::Tensor forward(at::Tensor x); private: int C_; at::Tensor dn_weight_ih_; at::Tensor dn_weight...
37d6adb13b43379d355621d199f036c80acb08942ad14f295f0030fbca3c54b1
C/C++
1,489
32
#pragma once #include "utils/MoveOnlyFunction.h" namespace dorado::utils::concurrency { // // Rough overview: // * Fixed number of persistent workers, held by WorkerPool. // * TaskPools are (re)created and attached to the WorkerPool when pipelines are (re)created. // * Fixed number of producers, one per node t...
223dbbad3f001461ee9521f563a95b7cdcf48911bea4edc0eda84d18c6264c3d
C/C++
1,496
42
#pragma once #include "api/caller_creation.h" #include "basecall/ModelRunnerBase.h" #include "modbase/ModBaseRunner.h" #include <filesystem> #include <memory> #include <span> #include <string> #include <utility> #include <vector> namespace dorado::api { bool check_variable_chunk_sizes_supported(const config::Baseca...
8012f6d22b6cfda3616169b74bdac73d290a4da5746370853cbb7df58a7a4329
C/C++
1,501
56
#pragma once #include <ostream> #include <sstream> #include <string> #include <vector> namespace dorado::utils { /** * \brief Prints the contents of an iterable container to a stream. Useful for debug purposes. */ template <typename T> void print_container(std::ostream& os, const T& data, ...
d0bc78b48d5220a65ec77d12265575961a1701a2022b71a4370fe2ae30b9a6ba
C/C++
1,507
53
#pragma once #include "utils/tty_utils.h" #ifdef _WIN32 #include <indicators/progress_bar.hpp> #else #include <indicators/block_progress_bar.hpp> #endif namespace dorado { #ifdef _WIN32 using ProgressBarBase = indicators::ProgressBar; #else using ProgressBarBase = indicators::BlockProgressBar; #endif class SimpleP...
a30662f7cf30aca4bef848faa9740c5b34e04fcceffaea9fd41e0e203c147ed1
C/C++
1,517
55
#pragma once #include <cstring> #include <filesystem> #include <string> #include <vector> namespace dorado::tests { std::filesystem::path get_data_dir(const std::string& sub_dir); // Reads into a string. std::string ReadFileIntoString(const std::filesystem::path& path); // Reads into a vector<uint8_t>. std::vector...
a6d5d00db37e3534f3a4e78133a10b917da0525a884ae67be81011227da808d1
C/C++
1,520
72
#pragma once #include "hts_utils/hts_types.h" #include "secondary/common/alignment.h" #include <filesystem> #include <string> #include <vector> struct htsFile; struct hts_idx_t; struct sam_hdr_t; struct bam1_t; struct hts_itr_t; struct HtsIdxDestructor { void operator()(hts_idx_t*); }; using HtsIdxPtr = std::un...
3adcb1e6db47368d0136049ea88fc74d377475cf047d6b279764feb75956cd05
C/C++
1,524
69
#ifndef LH3_BWTSW2_H #define LH3_BWTSW2_H #include <stdint.h> #include "bntseq.h" #include "bwt_lite.h" #include "bwt.h" #define BSW2_FLAG_MATESW 0x100 #define BSW2_FLAG_TANDEM 0x200 #define BSW2_FLAG_MOVED 0x400 #define BSW2_FLAG_RESCUED 0x800 typedef struct { int skip_sw:8, cpy_cmt:8, hard_clip:16; int a, b,...
e7a12221907c494d3589587a24940c12d6b175443f7ca1040be0f76f06637775
C/C++
1,539
61
#pragma once #include "dorado_version.h" #include <cmath> #include <cstdint> #include <stdexcept> #include <string> #include <vector> namespace dorado::utils::arg_parse { inline bool parse_yes_or_no(const std::string& str) { if (str == "yes" || str == "y") { return true; } if (str == "no" || str...
e6f8dc3b9f754bd12e3f79c13aeb29994c0f327c033b3cde6f78bed781a4dd8b
C/C++
1,548
58
#ifndef ROPE_H_ #define ROPE_H_ #include <stdint.h> #include <stdio.h> #define ROPE_MAX_DEPTH 80 #define ROPE_DEF_MAX_NODES 64 #define ROPE_DEF_BLOCK_LEN 512 typedef struct rpnode_s { struct rpnode_s *p; // child; at the bottom level, $p points to a string with the first 2 bytes giving the number of runs (#runs) u...
6ee72eb08ce53f83cfff8f8f9203730e7f38716a4de53deadf1193d21d4a2358
C/C++
1,549
64
#ifndef ADJUSTWIDGET_H #define ADJUSTWIDGET_H #include <QWidget> #include <QStringList> #include <QIntValidator> namespace Ui { class AdjustWidget; } enum AdjustWidgetEvent{ ADJUST_EVENT_REDUCE, ADJUST_EVENT_ADD, ADJUST_EVENT_EDIT_COMPLETED, }; class AdjustWidget : public QWidget {...
b37ee4147b43ea6ba89d646a847be24988a667b2bf9313699ec7c6adeea92be8
C/C++
1,563
69
#ifndef MAINWIDGET_H #define MAINWIDGET_H #include "channelselectlayout.h" #include "controldialog.h" #include "hardwarethread.h" #include "plotdialog.h" #include <QProgressDialog> #include <QWidget> QT_BEGIN_NAMESPACE namespace Ui { class MainWidget; } QT_END_NAMESPACE #define MAX_ROW 400 #define M...
de64e5aa0a606d9ede8abde857d1f1b042d1808ad264329ade76010c8a2e8994
C/C++
1,563
52
#pragma once #include "DecodedChunk.h" #include "utils/stats.h" #include <string> #include <utility> #include <vector> namespace at { class Tensor; } namespace dorado::config { struct BasecallModelConfig; } // namespace dorado::config namespace dorado::basecall { class ModelRunnerBase { public: virtual ~Mode...
c72feb8580d9b61914853abf6348598110f0ed03d29b27f4935bdcb043e97383
C/C++
1,569
54
#pragma once #include "read_pipeline/base/MessageSink.h" #include <atomic> #include <condition_variable> #include <cstdint> #include <mutex> #include <thread> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> namespace dorado { class SubreadTaggerNode : public MessageSink { publ...
c70d8cb1bbc1e80f1bb55fe5fc1fcb4a75436c964f3bac9db98a7582d8e350b3
C/C++
1,591
42
#pragma once #include "ReadSplitter.h" #include <optional> #include <vector> namespace dorado::splitter { class DuplexReadSplitter : public ReadSplitter { public: DuplexReadSplitter(DuplexSplitSettings settings); ~DuplexReadSplitter(); std::vector<SimplexReadPtr> split(SimplexReadPtr init_read) const ov...
9e892d8478c170b988761bdabda0c68e4a3fb7771a84622c54a95bb17c4f6dbb
C/C++
1,608
46
#pragma once #include <chrono> #include <cstdint> namespace dorado { namespace timer { /// \brief Minimal timer object to facilitate recording time spans using the high resolution clock. /// Starts a clock when constructed. class TimerHighRes { public: TimerHighRes() : m_start_time(get_current_time()) {...
59da8cfaeb218058954a5fcc09d684f6b98b27e8776edca825e8c92c76562539
C/C++
1,646
45
/* QSufSort.h Header file for QSufSort.c This file contains an implementation of the algorithm presented in "Faster Suffix Sorting" by N. Jesper Larsson (jesper@cs.lth.se) and Kunihiko Sadakane (sada@is.s.u-tokyo.ac.jp). This software may be used freely for any purpose. However, when distributed, t...
01fb530f48a67f49fde94b669336ccc9215dcd398429ff4c137da55ed536f0ad
C/C++
1,728
46
#pragma once #include "consensus_result.h" #include <cstdint> #include <iosfwd> #include <optional> #include <string> #include <string_view> #include <unordered_set> #include <vector> namespace dorado::secondary { std::string extract_draft_with_gaps(const std::string_view draft, ...
205132a18619430ca5dae8c6ff0552554127f3f3521464dd0d6ca17701e1f1c3
C/C++
1,781
58
#pragma once #include "hts_utils/HeaderMapper.h" #include "hts_utils/hts_types.h" #include "interface.h" #include <filesystem> #include <fstream> #include <iosfwd> #include <memory> #include <string> struct sam_hdr_t; namespace dorado { class HtsData; namespace hts_writer { class SummaryFileWriter : public IWrite...
816b5a124f2ffec924fb1776fcc2cc7a33948d6b3149a530b95eb53fcdca34c3
C/C++
1,806
57
#ifndef GC_H #define GC_H #include <string> #include <string.h> #include <vector> #include <sstream> #include <cctype> #include <set> #include <map> #include <math.h> using namespace ::std; class quartile_result { public: float mean; float median; float lower_quar, upper_quar; float first10_quar, last10_quar; }; ...
fd985ab8f46d1d33071d46d7a8ea6dc623031f2a4930e6b77446f257035dd992
C/C++
1,844
61
#pragma once #include "secondary/architectures/model_config.h" #include <toml.hpp> #include <cstdint> #include <limits> #include <string> #include <unordered_map> namespace dorado::secondary { constexpr int32_t MODEL_CONFIG_MAX_VERSION = std::numeric_limits<int32_t>::max(); enum class ModelConfigValueType { A...
8a10dd1ad032edf904554ebdbd204e2339432440fc5df670945fbfca12039f20
C/C++
1,910
77
#ifndef RLE6_H_ #define RLE6_H_ #include <stdint.h> #ifdef __GNUC__ #define LIKELY(x) __builtin_expect((x),1) #else #define LIKELY(x) (x) #endif #ifdef __cplusplus extern "C" { #endif int rle_insert_cached(uint8_t *block, int64_t x, int a, int64_t rl, int64_t cnt[6], const int64_t ec[6], int *beg, int64_t bc[6]); ...
4b648d6d66fa8ddf3b37872b232a0d77f368ac3df06a8044d41984f8151299b1
C/C++
1,945
65
#pragma once #include "config/BasecallModelConfig.h" #include "config/ModBaseModelConfig.h" #include "model_resolver/ModelSources.h" #include <filesystem> #include <string> #include <vector> namespace dorado::model_resolution { class Models { public: Models(ModelSources sources); Models(const Models&) = del...
c827ef0cd17f32e05ff4d17c2c90ea502bc8951b283c1a2932fbf7f86db655a5
C/C++
1,957
67
/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file stm32f4xx_it.h * @brief This file contains the headers of the interrupt handlers. ****************************************************************************** * @attention * ...
3dd52858b41d9090ac4a94a9e87e0c4826de61560404b324228eb3371d1bbc98
C/C++
1,972
68
#pragma once #include <condition_variable> #include <cstdint> #include <cstdlib> #include <mutex> #include <queue> namespace dorado::utils { // Class to limit access to a resource. // Similar to a counting semaphore but with ordering. class ResourceLimiter { public: // Note: instances of this should be thread_lo...
47a5fa0db6a5aa05f45a53ca7d256794181873def72b76da3be7dc146b2ca068
C/C++
1,974
68
#pragma once #include "utils/cigar.h" #include "utils/overlap.h" #include <cstdint> #include <memory> #include <string> #include <vector> namespace dorado { // Overlaps for error correction struct CorrectionAlignments { // Populated in CorrectionMapperNode::extract_alignments std::string read_name; std:...
d91ed2d2c46474e6610a20711ecdc337270def572924a26f820d0b1c8f386b6b
C/C++
1,980
54
#pragma once #include "alignment/Minimap2Index.h" #include "hts_utils/hts_types.h" #include "read_pipeline/base/messages.h" #include "utils/types.h" #include <minimap.h> #include <memory> #include <string> #include <vector> namespace dorado::alignment { // Exposed for testability extern const std::string UNMAPPED_...
388d6701e0d2995d2eac223cd7f9c6394fd4b25063db69d78bea38fe4a78bbd9
C/C++
1,983
63
#pragma once #include "multi_queue_thread_pool.h" #include "synchronisation.h" #include <condition_variable> #include <memory> #include <mutex> #include <thread> #include <type_traits> namespace dorado::utils::concurrency { // Executor for posting tasks to an underlying thread pool // // N.B. The executor itself is...
2d7c36855d3f34465667864ab160c9b3650aa02227fa2b54bc1701998d1e1c8b
C/C++
1,988
58
#pragma once #include "AuxiliaryData.h" #include "WorkingMemory.h" #include "config/common.h" #include <torch/nn.h> #include <optional> #include <vector> namespace dorado::nn { struct ConvStackImpl : torch::nn::Module { explicit ConvStackImpl(const std::vector<config::ConvParams> &layer_params); #if DORADO_CUD...
5cfb006a6c81d5bd79c2faf5d7ceb90d5e53b8939c94ce84b10af211a0dcc3dc
C/C++
1,997
61
#pragma once #include <cstddef> #include <memory> struct kstring_t; namespace dorado { /// Wrapper for htslib kstring_t struct. class KString { public: /** Contains an uninitialized kstring_t. * Useful for later assigning to a kstring_t returned by an htslib * API function. If you need to pa...
c166006f65ac19d8fe4324d2e04c12912a6ce00d582503cb04d7b45482d27cd3
C/C++
2,045
70
/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.h * @brief : Header for main.c file. * This file contains the common defines of the application. *******************************************...
5ef5d5d4fb6f7df8f4077b9f99839f66dd055e3152d750defa80c8abdeb77edf
C/C++
2,061
59
#pragma once #include <filesystem> #include <optional> #include <set> #include <string> #include <string_view> #include <vector> namespace dorado::models { struct ModelInfo; } namespace httplib { class Client; } // namespace httplib namespace dorado::model_downloader { using namespace models; bool download_model...
3bcea582c1d4518b3c7c4d90fc89b98ea960294af1334b8058556610ad985a3b
C/C++
2,083
66
#pragma once #include <cstdint> #include <iosfwd> #include <string> #include <utility> #include <vector> namespace dorado::secondary { struct RegionInt { int32_t seq_id = -1; int64_t start = 0; int64_t end = -1; }; struct Region { std::string name; int64_t start = 0; int64_t end = -1; }; st...
0fa2b6ebe47b997cd2d8b01ea9a789039dc1ee98bb62f91e194a0158775c2394
C/C++
2,104
72
#pragma once #include "utils/MoveOnlyFunction.h" #include "utils/concurrency/task_priority.h" #include <cstddef> #include <list> #include <memory> #include <queue> #include <vector> namespace dorado::utils::concurrency::detail { using TaskType = utils::MoveOnlyFunction<void()>; struct WaitingTask { WaitingTask...
0d766fe68a0f746b29caa7c6ea1e96c45c5fca50360e1d224c19935a76eb666f
C/C++
2,106
101
/** ****************************************************************************** * @file usbd_req.h * @author MCD Application Team * @brief Header file for the usbd_req.c file ****************************************************************************** * @attention * * Copyright (c) 20...
42f0a4f3f1c4ecf6f5ebda783db89bd9a03fafff82b37f2c1619cd16b7a4ab29
C/C++
2,107
52
#pragma once #include <memory> #include <optional> #include <string> #include <string_view> namespace dorado::alignment { constexpr inline std::string_view DEFAULT_MM_PRESET{"lr:hq"}; class Minimap2IdxOptHolder; class Minimap2MapOptHolder; struct Minimap2IndexOptions { Minimap2IndexOptions(); std::shared_p...
31d357b197ad8b65134a79398b388198cb5607024cf3455c6feef9c2e31b1c3e
C/C++
2,118
66
#pragma once #include <string> #include <string_view> #include <unordered_map> #include <unordered_set> #include <vector> namespace dorado::barcode_kits { struct BarcodeKitScoringParams { int max_barcode_penalty = 9; int barcode_end_proximity = 75; int min_barcode_penalty_dist = 3; int min_separation...
e31b4c54f55248659f61d66fee60ec05347b066c728f4500ffb1a72e0668e14f
C/C++
2,119
69
#pragma once #include "SpeedEntry.h" #include <filesystem> #include <map> #include <mutex> #include <span> #include <string> #include <vector> namespace dorado::batchsize_benchmarks { class BenchmarkCache final { public: // Perform an action with the cache lock held. // Functor will be passed a CacheProxy. ...
1d6c1bb8943bdf427acbc87d8758a38cde5c2c3a6cc136af971f8300c47cb93d
C/C++
2,121
100
#pragma once #ifdef _WIN32 #include <io.h> #define NULL_DEVICE "NUL:" #define Close _close #define Dup _dup #define Dup2 _dup2 #define Fileno _fileno #else #include <unistd.h> #define NULL_DEVICE "/dev/null" #define Close close #define Dup dup #define Dup2 dup2 #define Fileno fileno #endif #include <stdio.h> #includ...
829b102e5bfd11614610f7df9bdc4489d8acc62403164c8a5069fbcc08f4685e
C/C++
2,152
70
#pragma once #include "correct/types.h" #include "read_pipeline/base/MessageSink.h" #include <spdlog/spdlog.h> #include <atomic> #include <filesystem> #include <memory> #include <mutex> #include <queue> #include <string> #include <thread> #include <unordered_set> #include <vector> namespace dorado { class Correcti...
69c1640a3585369fe5ccc0fd25925ba0b2d73c0ae1d747a6773aed481306273f
C/C++
2,154
50
#pragma once #include "Minimap2Options.h" #include <optional> #include <string> #include <string_view> #include <vector> using namespace std::literals; namespace argparse { class ArgumentParser; } namespace dorado::alignment::mm2 { // Retrieves the minimap2 options string from the given args and assigns the remai...
3410a1d6db242dd3e1c0ae1a58a15de5da064cb47f9a28624534846d8100f563
C/C++
2,193
50
#pragma once #include <filesystem> #include <optional> #include <set> #include <string> #include <vector> namespace dorado::utils { const std::string TEMP_MODELS_DIR_PREFIX{".temp_dorado_model-"}; std::string get_extension(const std::filesystem::path& path); std::string get_extension(const std::filesystem::director...
144fd2e2b0c9f42077a8043e4f3dbaad690133c2c572987d3fea454b441f2921
C/C++
2,238
56
#pragma once #include "basecall/MetalCaller.h" namespace dorado::basecall { namespace model { struct MetalCRFModelImpl; } // namespace model class MetalLSTMCaller final : public MetalCaller { public: MetalLSTMCaller(const config::BasecallModelConfig &model_config, float memory_limit_fraction); ~MetalLSTMCa...
8b1aca4bc212b98105bd89c58403fc10aad72e7c1c9e1f3b84f40d711da3d28e
C/C++
2,254
76
#pragma once #include "DecodedChunk.h" #include "config/BasecallModelConfig.h" #include "torch_utils/metal_utils.h" #include <ATen/core/TensorBody.h> #include <c10/core/ScalarType.h> #include <atomic> #include <condition_variable> #include <deque> #include <memory> #include <mutex> #include <thread> #include <vector...
a8781942df2f2b067c87144d59012b072dbe29c9c230cf05ac17d9b3e147ed47
C/C++
2,277
57
#pragma once #include <ATen/core/TensorBody.h> #include <string> #include <tuple> #include <utility> #include <vector> namespace dorado::utils { namespace detail { [[noreturn]] void trim_throw(std::size_t size, const std::pair<int, int>& interval); } // namespace detail // Default trim settings. constexpr float D...
b674fd010ac8814e9bad26d0799a9729cbb75dccbe39768c9558adb52b83c088
C/C++
2,279
62
#pragma once #include "torch_utils/gpu_profiling.h" #include "types.h" #include <ATen/TensorIndexing.h> #include <ATen/ops/empty.h> #include <spdlog/spdlog.h> #include <filesystem> #ifdef NDEBUG #define LOG_TRACE(...) #else #define LOG_TRACE(...) spdlog::trace(__VA_ARGS__) #endif namespace dorado::correction { //...
82aa02335578c4cfa6348998e61570cab82f7a721f49df89a37b16a6c19df52c
C/C++
2,307
66
#pragma once #include "adapter_info.h" #include "hts_utils/hts_types.h" #include "utils/types.h" #include <mutex> #include <string> #include <vector> namespace dorado { namespace adapter_primer_kits { class AdapterPrimerManager; struct Candidate { std::string name; std::string front_sequence; std::stri...
3808ce741d1ce83cd9f8bab616d873c91fd7d1fde6ef952bc35fe4612a76ad64
C/C++
2,315
69
#pragma once #include "utils/AsyncQueue.h" #include "utils/concurrency/Task.h" #include "utils/hardware_interference_size.h" #include <atomic> namespace dorado::utils::concurrency { // A pool of tasks that the workers will pull work from. // // The pool consists of |num_queues| queues, each of size |q_capacity|. cl...
4a5fab82ee97cfddf64056208a861e53a6fb1f59f8199e4dfc0829fd7e1c7055
C/C++
2,336
102
/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : usb_device.h * @version : v1.0_Cube * @brief : Header for usb_device.c file. ****************************************************************************** ...
85365d22cdd45f2997e1747d2ecb59bd2bfc09e2accf43b7f4e17737c8c649ae
C/C++
2,348
89
#pragma once // Backport of std::function_ref. #include <functional> #include <new> #include <type_traits> #include <utility> namespace dorado::utils { namespace detail { template <bool IsConst, typename R, typename... Args> class FunctionRefBase { using FunctionPtr = R (*)(Args...); // |m_invoke| is set ...
0fec79457e010044dae6ebb76e709ad270a6e66b8f4f59dea1adc32c5cdba833
C/C++
2,363
74
#pragma once #include "secondary/common/bam_file.h" #include "secondary/consensus/sample.h" #include "secondary/features/encoder_base.h" #include <ATen/ATen.h> #include <cstdint> #include <mutex> #include <string> #include <vector> namespace dorado::secondary { struct CountsResult { at::Tensor counts; std:...
7ce73b57c77bb433f6e0e4126096257ed3cc99315f272ed59a794789811ee65c
C/C++
2,373
86
#pragma once #include "string_utils.h" namespace dorado::utils { /** * Stream-like object that splits elements on @a Separator. * Note that trailing elements are ignored. */ template <char Separator> class SeparatedStream { std::string_view m_data; bool m_eof = false; template <typename T> static...
528f06a57024d91b8cac119459b5de5a74889cb42bffbb6eed52676897ce8b69
C/C++
2,384
62
/**************************************************************************** ** ** Copyright (c) 2008-2018 C.B. Barber. All rights reserved. ** $Id: //main/2015/qhull/src/libqhullcpp/QhullError.h#4 $$Change: 2549 $ ** $DateTime: 2018/12/28 22:24:20 $$Author: bbarber $ ** ***********************************************...
c230899c6f73aa899267578f9fa5c019655315916481f8e57dc961a3b0f38092
C/C++
2,403
73
#pragma once // TSan's init breaks the call to __cpu_indicator_init (which determines which implementation to take) #if defined(__GNUC__) && defined(__x86_64__) && !defined(__clang__) && !defined(__SANITIZE_THREAD__) #define ENABLE_AVX2_IMPL 1 #include <immintrin.h> #else #define ENABLE_AVX2_IMPL 0 #endif #if defined...
fc7ffbed8ff7752453bb510493b43165ef29f4c5091e50fb6d0c4c8652d4f560
C/C++
2,422
113
/** ****************************************************************************** * @file usbd_ioreq.h * @author MCD Application Team * @brief Header file for the usbd_ioreq.c file ****************************************************************************** * @attention * * Copyright (c...
3c21dfc5dda858c7b1968610e185f1822d33fe2e31f46a5a8dbc43d9e37f82e3
C/C++
2,441
60
#pragma once #include "read_pipeline/base/ReadPipeline.h" #include "utils/types.h" #include <cstdint> #include <map> #include <memory> #include <string> #include <variant> #include <vector> namespace dorado { namespace basecall { class ModelRunnerBase; using RunnerPtr = std::unique_ptr<ModelRunnerBase>; } // names...
e07411a427e650242104956a92eba68e4c0c407547d20d0526268d2acba3a177
C/C++
2,484
66
#pragma once #include "data_loader/DataLoader.h" #include "read_pipeline/base/ReadPipeline.h" #include <memory> #include <vector> class MessageSinkToVector : public dorado::MessageSink { public: MessageSinkToVector(size_t max_messages, std::vector<dorado::Message>& messages) : MessageSink(max_message...
42ffa0bbcec626f25cbaafd04f16c1f0628598aa08e7649b36b444c4fe6af5ff
C/C++
2,511
70
#pragma once #include "Minimap2IndexSupportTypes.h" #include "Minimap2Options.h" #include "hts_utils/header_sq_record.h" #include <minimap.h> #include <memory> #include <optional> #include <string> #include <utility> #include <vector> namespace dorado::alignment { struct IndexReaderDeleter { void operator()(mm...
76612dafb17072fda18273e325ae290297830db83124991f8f17bd07f7f73a8e
C/C++
2,558
76
#pragma once #include "utils/stats.h" #include <ATen/core/TensorBody.h> #if DORADO_CUDA_BUILD #include <c10/cuda/CUDAStream.h> #endif #include <atomic> #include <string> #include <vector> namespace dorado::config { struct ModBaseModelConfig; } namespace dorado::modbase { class ModBaseCaller; class ModBaseRunner {...
9d85caed061945147c877efab2e3685064815849dd317d7918d66732b833053c
C/C++
2,577
61
/** ****************************************************************************** * @file usbd_desc_template.h * @author MCD Application Team * @brief Header for usbd_desc_template.c module ****************************************************************************** * @attention * * Cop...
17f724f8c73f6910607ea04360a9f6ee782bb2397cb8165fddfa2203e3475e88
C/C++
2,619
119
#ifndef SCALAR_SSE_H #define SCALAR_SSE_H #include <assert.h> #include <stdint.h> #include <string.h> typedef union m128i { uint8_t u8[16]; int16_t i16[8]; } __m128i; static inline __m128i _mm_set1_epi32(int32_t n) { assert(n >= 0 && n <= 255); __m128i r; memset(&r, n, sizeof r); return r; } static inline __m12...
c847b6e640ba3e4dfd8d89e4dcbcd6f17b50fa013343b39d2a7bd6c607841a4b
C/C++
2,640
131
#ifndef KSTRING_H #define KSTRING_H #include <stdlib.h> #include <string.h> #include <stdarg.h> #ifdef USE_MALLOC_WRAPPERS # include "malloc_wrap.h" #endif #ifndef kroundup32 #define kroundup32(x) (--(x), (x)|=(x)>>1, (x)|=(x)>>2, (x)|=(x)>>4, (x)|=(x)>>8, (x)|=(x)>>16, ++(x)) #endif #ifndef KSTRING_T #define KSTR...
e3d9afe7ddbbf3ca34a8591585f8dbba7b5afb94cc14257313faad8c41ee0a89
C/C++
2,644
54
#pragma once #include <ATen/ATen.h> #include <cstdint> #include <string> #include <tuple> #include <vector> namespace dorado::secondary { std::tuple<at::Tensor, std::vector<std::string>> reorder_chunk( const at::Tensor& chunk, const std::vector<std::string>& prev_rids_out, const std::vector<...
0b8b5831c7d5c0ec4fa679371a6ee28511ec1be5009c3d7346ef0168a46397a4
C/C++
2,651
69
#pragma once #include "alignment/BedFileAccess.h" #include "alignment/IndexFileAccess.h" #include "alignment/Minimap2Options.h" #include "hts_utils/header_sq_record.h" #include "read_pipeline/base/ClientInfo.h" #include "read_pipeline/base/MessageSink.h" #include "utils/concurrency/AsyncExecutor.h" #include <memory> ...
a6be4e284ffc49e20ad2de8198c7ccbed79c00b570b1f7b7583efd0b01b4ae75
C/C++
2,672
78
#pragma once #include "utils/parameters.h" #include <filesystem> #include <optional> #include <string> namespace dorado::config { // Stores basecaller parameters and manages the overwrite priority from various setters // where Default < Config < CLI Argument < Forced. class BatchParams { public: // Overwrite pr...
4daca69dcca06289f6108340714f19f9f9dbe4a54b36c72eecf9dbe999395bb2
C/C++
2,782
68
#pragma once #include <ATen/core/TensorBody.h> #include <cstddef> #include <filesystem> #include <iosfwd> #include <string> #include <vector> namespace dorado::utils { // Serialise Torch tensor to disk. void serialise_tensor(const at::Tensor& t, const std::string& path); // Load serialised tensor from disk. std::ve...
fad7764eecd0a7b024e083d3d704549e027f86bbf67a5acf8e67fe16d0c991ec
C/C++
2,784
107
#pragma once #include "kits.h" #include <iosfwd> #include <set> namespace dorado::models { /* Enumerate the options available for auto model selection. `UNRECOGNISED` is used to default back to a path */ enum class ModelVariant : uint16_t { AUTO, FAST, HAC, SUP, NONE // NONE must be last }; /...
7bb9ea3b89406c4afb9ce3ce60ccc2f3c0c6bef20bae8416343beef5a0d0d783
C/C++
2,792
93
#pragma once #include <cstdint> #include <memory> #include <variant> namespace dorado { class ClientInfo; class DuplexRead; class HtsData; class ReadCommon; class SimplexRead; struct CorrectionAlignments; struct ReadPair; using CorrectionAlignmentsPtr = std::unique_ptr<CorrectionAlignments>; using DuplexReadPtr = s...
f4d2f9f9d071cb5a01562181a81c8d4da3ddfbde435486bee880d8f7b83aac3c
C/C++
2,805
69
#pragma once #include <ATen/Tensor.h> #include <filesystem> #include <iosfwd> #include <vector> namespace dorado::correction { // clang-format off struct OverlapWindow { // CorrectionAlignments overlap vector index int overlap_idx = -1; int win_tstart = -1; // Window target start position. ...
5f0de5db377ad373d4c844a3cbd45224844635e383e2ca9b5bc96f32ee2985d7
C/C++
2,819
131
/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : usbd_cdc_if.h * @version : v1.0_Cube * @brief : Header for usbd_cdc_if.c file. *****************************************************************************...
47d49ae7b6a5318a5100ece61d0e220f11a5c373add8fdf09b5e3995cc747721
C/C++
2,838
101
#pragma once #include "config/ModBaseModelConfig.h" #include "modbase/MotifMatcher.h" #include "torch_utils/module_utils.h" #include "utils/stats.h" #if DORADO_CUDA_BUILD #include <c10/cuda/CUDAStream.h> #endif #include <torch/nn.h> #include <atomic> #include <condition_variable> #include <deque> #include <filesystem...
ac1eee56a3a79bf601060461329dab3615ccb9caad7a1cb577c81d038fca2896
C/C++
2,842
92
/* The MIT License Copyright (c) 2018- Dana-Farber Cancer Institute 2009-2018 Broad Institute, Inc. 2008-2009 Genome Research Ltd. (GRL) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ...
23106f81a993f61420c7858bea7a30440e66b55bd278cceb2a79880e791cb627
C/C++
2,846
87
#pragma once #include "hts_utils/HeaderMapper.h" #include "hts_utils/hts_file.h" #include "interface.h" #include <memory> #include <string> namespace dorado { class HtsData; namespace hts_writer { using OutputMode = utils::HtsFile::OutputMode; struct HtsFileWriterConfig { OutputMode mode; int threads; ...
4542baf8ffe78bfe442714756af696ce0b01ab746a6d7f59d528f60f9b1df24d
C/C++
2,872
91
#pragma once #include <ATen/Tensor.h> #include <torch/nn/module.h> #include <torch/nn/modules/activation.h> #include <torch/nn/modules/batchnorm.h> #include <torch/nn/modules/container/modulelist.h> #include <torch/nn/modules/container/sequential.h> #include <torch/nn/modules/conv.h> #include <torch/nn/modules/dropout...
fee9de3e6a2fcda5ad382a00714f2f6365934b5a2ad538a8188c58826c1ca76e
C/C++
2,874
64
#pragma once #include "sample.h" #include "secondary/common/region.h" #include <cstdint> #include <iosfwd> #include <optional> #include <vector> namespace dorado::secondary { struct TrimInfo { int64_t start = 0; int64_t end = -1; bool heuristic = false; }; /** * \brief Checks the start/end coordinates...
bf3213aee2ffb202df135fe82218426084138bac593b1f174cb437a58a779f7c
C/C++
2,900
94
#pragma once #include "CorrectionAligner.h" #include "aligner/Minimap2Aligner.h" #include "alignment/Minimap2Index.h" #include "read_pipeline/base/messages/CorrectionAlignments.h" // GCC 11's unordered_map needs this #include "utils/AsyncQueue.h" #include "utils/stats.h" #include <atomic> #include <condition_variabl...
83e947a1ce86e4208d56f2f43174f213d2a6147d25728d21d427cb6d2998f6e5
C/C++
2,906
68
#pragma once #include "demux/AdapterDetector.h" #include "demux/adapter_info.h" #include <string> #include <unordered_map> #include <vector> namespace dorado::adapter_primer_kits { class AdapterPrimerManager { public: /** Default Constructor. * This provides a manager that uses the above hard-coded adapte...
7ab22e862455ff23db3bc51e55b42d9e1c4154b138d124151bfc77b2d2d2fefa
C/C++
2,930
66
#pragma once #include <ATen/ATen.h> #include <torch/nn/module.h> #include <optional> namespace dorado::secondary { /** * \brief Attention helper which dispatches to FlashAttention3 when available and falls back to * PyTorch SDPA otherwise. */ class FlashAttentionModuleImpl : public torch::nn::Module { pub...
2de8f782e72568fb58521bd7abcfb8da89697ee3d95dcd6ce908c88800b34ee4
C/C++
2,938
94
#pragma once #include "SimpleProgressBar.h" #include "utils/stats.h" #include <chrono> #include <cstdint> #include <map> #include <string> namespace dorado { // Collect and calculate throughput related // statistics for the pipeline to track dorado // overall performance. class ProgressTracker { public: enum Mo...
2cff5fdf95ac9bca216a1cfea00f74b5c84f3faa19878974485873074cac37af
C/C++
2,940
94
/* The MIT License Copyright (c) 2008, by Attractive Chaos <attractor@live.co.uk> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation ...
d8fa7735942ce49c45be89e732f07bd36c70b75dbeff6ee1877b07741544491c
C/C++
2,977
143
/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : usbd_desc.c * @version : v1.0_Cube * @brief : Header for usbd_conf.c file. ****************************************************************************** ...
cb4bf84d0e09361c150fc2f74e470919cd206ec710d421dc79ab50f6b4b3070e
C/C++
2,997
67
#pragma once #include <ATen/core/TensorBody.h> #include <cstdint> #include <string> #include <utility> #include <vector> namespace dorado::modbase { /// Calculates new scaling values for improved modified base detection class ModBaseScaler { private: const std::vector<float>& m_kmer_levels; const size_t m_k...
520ef4eeba44a2caaafcd38b8fe9237d021a4dde03b95fdef0927a475d748615
C/C++
3,077
103
#pragma once #include <array> #include <cstdint> #include <iosfwd> #include <string> #include <tuple> #include <vector> namespace dorado { // clang-format off // Enum for handling CIGAR ops enum class CigarOpType : uint8_t { M = 0, // Alignment match. Can be either = or X. I = 1, // Inserti...
4db5f99eb0ad1638bc1e725bc23c5a144d89981c9f17ca3b54a2662b2eeeb497
C/C++
3,087
86
#pragma once #include "config/BasecallModelConfig.h" #include "torch_utils/metal_utils.h" #include <torch/nn.h> #include <vector> namespace dorado::nn::metal { struct MetalLinearImpl : torch::nn::Module { MetalLinearImpl(int insize, int outsize, bool has_bias); }; TORCH_MODULE(MetalLinear); struct MetalConv1...