diff --git a/.gitignore b/.gitignore index a71c8f3..3bca399 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.[oa] build/* +build-*tar.gz *~ release/ release* diff --git a/README.md b/README.md index 8d453f8..3a6275c 100755 --- a/README.md +++ b/README.md @@ -1,15 +1,11 @@ # How to get cloneHD and filterHD? -The current stable release, including pre-compiled executable binaries -of filterHD and cloneHD for Mac OS X (64bit), can be found at: - -`ftp://ftp.sanger.ac.uk/pub/teams/153/cloneHD/` - -The source code can also be downloaded here. +The current stable release, as well as pre-compiled executable binaries +for Mac OS X and GNU Linux (64bit), can be found [here](https://github.com/andrej-fischer/cloneHD/releases). The cloneHD software is undergoing rapid development. Watch/Star this repo to receive updates. # Run a test with simulated data -If you download cloneHD from the ftp site above, you can test both filterHD and cloneHD by running +After downloading cloneHD from the release site, you can test both filterHD and cloneHD by running `$ sh run-example.sh` @@ -18,12 +14,15 @@ data with a matched normal. All command line arguments are explained below. # Compilation -For Mac OS X (64bit), there are pre-compiled binaries available on the ftp server above. To compile cloneHD yourself, you need the GNU scientific library ([GSL](http://www.gnu.org/software/gsl/)) v1.15 or later. Change the paths in the Makefile to your GSL installation location (if non-standard). Then type +For Mac OS X and GNU Linux (64bit), pre-compiled binaries are available [here](https://github.com/andrej-fischer/cloneHD/releases). To compile cloneHD yourself, you need the GNU scientific library ([GSL](http://www.gnu.org/software/gsl/)) v1.15 or later. Change the paths in the Makefile to point to your local GSL installation (if non-standard). Then type `$ make` -in the source directory. The two executables, `filterHD` and -`cloneHD`, will be in `./build`. For debugging with gdb, use `make -f Makefile.debug`. +in the `src` directory. The executables will be in `build`. For debugging with gdb, use `make -f Makefile.debug`. + +# Report bugs + +To report bugs, use the [issue](https://github.com/andrej-fischer/cloneHD/issues) interface of github. # What are cloneHD and filterHD for? @@ -81,20 +80,17 @@ The full documentation can be found in the `/docs/` subfolder. Click below. bias field for the tumor CNA data. Follow the logic of the example given here. -* If the matched-normal was sequenced at lower coverage than the tumor, it might be necessary - to run filterHD with a higher-than-optimal diffusion constant (set with `--sigma [double]`) - to obtain a more faithful bias field. Otherwise, the filterHD solution is too stiff and - you loose bias detail. +* If the matched-normal sample was sequenced at lower coverage than the tumor sample, it might be necessary to run filterHD with a higher-than-optimal diffusion constant (set with `--sigma [double]`) to obtain a more faithful bias field. Otherwise, the filterHD solution is too stiff and you loose bias detail. -* filterHD can sometimes run into local optima. It might be useful to - fix initial values for the parameters via `--jumpi [double]` etc. +* filterHD can sometimes run into local optima. In this case, it might be useful to + set initial values for the parameters via `--jumpi [double]` etc. * By default, cloneHD runs with mass gauging enabled. This seems like an overkill, but is actually quite useful because you can see some alternative explanations during the course of the analysis. * Don't put too much weight on the BIC criterion. It was calibrated - using simulated data. For real data, it should be supplied together with + using simulated data. For real data, it should be supplemented with common sense and biological knowledge. Use `--force [int]` to use a fixed number of subclones and `--max-tcn [int]` to set the maximum possible total copy number. diff --git a/changelog.md b/changelog.md index adeb54d..008fcc4 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ # changelog for cloneHD/filterHD +## v1.17.5 / 22.04.2014 + +* fixed memory alloc bug in pre-filter +* abandon ftp site for releases, used only for backup and beta + ## v1.17.4 / 10.04.2014 * fixed fatal bug in snv-mode with correlations diff --git a/src/cloneHD.cpp b/src/cloneHD.cpp index 0880461..a46bf0e 100755 --- a/src/cloneHD.cpp +++ b/src/cloneHD.cpp @@ -165,7 +165,13 @@ int main (int argc, const char * argv[]){ else{ // ****** INFERENCE STARTS HERE ****** bestn = infer_clones( clones, mass, &myClone, opts); - printf("cloneHD found support for %i sub-clone(s) in the data.\n", bestn); + printf("cloneHD in "); + if (cnaEmit.is_set && bafEmit.is_set && snvEmit.is_set) cout<<"cna-baf-snv "; + if (cnaEmit.is_set && bafEmit.is_set && !snvEmit.is_set) cout<<"cna-baf "; + if (cnaEmit.is_set && !bafEmit.is_set && snvEmit.is_set) cout<<"cna-snv "; + if (cnaEmit.is_set && !bafEmit.is_set && !snvEmit.is_set) cout<<"cna "; + if (!cnaEmit.is_set && !bafEmit.is_set && snvEmit.is_set) cout<<"snv "; + printf("mode found support for %i sub-clone(s) in the data.\n", bestn); // ****** INFERENCE COMPLETED ******** } print_all_results( &myClone, opts); diff --git a/src/pre-filter.cpp b/src/pre-filter.cpp index 9c34aa7..d8b57d4 100755 --- a/src/pre-filter.cpp +++ b/src/pre-filter.cpp @@ -199,6 +199,7 @@ void pre_filter( Emission& dataEmit, cmdl_opts& opts){ for (int s=0; s < dataEmit.nSamples; s++){ unsigned int * rds = dataEmit.reads[0][s]; unsigned int * dps = dataEmit.depths[0][s]; + if (dataEmit.nSites[s] == 0) abort(); double * wMean = new double [dataEmit.nSites[s]]; double * wVar = new double [dataEmit.nSites[s]]; int * mask = new int [dataEmit.nSites[s]]; @@ -238,21 +239,21 @@ void pre_filter( Emission& dataEmit, cmdl_opts& opts){ else if ( size < 2*opts.wSize+1 ){ size++; } - while (front < dataEmit.nSites[s]){ + while (front < dataEmit.nSites[s]-1){ front++; if (dps[front] > 0) break; } if (front < dataEmit.nSites[s]){ sum += fabs(median - double(rds[front]) / double(dps[front])); } - while (center < dataEmit.nSites[s]){ + while (center < dataEmit.nSites[s]-1){ center++; if (center < 0 || dps[center] > 0 ) break; } if (back >= 0){ sum -= fabs(median - double(rds[back]) / double(dps[back])); } - while (back < dataEmit.nSites[s]){ + while (back < dataEmit.nSites[s]-1){ back++; if ( back < 0 || dps[back] > 0 ) break; } @@ -275,21 +276,21 @@ void pre_filter( Emission& dataEmit, cmdl_opts& opts){ else if ( size < 2*opts.wSize+1 ){ size++; } - while (front < dataEmit.nSites[s]){ + while (front < dataEmit.nSites[s]-1){ front++; if (dps[front] > 0 && mask[front]==1) break; } if (front < dataEmit.nSites[s]){ sum += double(rds[front]) / double(dps[front]); } - while (center < dataEmit.nSites[s]){ + while (center < dataEmit.nSites[s]-1){ center++; if (center < 0 || (dps[center] > 0 && mask[center]==1)) break; } if (back >= 0){ sum -= double(rds[back]) / double(dps[back]); } - while (back < dataEmit.nSites[s]){ + while (back < dataEmit.nSites[s]-1){ back++; if ( back<0 || (dps[back]>0 && mask[back]==1 ) ) break; }