| 130 | |
| 131 | |
| 132 | bool SeekSubclones::SignTest(std::vector <float>& data, float& threshold, int bonfer_correction) |
| 133 | { |
| 134 | int upvalues = 0; |
| 135 | int downvalues = 0; |
| 136 | bool subclone = false; |
| 137 | for (unsigned int i = 0; i < data.size(); i++) { |
| 138 | if (data[i]!=NA){ |
| 139 | if (data[i] < threshold) { |
| 140 | downvalues++; |
| 141 | } |
| 142 | if (data[i] > threshold) { |
| 143 | upvalues++; |
| 144 | } |
| 145 | } |
| 146 | } |
| 147 | int max_count = upvalues; |
| 148 | if (upvalues < downvalues) |
| 149 | { |
| 150 | max_count = downvalues; |
| 151 | } |
| 152 | double result = 2*binomialcdistribution(max_count-1, upvalues+downvalues, 0.5); //CARINO! YOU CALULATE A WRONG P-VALUE HERE!! SHOULD BE max_count-1; I CORRECTED IT. |
| 153 | if (result < 0.001/bonfer_correction && result != 0) |
| 154 | { |
| 155 | subclone = true; |
| 156 | } |
| 157 | return subclone; |
| 158 | } |
| 159 | |
| 160 | bool SeekSubclones::PercentageTest(std::vector <float>& data, float& threshold) |
| 161 | { |
nothing calls this directly
no test coverage detected