| 166 | } |
| 167 | |
| 168 | int main(int argc, char *argv[]) |
| 169 | { |
| 170 | |
| 171 | print_version(); |
| 172 | |
| 173 | const char* conf_file = get_conf_file(argc, argv); |
| 174 | |
| 175 | ConfigFile cf(conf_file); |
| 176 | |
| 177 | //read parameters and initial variables: |
| 178 | |
| 179 | unsigned int max_threads = (int)cf.Value("general", "maxThreads", 1); |
| 180 | bool thread_verbose = (bool)cf.Value("general", "threadVerbose", "false"); |
| 181 | |
| 182 | thread_init(max_threads, thread_verbose ? 1 : 0); |
| 183 | |
| 184 | |
| 185 | std::string sex = (std::string)cf.Value("general","sex", ""); |
| 186 | if (sex.compare("XX") == 0) { |
| 187 | std::cout << "..consider the sample being female\n"; |
| 188 | } else if (sex.compare("XY") == 0) { |
| 189 | std::cout << "..consider the sample being male\n"; |
| 190 | } else if (sex.compare("") != 0){ |
| 191 | std::cerr << "Error: \"sex\" can be either XX or XY\n"; |
| 192 | return 0; |
| 193 | } |
| 194 | |
| 195 | double breakPointThreshold = (double)cf.Value("general","breakPointThreshold", .8); |
| 196 | if (breakPointThreshold < 0) { |
| 197 | cerr << "\n\n\t!!ERROR!! (but don't be afraid :)\n\n"; |
| 198 | cerr << "Starting from FREEC v.4.2 we use the threshold on the slope of the slope of the RSSs (instead of simply slope in FREEC v.<4.1) to define number of breakpoints in segmentation. "; |
| 199 | cerr << "This method is more robust and should provide a more uniform segmentation for different chromosomes.\n"; |
| 200 | cerr << "\n\tWe recomend to use \"breakPointThreshold=0.8\"\n\n"; |
| 201 | cerr << "It should be a positive value. The higher it is, the less breakpoints you will get.\n"; |
| 202 | cerr << "\n\tI am sorry, but you need to change this value in your config profile.. Or your can just comment it with #, then the default values of 0.8 will be applied\n"; |
| 203 | return 0; |
| 204 | } |
| 205 | std::cout << "..Breakpoint threshold for segmentation of copy number profiles is "<< breakPointThreshold<< "\n"; |
| 206 | |
| 207 | int teloCentroFlanks = (int)cf.Value("general","telocentromeric", TELO_CENTRO_FLANCS); |
| 208 | std::cout << "..telocenromeric set to "<<teloCentroFlanks<<"\n"; |
| 209 | |
| 210 | bool ifBedGraphOutPut = (bool)cf.Value("general","BedGraphOutput", "false"); |
| 211 | if (!ifBedGraphOutPut) { |
| 212 | std::cout << "..FREEC is not going to output normalized copy number profiles into a BedGraph file (for example, for visualization in the UCSC GB). Use \"[general] BedGraphOutput=TRUE\" if you want a BedGraph file\n"; |
| 213 | } |
| 214 | |
| 215 | bool contaminationAdjustment = (bool)cf.Value("general","contaminationAdjustment", "false"); |
| 216 | if (!contaminationAdjustment) { |
| 217 | std::cout << "..FREEC is not going to adjust profiles for a possible contamination by normal cells\n"; |
| 218 | } else { |
| 219 | std::cout << "..FREEC is going to adjust profiles for a possible contamination by normal cells\n"; |
| 220 | std::cout <<"..set contaminationAdjustment=FALSE if you don't want to use this option because you think that there is no contamiantion of your tumor sample by normal cells (e.g., it is a cell line, or it non-cancer DNA used without a control sample)\n"; |
| 221 | } |
| 222 | float knownContamination = (float)cf.Value("general","contamination",0); |
| 223 | |
| 224 | if (knownContamination>0) { |
| 225 | if (contaminationAdjustment == false) { |
nothing calls this directly
no test coverage detected