forked from ChaissonLab/SegDupAnnotation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCountContig.cpp
More file actions
43 lines (42 loc) · 745 Bytes
/
CountContig.cpp
File metadata and controls
43 lines (42 loc) · 745 Bytes
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
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int nl=0, nh=0, other=0;
vector<int> low(256,0), high(256,0);
string prevTitle = "";
int start, cur;
char prev='Z';
while (cin) {
string line;
cin >> line;
if (line.size() > 0 and line[0] == '>') {
cerr << "proc " << line << endl;
if (prev == 'Z') {
cout << cur-prev << endl;
}
cur=0;
start=0;
prev='A';
}
else {
for (int i=0; i < line.size(); i++) {
if ( line[i] == 'N' or line[i] == 'n') {
if (prev != 'n') {
cout << cur - start<< endl;
}
prev='n';
}
else {
cur++;
if (prev == 'n') {
start = 0;
cur=0;
}
prev=line[i];
}
}
}
}
}