22 return ch ==
'\n' ||
ch ==
'\r' ||
ch ==
' ' ||
ch ==
'\t';
34 std::vector<fastx_sequence_extent>
extents;
35 size_t sequence = std::string_view::npos;
36 size_t header = data.find(
'>');
37 while (header != std::string_view::npos) {
38 if (header != 0 && data[header - 1] !=
'\n' && data[header - 1] !=
'\r') {
39 header = data.find(
'>', header + 1);
42 if (sequence != std::string_view::npos && header > sequence) {
43 extents.push_back({data.data() + sequence, data.data() + header});
46 sequence = end < data.size() ? end + 1 : data.size();
47 header = data.find(
'>', sequence);
49 if (sequence != std::string_view::npos && sequence < data.size()) {
50 extents.push_back({data.data() + sequence, data.data() + data.size()});
116 std::vector<fastx_sequence_span>
spans;
211 spans.push_back(std::move(span));
constexpr bool fastx_is_sequence_whitespace(char ch) noexcept
True for bytes that FASTA sequence consumers conventionally skip between bases.
size_t fastx_line_end(std::string_view data, size_t position)
consteval bool separatorPositionAlwaysEncodesInvalid(char *input, uint64_t separatorPosition, uint64_t index)
Recursively tests whether placing the separator byte at any position in an input of valid bytes alway...
std::vector< fastx_sequence_span > fastx_split_sequence_spans(std::vector< fastx_sequence_extent > const &extents, uint32_t seed_bases, uint32_t count)
Splits the combined FASTA sequence stream into count contiguous spans.
std::vector< fastx_sequence_extent > fastx_fasta_extents(std::string_view data)
Collects the sequence extents of every FASTA record in data.
constexpr __host__ __device__ static __forceinline__ uint8_t encode(const char *input)
Maps one byte to a 2-bit symbol index, or invalidSymbol.
static constexpr uint8_t invalidSymbol
Sentinel returned by encode for invalid input bytes.
A contiguous run of sequence bytes (record header lines excluded).
One parallel scan span of the combined FASTA sequence stream.
std::vector< std::string_view > segments