Major analysis server update. Had to switch to a new server, and used the opportunity...
[htsworkflow.git] / htswanalysis / src / ValidationDesign / refine_peaks.cpp
index a1009226070e87554a0fd4342585c3365143dae1..9d3778b464b401fd5f58ee73528ab6a3bbe5b96c 100644 (file)
@@ -48,7 +48,7 @@ int main(int argc, char** argv) {
   if (pid == 0) {
     dup2(pipe_to_primer[0], 0); close(pipe_to_primer[1]);
     //dup2(pipe_from_primer[1], 1); close(pipe_from_primer[0]);
-    if (execl(PRIMER_3_PATH,  "primer3_core", NULL) == -1){ cerr << "execl error!" << endl; exit(1); }
+    if (execlp("primer3_core","primer3_core", NULL) == -1){ cerr << "execl error!" << endl; exit(1); }
   } else {
     dup2(pipe_to_primer[1], 1); close(pipe_to_primer[0]);
     //dup2(pipe_from_primer[0], 0); close(pipe_from_primer[1]);
@@ -115,8 +115,11 @@ void read_windows(const char* filename, Windows& windows) {
 
   ifstream feat(filename);
   unsigned int N = 0;
+
+  //remove header line
+  char line[1024];
+  feat.getline(line,1024,'\n');
   while(feat.peek() != EOF) {
-    char line[1024];
     feat.getline(line,1024,'\n');
     N++;
     string line_str(line);
@@ -167,8 +170,9 @@ void read_align_file(char* filename, Reads& features) {
   char strand_str[2]; strand_str[1] = '\0';
   ifstream seqs(filename);
   string name("");
+
+  char line[2048];
   while(seqs.peek() != EOF) {
-    char line[2048];
     seqs.getline(line,2048,'\n');
 
     string line_str(line);
@@ -263,6 +267,8 @@ void outputPrimer3Input(Windows& peaks, Windows& calls) {
   cout <<   "PRIMER_OPT_SIZE=23" << endl;
   cout <<   "PRIMER_MIN_SIZE=19" << endl;
   cout <<   "PRIMER_MAX_SIZE=26" << endl;
+  cerr << peaks.size() << " peaks\n";
+  cerr << calls.size() << " calls\n";
   cout <<   "PRIMER_MIN_TM=63" << endl;
   cout <<   "PRIMER_OPT_TM=65" << endl;
   cout <<   "PRIMER_MAX_TM=67" << endl;