File: UnalignedSequence.h

package info (click to toggle)
libseqlib 1.1.2%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,508 kB
  • sloc: cpp: 7,176; sh: 805; makefile: 60
file content (60 lines) | stat: -rw-r--r-- 1,932 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef SEQLIB_UNALIGNED_SEQ_H
#define SEQLIB_UNALIGNED_SEQ_H

extern "C" {
  #include "bwa/bwa.h"
  #include "bwa/bwt.h"
  #include "bwa/bntseq.h"
  #include "bwa/kseq.h"
  #include <stdlib.h>
  #include "bwa/utils.h"
  #include "bwa/bwamem.h"
  int is_bwt(ubyte_t *T, int n);
  KSEQ_DECLARE(gzFile)
}


#include <cstring>
#include <vector>

namespace SeqLib {

  /** Structure to hold unaligned sequence (name and bases)
   */
  struct UnalignedSequence {
  
    /** Construct an empty sequence */
    UnalignedSequence() {}
  
    /** Construct an unaligned sequence with name and sequence
     * @param n Name of the sequence 
     * @param s Sequence, stored as ACTG or N characters
     */
    UnalignedSequence(const std::string& n, const std::string& s) : Name(n), Seq(s), Qual(std::string()), Strand('*') {}

    /** Construct an unaligned sequence with name, sequence and quality score
     * @param n Name of the sequence 
     * @param s Sequence, stored as ACTG or N characters
     * @param q Quality string
     */
    UnalignedSequence(const std::string& n, const std::string& s, const std::string& q) : Name(n), Seq(s), Qual(q), Strand('*') {}

    /** Construct an unaligned sequence with name, sequence, quality score and strand
     * @param n Name of the sequence 
     * @param s Sequence, stored as ACTG or N characters
     * @param q Quality string
     * @param t Strand of the sequence, one of '*', '+', '-'
     */
    UnalignedSequence(const std::string& n, const std::string& s, const std::string& q, char t) : Name(n), Seq(s), Qual(q), Strand(t) {}

     std::string Name; ///< Name of the contig
     std::string Seq;  ///< Sequence of the contig (upper-case ACTGN)
     std::string Qual; ///< Quality scores
     char Strand;      ///< Strand of the sequence. Default is '*'
  };

  typedef std::vector<UnalignedSequence> UnalignedSequenceVector; ///< A collection of unaligned sequences

}

#endif