MCPcopy Create free account
hub / github.com/BoevaLab/FREEC / readCopyNumber

Method readCopyNumber

src/GenomeCopyNumber.cpp:42–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40bool GenomeCopyNumber::isMappUsed() {return isMappUsed_;}
41
42void 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
74long GenomeCopyNumber::getNormalNumberOfPairs(void) {
75 return normalNumberOfPairs_;

Callers 1

mainFunction · 0.80

Calls 15

readFileWithGenomeInfoFunction · 0.85
sumFunction · 0.85
getReadNumberFromPileupFunction · 0.85
getLineNumberFunction · 0.85
round_fFunction · 0.85
splitFunction · 0.85
ChrCopyNumberClass · 0.85
compareMethod · 0.80
getExons_CountchrMethod · 0.80
addToReadCountMethod · 0.80
addToCoordinatesMethod · 0.80
addToEndsMethod · 0.80

Tested by

no test coverage detected