1 // Reads a motif file defined using gassiplex channel and converts
2 // it (using GCToBerg.dat file) into a motif file using berg pin numbering
3 // (as used by mapping software).
9 void readGCToBerg(std::vector<int>& gc2berg)
13 std::ifstream in("GCToBerg.dat");
17 while ( in >> gc >> berg )
19 gc2berg.push_back(berg);
25 void convertMotif(const char* inputfile, const char* outputfile)
27 std::vector<int> gc2berg;
29 readGCToBerg(gc2berg);
31 std::ifstream in(inputfile);
32 std::ofstream out(outputfile);
36 while ( in.getline(line,80) )
41 // Comment line. No change.
42 out << line << std::endl;
46 std::string sline(line);
48 int gc = atoi(sline.c_str());
49 // assume the first 2 characters only are the gc number,
50 // so replace them with berg number.
51 int berg = gc2berg[gc];
52 out << berg << "\t1\t" << n << "\t-" << std::endl;