Debian Codegraph @

SeqLib/UnalignedSequence.h

raw symbols SCIP
1 #ifndef SEQLIB_UNALIGNED_SEQ_H
2 #define SEQLIB_UNALIGNED_SEQ_H
3
4 extern "C" {
5 #include "bwa/bwa.h"
6 #include "bwa/bwt.h"
7 #include "bwa/bntseq.h"
8 #include "bwa/kseq.h"
9 #include <stdlib.h>
10 #include "bwa/utils.h"
11 #include "bwa/bwamem.h"
12 int is_bwt(ubyte_t *T, int n);
13 KSEQ_DECLARE(gzFile)
14 }
15
16
17 #include <cstring>
18 #include <vector>
19 #include <iostream>
20
21 namespace SeqLib {
22
23 /** Structure to hold unaligned sequence (name and bases)
24 */
25 struct UnalignedSequence {
26
27 /** Construct an empty sequence */
28 UnalignedSequence() {}
29
30 /** Construct an unaligned sequence with name and sequence
31 * @param n Name of the sequence
32 * @param s Sequence, stored as ACTG or N characters
33 */
34 UnalignedSequence(const std::string& n, const std::string& s) : Name(n), Com(std::string()), Seq(s), Qual(std::string()), Strand('*') {}
35
36 /** Construct an unaligned sequence with name, sequence and quality score
37 * @param n Name of the sequence
38 * @param s Sequence, stored as ACTG or N characters
39 * @param q Quality string
40 */
41 UnalignedSequence(const std::string& n, const std::string& s, const std::string& q) : Name(n), Com(std::string()), Seq(s), Qual(q), Strand('*') {}
42
43 /** Construct an unaligned sequence with name, sequence, quality score and strand
44 * @param n Name of the sequence
45 * @param s Sequence, stored as ACTG or N characters
46 * @param q Quality string
47 * @param t Strand of the sequence, one of '*', '+', '-'
48 */
49 UnalignedSequence(const std::string& n, const std::string& s, const std::string& q, char t) : Name(n), Com(std::string()), Seq(s), Qual(q), Strand(t) {}
50
51 std::string Name; ///< Name of the contig
52 std::string Com; ///< Comment of the contig
53 std::string Seq; ///< Sequence of the contig (upper-case ACTGN)
54 std::string Qual; ///< Quality scores
55 char Strand; ///< Strand of the sequence. Default is '*'
56
57 /** Output an unaligned sequence to ostream
58 * @param os ostream
59 * @param us UnalignedSequence
60 */
61 friend std::ostream& operator<<(std::ostream& os, const SeqLib::UnalignedSequence& us){
62 os << "@" << us.Name << " " << us.Com << "\n";
63 os << us.Seq << "\n+\n";
64 os << us.Qual << "\n";
65 return os;
66 }
67 };
68
69 typedef std::vector<UnalignedSequence> UnalignedSequenceVector; ///< A collection of unaligned sequences
70
71 }
72
73 #endif