From 1b524e32d8f4bc313ce5f88d587f3b61f4e4f80f Mon Sep 17 00:00:00 2001 From: Valentina Boeva Date: Thu, 16 Mar 2017 15:13:09 +0100 Subject: [PATCH 1/2] Delete RSSerror.h --- src/RSSerror.h | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 src/RSSerror.h diff --git a/src/RSSerror.h b/src/RSSerror.h deleted file mode 100644 index 70b450d..0000000 --- a/src/RSSerror.h +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once -#ifndef RSSERROR_H -#define RSSERROR_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include "GenomeCopyNumber.h" -#include "ChrCopyNumber.h" - - -class RSSerror -{ - public: - RSSerror(); -}; - -long double calculateRSS(GenomeCopyNumber & samplecopynumber, int ploidy); - -#endif // RSSERROR_H From b75642afb3b13e45589ec70671af03bb8109ae7f Mon Sep 17 00:00:00 2001 From: Valentina Boeva Date: Thu, 16 Mar 2017 15:13:22 +0100 Subject: [PATCH 2/2] Delete RSSerror.cpp --- src/RSSerror.cpp | 52 ------------------------------------------------ 1 file changed, 52 deletions(-) delete mode 100644 src/RSSerror.cpp diff --git a/src/RSSerror.cpp b/src/RSSerror.cpp deleted file mode 100644 index e675976..0000000 --- a/src/RSSerror.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include "RSSerror.h" - -using namespace std; - -RSSerror::RSSerror() -{ -} - -long double calculateRSS(GenomeCopyNumber & samplecopynumber, int ploidy) -{ - string::size_type pos = 0; - vector observedvalues; - vector expectedvalues; - map::iterator it; - for ( it=samplecopynumber.chromosomesInd_.begin() ; it != samplecopynumber.chromosomesInd_.end(); it++ ) { - string chrNumber = (*it).first; - if ( ( pos = chrNumber.find("chr", pos)) != string::npos ) - chrNumber.replace( pos, 3, "" ); - if ( ( pos = chrNumber.find("X", pos)) != string::npos ) //exclude X and Y from the analysis - continue; - if ( ( pos = chrNumber.find("Y", pos)) != string::npos ) - continue; - int index = samplecopynumber.findIndex(chrNumber); - int length = samplecopynumber.chrCopyNumber_[index].getLength(); - for (int i = 0; i< length; i++) { - float observed = 0; - float expected = 0; - { - observed = samplecopynumber.chrCopyNumber_[index].getRatioAtBin(i); - expected = observed; - if (samplecopynumber.chrCopyNumber_[index].isMedianCalculated()) { - expected = samplecopynumber.chrCopyNumber_[index].getMedianProfileAtI(i); - if (samplecopynumber.chrCopyNumber_[index].isSmoothed()) - expected = samplecopynumber.chrCopyNumber_[index].getSmoothedProfileAtI(i); - } - } - observedvalues.push_back(observed); - expectedvalues.push_back(expected); - } - } - - long double RSS = 0; - for (int i = 0; i < (int)observedvalues.size(); i++) - { - if ((observedvalues[i]!=NA) && (expectedvalues[i]!=NA)) - { - long double diff = (long double)observedvalues[i] - (long double)round(ploidy*expectedvalues[i])/ploidy; - RSS = RSS + (long double)pow(diff,2); - } - } - return RSS; -}