Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Minor.
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneskoester committed May 25, 2015
1 parent 0d1654b commit e6d2e14
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 9 deletions.
6 changes: 2 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]

name = "alpaca"
version = "0.0.1"
version = "0.1.0"
authors = ["Johannes Köster <johannes.koester@tu-dortmund.de>"]

[dependencies]
Expand All @@ -11,13 +11,11 @@ simple_parallel = "*"
argparse = "*"
tempdir = "*"
log = "*"
bio = ">=0.3.7"

[dependencies.rust-htslib]
git = "https://github.com/christopher-schroeder/rust-htslib.git"

[dependencies.bio]
git = "https://github.com/johanneskoester/rust-bio.git"

[[bin]]
name = "alpaca"
test = false
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ALPACA - the ALgebraic PArallel variant CAller
ALPACA is a caller for genetic variants from next-generation sequencing data.
ALPACA is a caller for genomic variants (single nucleotide and small indels) from next-generation sequencing data.
It has two major distinguishing features compared to other variant callers:

* ALPACA incorporates arbitrary filtering of samples against each other into the calling. This is done via an expressive, algebraic query language. It calculates the posterior probability for each locus to not behave like described in the filter query. If that probability is small enough, the locus is called.
Expand All @@ -23,7 +23,7 @@ A complete description of algebraic variant calling can be found in my thesis
If you use ALPACA, please cite the thesis for now.

## Example usage:
## Example usage

All in one command:

Expand Down
2 changes: 1 addition & 1 deletion src/call/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub fn call(bcf: &mut bcf::Reader, query: Box<Caller>, fdr: Option<LogProb>, max
return candidates;
}

for probs in pool.map(likelihood_buffer.chunks(1000000 / threads), &call) {
for probs in unsafe { pool.map(likelihood_buffer.chunks(1000000 / threads), &call) } {
prob_buffer.extend(probs);
}

Expand Down
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ where F: Fn(&Path, &str) -> KernelResult {
}
}

let mut results = pool.map(regions.iter(), &apply);
let mut results = unsafe { pool.map(regions.iter(), &apply) };

let mut result = results.next().unwrap();
let mut writer = {
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#![feature(plugin)]
#![plugin(peg_syntax_ext)]
#![feature(collections)]
#![feature(str_char)]
#![feature(collections_drain)]
#![feature(step_by)]

Expand Down
13 changes: 13 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ impl<T> OptionalArg<T> {
OptionalArg::None => None
}
}

fn is_none(&self) -> bool {
match self {
&OptionalArg::Some(_) => false,
&OptionalArg::None => true
}
}
}


Expand Down Expand Up @@ -192,6 +199,12 @@ Example: "alpaca call --fdr 0.05 'A - (B + C)' < filtered.bcf > calls.bcf""#
.add_option(&["--threads", "-t"], Store, "Number of threads to use (default 1).");
parse_args_or_exit(&ap, args);
}

if min_qual.is_none() && fdr.is_none() {
fdr = OptionalArg::Some(0.05);
}


let max_prob = min_qual.into_option().map(|q| q * utils::PHRED_TO_LOG_FACTOR);

cli::call(&query, fdr.into_option().map(|fdr| fdr.ln()), max_prob, heterozygosity, threads);
Expand Down

0 comments on commit e6d2e14

Please sign in to comment.