-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPairReadsSimulation.cpp
61 lines (49 loc) · 1.3 KB
/
PairReadsSimulation.cpp
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
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include "stringutils.h"
#include <unistd.h>
#include "fasta.h"
#include "fasta.cpp"
#include "fastq.h"
#include "readsimulator.h"
#include "AluSimulation.h"
using namespace std;
void GenPair(string inputGenome, string& pair)
{
// function is only responsible of making 100bp reads
int pos=0;
// int end=99;
int pairL=100;
while(pos<inputGenome.length()-99)
{
pair= inputGenome.substr(pos, pairL);
cout<<pair<< endl;
cout<< pair.length()<<endl;
pos++;
}
return;
}
int main ()
{
FASTAReader myReader("../data/g10k.fasta");
vector<FASTARecord> myGenome;
myReader.GetSequence(myGenome);
string g10k = myGenome[0].GetSequence();
string pair;
GenPair(g10k, pair);
FASTARecord fasta_pair("g10k_pair.fa", pair);
vector<FASTARecord> readPair;
readPair.push_back(fasta_pair);
WriteFasta("../data/g10k_pair.fa", readPair);
// a string that reads from pos~end, with length 100
// string pair= inputGenome.substr(pos,pairL);
// cout<< "pair with 100 bp reads"<< pair << endl;
// cout<< "pair length"<< pair.length()<< endl;
//push this string into a string array to store
// PairReads.push_back(pair);
// WriteFasta("../data/pairReads_test.fa", PairReads)
//}
//return PairReads;
}