File: SeqUtils_gtest.cpp

package info (click to toggle)
pbseqlib 0~20161219-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,924 kB
  • ctags: 5,123
  • sloc: cpp: 82,727; makefile: 305; python: 239; sh: 8
file content (50 lines) | stat: -rw-r--r-- 1,236 bytes parent folder | download | duplicates (4)
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
/*
 * =====================================================================================
 *
 *       Filename:  SeqUtils_gtest.cpp
 *
 *    Description:  Test pbdata/SeqUtils.hpp, SeqUtils_Impl.hpp
 *
 *        Version:  1.0
 *        Created:  10/29/2012 05:21:58 PM
 *        Updated:  08/18/2014 05:49:51 PM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Yuan Li (yli), yli@pacificbiosciences.com
 *        Company:  Pacific Biosciences
 *
 * =====================================================================================
 */
#include "gtest/gtest.h"
#include "SeqUtils.hpp"

TEST(SeqUtils, OnlyACTG){
    DNASequence seq;
    Nucleotide seqnt[] = "ATGC";
    seq.seq = seqnt;
    seq.length = 4;
    EXPECT_EQ(OnlyACTG(seq), 1);

    Nucleotide seqnt1[] = "ATXYZ";
    seq.seq = seqnt1;
    seq.length = 5;
    EXPECT_EQ(OnlyACTG(seq), 0);
}

TEST(SeqUtils, CountMasked){
    DNASequence seq;
    Nucleotide seqnt[] = "ATGCNNNNNNATGC";
    seq.seq = seqnt;
    seq.length = 14;
    EXPECT_EQ(CountMasked(seq), 6);
}

TEST(SeqUtils, CountNotMasked){
    DNASequence seq;
    Nucleotide seqnt[] = "ATGCNNNNNNATGC";
    seq.seq = seqnt;
    seq.length = 14;
    EXPECT_EQ(CountNotMasked(seq), 8);

}