diff options
author | Justin Bedo <cu@cua0.org> | 2022-10-10 13:22:03 +1100 |
---|---|---|
committer | Justin Bedo <cu@cua0.org> | 2022-10-12 09:09:01 +1100 |
commit | ac3a4e0363c1fde0f1dbff75b95aa27d9acd5e5e (patch) | |
tree | 117083afffdc77dfa0b768901338b93999550bb8 /day2/ex4-bwa | |
parent | 059034ab3d5c40c8ef0350c440d4ae343802ec5c (diff) |
insert exercise 4
Diffstat (limited to 'day2/ex4-bwa')
-rw-r--r-- | day2/ex4-bwa/default.nix | 52 | ||||
l--------- | day2/ex4-bwa/flake.lock | 1 | ||||
-rwxr-xr-x | day2/ex4-bwa/flake.nix | 20 | ||||
-rw-r--r-- | day2/ex4-bwa/solution.nix | 19 |
4 files changed, 0 insertions, 92 deletions
diff --git a/day2/ex4-bwa/default.nix b/day2/ex4-bwa/default.nix deleted file mode 100644 index 9c8356a..0000000 --- a/day2/ex4-bwa/default.nix +++ /dev/null @@ -1,52 +0,0 @@ -/* -BioNix is a thin wrapper over Nix: there is not much functionality -required for pipelining that is not already present in the base build -engine. As such, the focus is on providing an interface that is -convenient for specifying common bioinformatics workflows. To this end, -BioNix provides a library of tools to help simplify the specification of -common bioinformatics pipelines, with a notable focus on genomics tools. -You can see the available tools at -https://github.com/PapenfussLab/bionix/tree/master/tools. - -This exercise aims to demonstrate how to both use a tool available in -BioNix on some input data and how to chain them together. We will do a -simple alignment with BWA on some simulated reads from a bacterial -genome. The BWA tool is provided by -https://github.com/PapenfussLab/bionix/blob/master/tools/bwa.nix and as -you can see there are alignment functions for alignment with BWA/BWA2, -as well as corresponding index functions for indexing a reference -genome. Don't worry about indexing, this will be handled automatically, -you only have to declare you want an alignment and what genome and the -index will be generated if needed. - -Exercise: - -1. Sample data along with a reference will be fetched from github. As -before, hashes of the content must be known. Fill in the hashes to fully -specify the inputs. - -2. With the hashes in place, the expression should evaluate and BWA -should run. Try swapping BWA out with some of the other available -aligners in BioNix (e.g., bowtie, hisat2, minimap2, whisper). - -3. Aligners produce *unsorted* output, but co-ordinate sorted alignments -are usually desired as they are indexable by position. Pass the aligned -output to the samtools sort function to sort the alignments into co- -ordinate order. -*/ -{bionix}: -with bionix; let - input = { - input1 = fetchFastQ { - url = "https://raw.githubusercontent.com/PapenfussLab/bionix/bac9248a5e08e8afdf5485a6e27cfe72e1ca5090/examples/sample1-1.fq"; - }; - input2 = fetchFastQ { - url = "https://raw.githubusercontent.com/PapenfussLab/bionix/bac9248a5e08e8afdf5485a6e27cfe72e1ca5090/examples/sample1-2.fq"; - }; - }; - - ref = fetchFastA { - url = "https://raw.githubusercontent.com/PapenfussLab/bionix/bac9248a5e08e8afdf5485a6e27cfe72e1ca5090/examples/ref.fa"; - }; -in - bwa.align {} input diff --git a/day2/ex4-bwa/flake.lock b/day2/ex4-bwa/flake.lock deleted file mode 120000 index 981422e..0000000 --- a/day2/ex4-bwa/flake.lock +++ /dev/null @@ -1 +0,0 @@ -../../common/flake.lock
\ No newline at end of file diff --git a/day2/ex4-bwa/flake.nix b/day2/ex4-bwa/flake.nix deleted file mode 100755 index bfaca96..0000000 --- a/day2/ex4-bwa/flake.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - inputs = { - nixpkgs.url = "github:nixos/nixpkgs"; - bionix.url = "github:papenfusslab/bionix"; - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = { - self, - nixpkgs, - bionix, - flake-utils, - }: - flake-utils.lib.eachDefaultSystem (system: let - pkgs = import nixpkgs {inherit system;}; - bionix' = import bionix {nixpkgs = pkgs;}; - in { - defaultPackage = bionix'.callBionix ./. {}; - }); -} diff --git a/day2/ex4-bwa/solution.nix b/day2/ex4-bwa/solution.nix deleted file mode 100644 index 79fc7dc..0000000 --- a/day2/ex4-bwa/solution.nix +++ /dev/null @@ -1,19 +0,0 @@ -{bionix}: -with bionix; let - input = { - input1 = fetchFastQ { - url = "https://raw.githubusercontent.com/PapenfussLab/bionix/master/examples/sample1-1.fq"; - sha256 = "sha256-qE6s8hKowiz3mvCq8/7xAzUz77xG9rAcsI2E50xMAk4="; - }; - input2 = fetchFastQ { - url = "https://raw.githubusercontent.com/PapenfussLab/bionix/master/examples/sample1-2.fq"; - sha256 = "sha256-s02R49HX/qeJp4t/eZwsKwV9D07uLGId8CEpU2dB8zM="; - }; - }; - - ref = fetchFastA { - url = "https://raw.githubusercontent.com/PapenfussLab/bionix/master/examples/ref.fa"; - sha256 = "sha256-V3zqOJFuGtukDRQttK/pGfKofgOlKrridHaWYhGGyWs="; - }; -in - samtools.sort {} (bwa.align {inherit ref;} input) |