| 107 | } |
| 108 | |
| 109 | float EntryCNV::compare(EntryCNV c2, int overlapPrecision, int & left, int & right, float ploidy, float controlPloidy) { //return overlap |
| 110 | if (chr_.compare(c2.getChr())!=0) |
| 111 | return 0; |
| 112 | if ((copyNumber_>ploidy && c2.getCopyNumber()>controlPloidy) || (copyNumber_<ploidy && c2.getCopyNumber()<controlPloidy) || (copyNumber_==ploidy && c2.getCopyNumber()==controlPloidy)) { |
| 113 | int startControl = c2.getStart()-overlapPrecision; //to get larger window in the control.. |
| 114 | int endControl = c2.getEnd()+overlapPrecision; |
| 115 | |
| 116 | if (endControl<start_ || startControl>end_) |
| 117 | return 0; |
| 118 | left = max(start_,startControl); |
| 119 | right = min(end_,endControl); |
| 120 | return (right-left+1)/(end_-start_+1); |
| 121 | } else { |
| 122 | return 0; |
| 123 | } |
| 124 | |
| 125 | } |
| 126 |
no test coverage detected