| 40 | bool GenomeCopyNumber::isMappUsed() {return isMappUsed_;} |
| 41 | |
| 42 | void GenomeCopyNumber::readCopyNumber(std::string const& mateFileName ,std::string const& inputFormat, std::string const& matesOrientation, std::string const& chrLenFileName, float coefficientOfVariation ) { |
| 43 | //first get the number of reads and the genome size |
| 44 | //long genomeSize = 0; |
| 45 | long readNumber = 0; |
| 46 | int windowSize; |
| 47 | //reading the file with genome information |
| 48 | std::vector<std::string> names; |
| 49 | std::vector<int> lengths; |
| 50 | readFileWithGenomeInfo(chrLenFileName, names, lengths); |
| 51 | refGenomeSize_ = sum(lengths); |
| 52 | cout << "\t total genome size:\t" << refGenomeSize_ << "\n"; |
| 53 | if ((inputFormat.compare("pileup")==0 || inputFormat.compare("SAMtools pileup")==0)) { |
| 54 | readNumber = getReadNumberFromPileup(mateFileName); |
| 55 | } else { |
| 56 | readNumber = getLineNumber(mateFileName, pathToReference_, pathToSamtools_, pathToSambamba_, SambambaThreads_); |
| 57 | } |
| 58 | cout << "\t read number:\t" << readNumber << "\n"; |
| 59 | cout << "\t coefficientOfVariation:\t" << coefficientOfVariation << "\n"; |
| 60 | windowSize = round_f(float(1./(coefficientOfVariation*coefficientOfVariation)/readNumber*refGenomeSize_)); |
| 61 | cout << "\t evaluated window size:\t" << windowSize << "\n"; |
| 62 | for (int i = 0; i < (int) names.size(); i++) { |
| 63 | ChrCopyNumber chrCopyNumber(windowSize, lengths[i],names[i]); |
| 64 | chromosomesInd_.insert(pair<string, int> (names[i],i)); |
| 65 | chrCopyNumber_.push_back(chrCopyNumber); |
| 66 | } |
| 67 | //cout << "data structure created"; |
| 68 | //read mateFileName and calculate copyNumber |
| 69 | |
| 70 | GenomeCopyNumber::fillMyHash(mateFileName ,inputFormat, matesOrientation, windowSize, windowSize); |
| 71 | |
| 72 | } |
| 73 | |
| 74 | long GenomeCopyNumber::getNormalNumberOfPairs(void) { |
| 75 | return normalNumberOfPairs_; |
no test coverage detected