diff --git a/src/bddata.cpp b/src/bddata.cpp index 84a147c3..234370eb 100644 --- a/src/bddata.cpp +++ b/src/bddata.cpp @@ -1,6 +1,7 @@ #include #include #include "bddata.h" +#include BDData::BDData() : m_currentWindow( &g_dummyChromosome, 0, 0 ) { @@ -119,7 +120,7 @@ void BDData::loadBDFile(const std::string& filename) firstPos += g_SpacerBeforeAfter; // ??? ask Kai secondPos += g_SpacerBeforeAfter; - if (firstChrName == secondChrName && secondChrName != "" && abs(firstPos - secondPos) < 500) { + if (firstChrName == secondChrName && secondChrName != "" && fabs(firstPos - secondPos) < 500) { continue; } if ( firstChrName!="" && secondChrName!="") { @@ -180,16 +181,16 @@ void SortRPByChrPos(std::vector & Reads_RP) { // no interchromosome RP bool RecipicalOverlap(RP_READ & first, RP_READ & second) { int distance = 1000; - if (abs(first.PosA - first.PosA1) > distance) { + if (fabs(first.PosA - first.PosA1) > distance) { return false; } - if (abs(first.PosB - first.PosB1) > distance) { + if (fabs(first.PosB - first.PosB1) > distance) { return false; } - if (abs(second.PosA - second.PosA1) > distance) { + if (fabs(second.PosA - second.PosA1) > distance) { return false; } - if (abs(second.PosB - second.PosB1) > distance) { + if (fabs(second.PosB - second.PosB1) > distance) { return false; } float cutoff = 0.9; @@ -424,7 +425,7 @@ void ModifyRP(std::vector & Reads_RP) Reads_RP[first].PosB = Reads_RP[first].PosB + Reads_RP[first].ReadLength; Reads_RP[first].PosB1 = Reads_RP[first].PosB1 + Reads_RP[first].ReadLength; } - if (Reads_RP[first].ChrNameA == Reads_RP[first].ChrNameB && abs(Reads_RP[first].PosA - Reads_RP[first].PosB) < 500) { + if (Reads_RP[first].ChrNameA == Reads_RP[first].ChrNameB && fabs(Reads_RP[first].PosA - Reads_RP[first].PosB) < 500) { Reads_RP[first].Visited = true; } //std::cout << "Final: " << Reads_RP[first].ChrNameA << " " << Reads_RP[first].DA << " " << Reads_RP[first].PosA << "\t" << Reads_RP[first].ChrNameB << " " << Reads_RP[first].DB << " " << Reads_RP[first].PosB << std::endl; @@ -718,12 +719,12 @@ void BDData::UpdateBD(ControlState & currentState) << "\t" << secondPos2 - g_SpacerBeforeAfter << "\t" << currentState.Reads_RP_Discovery[read_index].DB << "\t" << secondPos2 - secondPos << "\t" - << abs((int)secondPos - (int)firstPos) << "\tSupport: " << currentState.Reads_RP_Discovery[read_index].NumberOfIdentical << "\t"; + << fabs((int)secondPos - (int)firstPos) << "\tSupport: " << currentState.Reads_RP_Discovery[read_index].NumberOfIdentical << "\t"; DisplayBDSupportPerSample(currentState.Reads_RP_Discovery[read_index], RPoutputfile); RPoutputfile << std::endl; std::cout << "adding " << firstChrName << " " << ( (firstPos > g_SpacerBeforeAfter) ? firstPos - g_SpacerBeforeAfter : 1) << "\t" << firstPos2 - g_SpacerBeforeAfter << "\t" << currentState.Reads_RP_Discovery[read_index].DA << "\t" << firstPos2 - firstPos << "\t" << "\t" << secondChrName << " " << ( (secondPos > g_SpacerBeforeAfter) ? secondPos - g_SpacerBeforeAfter : 1) << "\t" << secondPos2 - g_SpacerBeforeAfter << "\t" << currentState.Reads_RP_Discovery[read_index].DB << "\t" << secondPos2 - secondPos << "\t" - << " to BD events. " << abs((int)secondPos - (int)firstPos) << " Support: " << currentState.Reads_RP_Discovery[read_index].NumberOfIdentical << std::endl; + << " to BD events. " << fabs((int)secondPos - (int)firstPos) << " Support: " << currentState.Reads_RP_Discovery[read_index].NumberOfIdentical << std::endl; } }