Convert vertor<dna5> to std:string
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
Research direction
Start with the seqan3::sequence_file_input loop and inspect the type of seq returned for the selected fields. Check the library's documented conversion or formatting facilities for representing that sequence as std::string; done means the FASTA sequences can be handled as standard C++ strings.
Written by the indexing model from the issue text.
Description
Platform
- SeqAn version: 3.2.0
- Operating system: Ubuntu
- Compiler: 11.4
Question
With the following code, is there any way to Convert vertor to std:string as I want to handle C++ standard string?
Thanks,
Hai
auto input = R"(>TEST1
ACGT
>Test2
AGGCTGA
>Test3
GGAGTATAATATATATATATATAT)";
int main(int argc, const char *argv[]) {
using sequence_file_input_type =
seqan3::sequence_file_input<seqan3::sequence_file_input_default_traits_dna,
seqan3::fields<seqan3::field::seq, seqan3::field::id>,
seqan3::type_list<seqan3::format_fasta>>;
sequence_file_input_type fin{std::istringstream{input}, seqan3::format_fasta{}};
// Retrieve the sequences and ids.
for (auto &[seq, id]: fin) {
seqan3::debug_stream << "ID: " << id << '\n';
seqan3::debug_stream << "SEQ: " << seq << '\n';
// a quality field also exists, but is not printed, because we know it's empty for FASTA files.
}
return 0;
}
- Dominant language
- C++
- Stars
- 463
- Forks
- 90
- Avg merge
- 1h 11m
- Merged PRs (30d)
- 3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from seqan/seqan3
-
bug
-
bug
-
question
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
question
-
feature/proposal
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Sensor initialization takes very long when `--initial-sim-time` is set to current UNIX timestamp Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
gazebosim/gz-sensors#662 · 1 comment ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
LadybirdBrowser/ladybird#12123 ·