Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
andrej-fischer committed Apr 22, 2014
2 parents aa3119e + cb042d7 commit 2ed799c
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.[oa]
build/*
build-*tar.gz
*~
release/
release*
Expand Down
30 changes: 13 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -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`

Expand All @@ -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?

Expand Down Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 7 additions & 1 deletion src/cloneHD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
13 changes: 7 additions & 6 deletions src/pre-filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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]];
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 2ed799c

Please sign in to comment.