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

Method printRatio

src/GenomeCopyNumber.cpp:1670–1716  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1668 return chrCopyNumber_[index];
1669}
1670void GenomeCopyNumber::printRatio(std::string const& outFile, bool ifBedGraphOutPut, bool printNA) {
1671 std::ofstream file (outFile.c_str());
1672 map<string,int>::iterator it;
1673
1674 if (ifBedGraphOutPut==false) {
1675 file << "Chromosome\tStart\tRatio\tMedianRatio\tCopyNumber";
1676
1677
1678 if (hasBAF_==1){
1679 file << "\tBAF\testimatedBAF\tGenotype\tUncertaintyOfGT";
1680 }
1681 if (WESanalysis == true)
1682 {
1683 file << "\tGene";
1684 }
1685 if (SeekingSubc_ == true)
1686 {
1687 file << "\tSubclone_CN\tSubclone_Population";
1688 }
1689 file << "\n";
1690 for ( it=chromosomesInd_.begin() ; it != chromosomesInd_.end(); it++ ) {
1691 printRatio((*it).first,file,printNA);
1692 }
1693
1694 } else {
1695 //print a track for LOH if hasBAF_
1696 if (hasBAF_) {
1697 file << "track type=bedGraph name=\"copy neutral LOH from "<<outFile<<"\" description=\"Copy Neutral LOH\" color=100,100,100\n";
1698 for ( it=chromosomesInd_.begin() ; it != chromosomesInd_.end(); it++ ) {
1699 printRatioBedGraph((*it).first,file, "LOH");
1700 }
1701 }
1702 file << "track type=bedGraph name=\"gains from "<<outFile<<"\" description=\"Gains\" color=255,40,20\n";
1703 for ( it=chromosomesInd_.begin() ; it != chromosomesInd_.end(); it++ ) {
1704 printRatioBedGraph((*it).first,file, "gain");
1705 }
1706 file << "track type=bedGraph name=\"losses from "<<outFile<<"\" description=\"Losses\" color=20,40,255\n";
1707 for ( it=chromosomesInd_.begin() ; it != chromosomesInd_.end(); it++ ) {
1708 printRatioBedGraph((*it).first,file, "loss");
1709 }
1710 file << "track type=bedGraph name=\"neutral copy number from "<<outFile<<"\" description=\"Neutral Copy Number\" color=20,255,40\n";
1711 for ( it=chromosomesInd_.begin() ; it != chromosomesInd_.end(); it++ ) {
1712 printRatioBedGraph((*it).first,file, "normal");
1713 }
1714 }
1715 file.close();
1716}
1717
1718void GenomeCopyNumber::printBAF(std::string const& outFile, SNPinGenome& snpingenome, std::string const& matefile) {
1719 string myName = outFile;

Callers 1

mainFunction · 0.80

Calls 15

round_by_ploidyFunction · 0.85
getRatioAtBinMethod · 0.80
getCoordinateAtBinMethod · 0.80
isMedianCalculatedMethod · 0.80
getMedianProfileAtIMethod · 0.80
isSmoothedMethod · 0.80
getSmoothedProfileAtIMethod · 0.80
compareMethod · 0.80
getBAFsymbolAtMethod · 0.80
getBAFatMethod · 0.80
getBAFProfileAtMethod · 0.80

Tested by

no test coverage detected