diff --git a/src/BAFpileup.cpp b/src/BAFpileup.cpp index fb35e98..6fc0e75 100644 --- a/src/BAFpileup.cpp +++ b/src/BAFpileup.cpp @@ -77,7 +77,7 @@ float BAFpileup::calculateFlankLength(std::string const& mateFileName, std::stri command = "gzip -c -d "+mateFileName; } stream = - #if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__)) + #if defined(_WIN32) _popen(command.c_str(), "r"); #else popen(command.c_str(), "r"); @@ -124,7 +124,7 @@ float BAFpileup::calculateFlankLength(std::string const& mateFileName, std::stri fragmentLength = fragmentLength/j; float flanks = fragmentLength/2; if (zgOrbam) { - #if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__)) + #if defined(_WIN32) _pclose(stream); #else pclose(stream); @@ -233,13 +233,13 @@ std::string BAFpileup::intersectWithBedtools(std::string makeminipileup, std::st string command = pathToBedtools_ +" intersect -a " + makeminipileup + " -b " + bedFileWithRegionsOfInterest + " > " + intersected; stream = - #if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__)) + #if defined(_WIN32) _popen(command.c_str(), "w"); #else popen(command.c_str(), "w"); #endif - #if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__)) + #if defined(_WIN32) _pclose(stream); #else pclose(stream); @@ -283,13 +283,13 @@ std::string BAFpileup::createPileUpFile(std::string outputDir, std::string samto } stream = - #if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__)) + #if defined(_WIN32) _popen(command.c_str(), "w"); #else popen(command.c_str(), "w"); #endif - #if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__)) + #if defined(_WIN32) _pclose(stream); #else pclose(stream); diff --git a/src/GenomeCopyNumber.cpp b/src/GenomeCopyNumber.cpp index dce71a0..6ea7af7 100644 --- a/src/GenomeCopyNumber.cpp +++ b/src/GenomeCopyNumber.cpp @@ -320,7 +320,7 @@ void GenomeCopyNumber::fillMyHash(std::string const& mateFileName ,std::string c inputFormat = getInputFormat(myInputFormat); stream = -#if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__)) +#if defined(_WIN32) _popen(command.c_str(), "r"); #else popen(command.c_str(), "r"); @@ -330,7 +330,7 @@ void GenomeCopyNumber::fillMyHash(std::string const& mateFileName ,std::string c count++; normalCount+=processRead(inputFormat,matesOrientation,line_buffer, bin,targetBed, mateFileName); } - #if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__)) + #if defined(_WIN32) _pclose(stream); #else pclose(stream); diff --git a/src/SNPinGenome.cpp b/src/SNPinGenome.cpp index f1e97f8..0aeb82f 100644 --- a/src/SNPinGenome.cpp +++ b/src/SNPinGenome.cpp @@ -119,7 +119,7 @@ void SNPinGenome::readSNPs(std::string const& inFile) char buffer[MAX_BUFFER]; string command = "gzip -cd "+inFile; stream = - #if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__)) + #if defined(_WIN32) _popen(command.c_str(), "r"); #else popen(command.c_str(), "r"); @@ -129,7 +129,7 @@ void SNPinGenome::readSNPs(std::string const& inFile) if (line_buffer[0] == '#') continue; count+=processSNPLine(ifVCF,line_buffer,myChr,index,previousPos); } - #if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__)) + #if defined(_WIN32) _pclose(stream); #else pclose(stream); @@ -390,14 +390,14 @@ void SNPinGenome::assignValues(std::string const& inFile, string inputFormat, in if (inFile.substr(inFile.size()-3,3).compare(".gz")==0) { string command = "gzip -cd "+inFile; FILE* stream = - #if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__)) + #if defined(_WIN32) _popen(command.c_str(), "r"); #else popen(command.c_str(), "r"); #endif readPileUP(stream, minimalTotalLetterCountPerPosition, minimalQualityPerPosition, p_genomeCopyNumber); - #if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__)) + #if defined(_WIN32) _pclose(stream); #else pclose(stream); diff --git a/src/myFunc.cpp b/src/myFunc.cpp index 50fb4ec..d60a61e 100644 --- a/src/myFunc.cpp +++ b/src/myFunc.cpp @@ -277,7 +277,7 @@ long getLineNumber(std::string const& fileName, const std::string& pathToSamtool if (fileName.substr(fileName.size()-3,3).compare(".gz")==0) { string command = "gzip -cd "+fileName; stream = - #if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__)) + #if defined(_WIN32) _popen(command.c_str(), "r"); #else popen(command.c_str(), "r"); @@ -285,7 +285,7 @@ long getLineNumber(std::string const& fileName, const std::string& pathToSamtool while ( fgets(buffer, MAX_BUFFER, stream) != NULL ) { count++; } - #if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__)) + #if defined(_WIN32) _pclose(stream); #else pclose(stream); @@ -305,7 +305,7 @@ long getLineNumber(std::string const& fileName, const std::string& pathToSamtool cout << "..samtools should be installed to be able to read BAM files\n"; } stream = - #if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__)) + #if defined(_WIN32) _popen(command.c_str(), "r"); #else popen(command.c_str(), "r"); @@ -314,7 +314,7 @@ long getLineNumber(std::string const& fileName, const std::string& pathToSamtool while ( fgets(buffer, MAX_BUFFER, stream) != NULL ) { count++; } - #if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__)) + #if defined(_WIN32) _pclose(stream); #else pclose(stream); @@ -353,7 +353,7 @@ long getReadNumberFromPileup(std::string const& fileName) { char buffer[MAX_BUFFER]; string command = "gzip -cd "+fileName; stream = - #if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__)) + #if defined(_WIN32) _popen(command.c_str(), "r"); #else popen(command.c_str(), "r"); @@ -373,7 +373,7 @@ long getReadNumberFromPileup(std::string const& fileName) { } strs.clear(); } - #if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__)) + #if defined(_WIN32) _pclose(stream); #else pclose(stream); @@ -1224,7 +1224,7 @@ string pathAppend(const string& p1, const string& p2) { char sep = '/'; string tmp = p1; char sep2=sep; -#if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__)) +#if defined(_WIN32) sep2 = '\\'; #endif char lastSymb= p1[p1.length( )-1]; @@ -2496,7 +2496,7 @@ void myReplace(std::string& str, const std::string& oldStr, const std::string& n } -#if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__)) +#if defined(_WIN32) double expm1(double x) { if (fabs(x) < 1e-5) return x + 0.5*x*x;