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

Method calculateCopyNumberProbs_and_exomeLength

src/GenomeCopyNumber.cpp:1759–2120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1757
1758
1759void GenomeCopyNumber::calculateCopyNumberProbs_and_exomeLength(int breakPointType)
1760 {
1761 //estimationOfExomeSize_ = 0;
1762 vector<ChrCopyNumber>::iterator it;
1763 unsigned long long count = 0;
1764 int endsSize=0;
1765 string NormalBAF,NormalBAF_XY;
1766 float normalXYploidy=ploidy_*0.5; //will only use it when the genome is male
1767 estimationOfGenomeSize_=0;
1768 if (hasBAF_)
1769 {
1770 NormalBAF = getNormalBAFforPloidy(ploidy_);
1771 NormalBAF_XY=getXYBAFforPloidy(ploidy_);//will only use it when the genome is male
1772 }
1773
1774 CNVs_.clear();
1775 copyNumberProbs_.clear();
1776
1777 for ( it=chrCopyNumber_.begin() ; it != chrCopyNumber_.end(); it++ )
1778 {
1779 float previousLevel = NA;
1780 int lengthOfPreviousLevel = 0;
1781 float nextLevel = NA;
1782 int lengthOfNextLevel = 0;
1783 it->setIsSmoothed(true);
1784 string chr = it->getChromosome();
1785 cout << "..Annotation of CNVs for "<< chr <<"\n";
1786 //will use these three variables to collect CNVs:
1787 int start = 0;
1788 int end = NA;
1789 int cnumber = NA;
1790 string BAFSym = "-";
1791 string BAFprev = "-";
1792 string BAFnext = "-";
1793 string lBAF = "-";
1794
1795 float lUncertainty = NA;
1796 float BAFUncertainty = NA;
1797
1798 float normalLevel=1;
1799 if (sex_.compare("XY")==0 && (it->getChromosome().find("X")!=string::npos || it->getChromosome().find("Y")!=string::npos)) {
1800 normalLevel = 0.5;
1801 }
1802 for (int i = 0; i<(int)it->getMedianValues().size(); i++) {
1803 float level = it->getLevelAt(i, ploidy_);
1804 int fragmentLength = it->getFragmentLengths()[i];
1805 if (hasBAF_) {
1806 BAFSym = it->getBAFsymbPerFrg(i);
1807 BAFUncertainty = it->getEstimatedBAFuncertaintyAtBin(i);
1808// cout << "..Control: read "<< BAFSym << "\n";
1809 }
1810
1811 if (level == NA)
1812 {
1813 int nextIndex = it->nextNoNAIndex(i, ploidy_,0);
1814 BAFUncertainty = NA;
1815 if (nextIndex == NA) {
1816 nextLevel = NA;

Callers 2

performMethod · 0.80
runWithDefinedPloidyFunction · 0.80

Calls 15

getNormalBAFforPloidyFunction · 0.85
getXYBAFforPloidyFunction · 0.85
round_fFunction · 0.85
EntryCNVClass · 0.85
setIsSmoothedMethod · 0.80
getChromosomeMethod · 0.80
compareMethod · 0.80
getMedianValuesMethod · 0.80
getLevelAtMethod · 0.80
getFragmentLengthsMethod · 0.80
getBAFsymbPerFrgMethod · 0.80

Tested by

no test coverage detected