forked from mattions/dna2protein
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
92 lines (54 loc) · 3.01 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<a href = "https://www.sbgenomics.com/"><img src ="http://sevenbridges-python.readthedocs.io/en/latest/_static/logo.png" width ="300" align="center"></a>
If you are following the tutorial, switch to the <a href="https://github.com/sbg/dna2protein/tree/tutorial">tutorial branch</a>.
# What it is?
[![Build Status](https://travis-ci.org/mattions/dna2protein.svg?branch=setup_travis)](https://travis-ci.org/mattions/dna2protein)
This is a very simple workflow, using two simple python script to illustrate, as an example,
how to bring several commandline application into a Docker container, and then how to express them
into CWL.
## schematic of the workflow
The workflow is composed by two scripts:
- `transcribe.py` which gets in input a dna.txt file composed by nucleotides and writes a rna.txt
as output
- `translate.py` which accepts a rna.txt as input and produce a peptide.txt
# Build the image:
We create an image, called `dna2protein`, and build it using the `Dockerfile`.
Note: `mmattioni` is the username on the Seven Bridges Platform, `dna2protein` is the
development project we have created there. Change them to yours otherwise won't work.
docker build -t dna2protein .
# We can launch a container, and see if we have everything we need.
docker run -it dna2protein bash
# Launch our scripts from the container:
Transcribe example:
$ docker run dna2protein transcribe.py -h
usage: transcribe.py [-h] [-v] [--version] dna
Translates a DNA input test into a RNA
positional arguments:
dna DNA input file to transcribe
optional arguments:
-h, --help show this help message and exit
-v, --verbose
--version show program's version number and exit
Translate example:
$ docker run dna2protein translate.py -h
usage: translate.py [-h] [--verbose] [--version] mRNA
Transcribe the provided mRNA into a peptide.
positional arguments:
mRNA mRNA to transcribe
optional arguments:
-h, --help show this help message and exit
--verbose, -v Run in verbose mode (default: False)
--version show program's version number and exit
Now our scripts are dockerized and we can use it directly from the image.
# Push our image to the SevenBridges registry
First we need to tag the image. Make sure you have create a dev project called `dna2protein`, otherwise you will
not be able to push the image.
docker tag dna2protein images.sbgenomics.com/mmattioni/dna2protein
Now we login and push it to the registry. Note: you have to provide you API TOKEN, not the password you use to log
on the Seven Bridges Platform.
docker login --username <SBG_USERNAME> --email <SBG_EMAIL> --password <SBG_API_TOKEN> images.sbgenomics.com
docker push images.sbgenomics.com/mmattioni/dna2protein
# CWL associated
The CWL associated for the whole workflow is in the root of the directory and it's called
`dna2protein.cwl.json`
you can run it locally with rabix (grab the latest release from https://github.com/rabix/bunny/releases)
rabix --verbose dna2protein.cwl.json -- --dna dna.txt