Skip to content

Commit bb60f86

Browse files
committed
Use standard process and exponential functions on OS X
1 parent b9db18a commit bb60f86

4 files changed

Lines changed: 20 additions & 20 deletions

File tree

src/BAFpileup.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ float BAFpileup::calculateFlankLength(std::string const& mateFileName, std::stri
7777
command = "gzip -c -d "+mateFileName;
7878
}
7979
stream =
80-
#if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__))
80+
#if defined(_WIN32)
8181
_popen(command.c_str(), "r");
8282
#else
8383
popen(command.c_str(), "r");
@@ -124,7 +124,7 @@ float BAFpileup::calculateFlankLength(std::string const& mateFileName, std::stri
124124
fragmentLength = fragmentLength/j;
125125
float flanks = fragmentLength/2;
126126
if (zgOrbam) {
127-
#if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__))
127+
#if defined(_WIN32)
128128
_pclose(stream);
129129
#else
130130
pclose(stream);
@@ -233,13 +233,13 @@ std::string BAFpileup::intersectWithBedtools(std::string makeminipileup, std::st
233233
string command = pathToBedtools_ +" intersect -a " + makeminipileup + " -b " + bedFileWithRegionsOfInterest + " > " + intersected;
234234

235235
stream =
236-
#if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__))
236+
#if defined(_WIN32)
237237
_popen(command.c_str(), "w");
238238
#else
239239
popen(command.c_str(), "w");
240240
#endif
241241

242-
#if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__))
242+
#if defined(_WIN32)
243243
_pclose(stream);
244244
#else
245245
pclose(stream);
@@ -283,13 +283,13 @@ std::string BAFpileup::createPileUpFile(std::string outputDir, std::string samto
283283
}
284284

285285
stream =
286-
#if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__))
286+
#if defined(_WIN32)
287287
_popen(command.c_str(), "w");
288288
#else
289289
popen(command.c_str(), "w");
290290
#endif
291291

292-
#if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__))
292+
#if defined(_WIN32)
293293
_pclose(stream);
294294
#else
295295
pclose(stream);

src/GenomeCopyNumber.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ void GenomeCopyNumber::fillMyHash(std::string const& mateFileName ,std::string c
320320

321321
inputFormat = getInputFormat(myInputFormat);
322322
stream =
323-
#if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__))
323+
#if defined(_WIN32)
324324
_popen(command.c_str(), "r");
325325
#else
326326
popen(command.c_str(), "r");
@@ -330,7 +330,7 @@ void GenomeCopyNumber::fillMyHash(std::string const& mateFileName ,std::string c
330330
count++;
331331
normalCount+=processRead(inputFormat,matesOrientation,line_buffer, bin,targetBed, mateFileName);
332332
}
333-
#if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__))
333+
#if defined(_WIN32)
334334
_pclose(stream);
335335
#else
336336
pclose(stream);

src/SNPinGenome.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ void SNPinGenome::readSNPs(std::string const& inFile)
119119
char buffer[MAX_BUFFER];
120120
string command = "gzip -cd "+inFile;
121121
stream =
122-
#if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__))
122+
#if defined(_WIN32)
123123
_popen(command.c_str(), "r");
124124
#else
125125
popen(command.c_str(), "r");
@@ -129,7 +129,7 @@ void SNPinGenome::readSNPs(std::string const& inFile)
129129
if (line_buffer[0] == '#') continue;
130130
count+=processSNPLine(ifVCF,line_buffer,myChr,index,previousPos);
131131
}
132-
#if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__))
132+
#if defined(_WIN32)
133133
_pclose(stream);
134134
#else
135135
pclose(stream);
@@ -390,14 +390,14 @@ void SNPinGenome::assignValues(std::string const& inFile, string inputFormat, in
390390
if (inFile.substr(inFile.size()-3,3).compare(".gz")==0) {
391391
string command = "gzip -cd "+inFile;
392392
FILE* stream =
393-
#if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__))
393+
#if defined(_WIN32)
394394
_popen(command.c_str(), "r");
395395
#else
396396
popen(command.c_str(), "r");
397397
#endif
398398
readPileUP(stream, minimalTotalLetterCountPerPosition, minimalQualityPerPosition, p_genomeCopyNumber);
399399

400-
#if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__))
400+
#if defined(_WIN32)
401401
_pclose(stream);
402402
#else
403403
pclose(stream);

src/myFunc.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -277,15 +277,15 @@ long getLineNumber(std::string const& fileName, const std::string& pathToSamtool
277277
if (fileName.substr(fileName.size()-3,3).compare(".gz")==0) {
278278
string command = "gzip -cd "+fileName;
279279
stream =
280-
#if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__))
280+
#if defined(_WIN32)
281281
_popen(command.c_str(), "r");
282282
#else
283283
popen(command.c_str(), "r");
284284
#endif
285285
while ( fgets(buffer, MAX_BUFFER, stream) != NULL ) {
286286
count++;
287287
}
288-
#if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__))
288+
#if defined(_WIN32)
289289
_pclose(stream);
290290
#else
291291
pclose(stream);
@@ -305,7 +305,7 @@ long getLineNumber(std::string const& fileName, const std::string& pathToSamtool
305305
cout << "..samtools should be installed to be able to read BAM files\n";
306306
}
307307
stream =
308-
#if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__))
308+
#if defined(_WIN32)
309309
_popen(command.c_str(), "r");
310310
#else
311311
popen(command.c_str(), "r");
@@ -314,7 +314,7 @@ long getLineNumber(std::string const& fileName, const std::string& pathToSamtool
314314
while ( fgets(buffer, MAX_BUFFER, stream) != NULL ) {
315315
count++;
316316
}
317-
#if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__))
317+
#if defined(_WIN32)
318318
_pclose(stream);
319319
#else
320320
pclose(stream);
@@ -353,7 +353,7 @@ long getReadNumberFromPileup(std::string const& fileName) {
353353
char buffer[MAX_BUFFER];
354354
string command = "gzip -cd "+fileName;
355355
stream =
356-
#if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__))
356+
#if defined(_WIN32)
357357
_popen(command.c_str(), "r");
358358
#else
359359
popen(command.c_str(), "r");
@@ -373,7 +373,7 @@ long getReadNumberFromPileup(std::string const& fileName) {
373373
}
374374
strs.clear();
375375
}
376-
#if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__))
376+
#if defined(_WIN32)
377377
_pclose(stream);
378378
#else
379379
pclose(stream);
@@ -1224,7 +1224,7 @@ string pathAppend(const string& p1, const string& p2) {
12241224
char sep = '/';
12251225
string tmp = p1;
12261226
char sep2=sep;
1227-
#if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__))
1227+
#if defined(_WIN32)
12281228
sep2 = '\\';
12291229
#endif
12301230
char lastSymb= p1[p1.length( )-1];
@@ -2496,7 +2496,7 @@ void myReplace(std::string& str, const std::string& oldStr, const std::string& n
24962496
}
24972497

24982498

2499-
#if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__))
2499+
#if defined(_WIN32)
25002500
double expm1(double x) {
25012501
if (fabs(x) < 1e-5)
25022502
return x + 0.5*x*x;

0 commit comments

Comments
 (0)