aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md20
-rw-r--r--example/call.nix19
-rw-r--r--example/default.nix42
3 files changed, 80 insertions, 1 deletions
diff --git a/README.md b/README.md
index d71b0e5..92817c2 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,20 @@
# bionix
-Nix functions for use in bioinformatics, and a sample DE analysis
+
+Bionix is a set of [Nix](http://nixos.org/nix) expressions for specifying and
+executing bioinformatics pipelines. It is currently a work in progress, so
+documentation is sparse.
+
+## Getting started
+
+Install [Nix](http://nixos.org/nix) and then try `nix-build` in the examples
+directory.
+
+## Example pipeline
+
+The examples directory shows a simple pipeline in the call.nix and default.nix
+files. You can build it with `nix-build` in the examples directory. The result
+will be linked to ./result, which in this example case is an empty VCF file.
+
+## Contact
+
+Please come chat with us at [#bionix:cua0.org](http://matrix.to/#/#bionix:cua0.org).
diff --git a/example/call.nix b/example/call.nix
new file mode 100644
index 0000000..c9be673
--- /dev/null
+++ b/example/call.nix
@@ -0,0 +1,19 @@
+# This is an example pipeline specification to do multi-sample variant calling
+# with the Platypus variant caller. Each input is preprocessed by aligning
+# against a reference genome (defaults to GRCH38), fixing mate information, and
+# marking duplicates. Finally platypus is called over all samples.
+{bionix ? import <bionix> {}
+,nixpkgs ? import <nixpkgs> {}
+,inputs
+,ref ? null}:
+
+with bionix;
+
+let
+ preprocess = f:
+ samtools.markdup {}
+ (samtools.sort {}
+ (samtools.fixmate {}
+ (bwa.align {ref = if ref == null then bionix.ref.grch38.seq else ref;} f)));
+
+ in platypus.call {} (map preprocess inputs)
diff --git a/example/default.nix b/example/default.nix
new file mode 100644
index 0000000..bceaa96
--- /dev/null
+++ b/example/default.nix
@@ -0,0 +1,42 @@
+# This example uses the pipelines specified in the call.nix file on the
+# synthetic data in this directory.
+with import <bionix> {};
+
+let
+
+ # List of input samples
+ inputs = [
+ # Sample 1
+ {
+ input1 = fetchFastQ {
+ url = "https://github.com/PapenfussLab/bionix/raw/master/example/sample1-1.fq";
+ sha256 = "1m3vc248mbr4v56459q4xsklznssgqb35lwhwk1i9qvxqm7c72nq";
+ };
+
+ input2 = fetchFastQ {
+ url = "https://github.com/PapenfussLab/bionix/raw/master/example/sample1-2.fq";
+ sha256 = "13fqvdb5r2sidi2i0s3ifg8gyxp8kibpxc3cbiw07d5zcn3g479x";
+ };
+ }
+
+ # Sample 2
+ {
+ input1 = fetchFastQ {
+ url = "https://github.com/PapenfussLab/bionix/raw/master/example/sample2-1.fq";
+ sha256 = "0c6ik4smsw2kb8xbbci80d00c24klk6mqd2a71y4v9hmpnc42fmr";
+ };
+
+ input2 = fetchFastQ {
+ url = "https://github.com/PapenfussLab/bionix/raw/master/example/sample2-2.fq";
+ sha256 = "0zvrkm2m69lwfi89hzxsbnkp4i6cszh7c624l1qwmd4s6gh7vfcx";
+ };
+ }
+ ];
+
+ # The reference for the synthetic data
+ ref = fetchFastA {
+ url = "https://github.com/PapenfussLab/bionix/raw/master/example/ref.fa";
+ sha256 = "06gphhh40h3mvwvs2m51qc3rpih8mcs8frhd48l94d5bzwfhb2hc";
+ };
+
+in import ./call.nix {inherit inputs ref;}