-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathCONTRIBUTING
142 lines (99 loc) · 4.1 KB
/
CONTRIBUTING
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
## Download
First clone the upstream repository from GitHub:
```
git clone https://github.com/BIMSBbioinfo/pigx_chipseq.git --recursive
```
## Configure
PiGx uses the GNU build system. Developers need to bootstrap the
build system first with the `bootstrap.sh` script. Bootstrapping
requires GNU Autoconf and GNU Automake.
```
cd pigx_chipseq
./bootstrap.sh
```
Bootstrapping creates the `configure` script, a portable shell script.
You need to run the script to configure the package before building.
The configure script will check for all required dependencies,
so make sure you have them set up with guix or using any other package manager.
Assuming you have Guix installed, the following command spawns a
sub-shell in which all dependencies are available:
```
guix environment -l guix.scm
```
If you would like to add new dependencies on top, you may add them
to the env.scm file and spawn a sub-shell using guix:
```
guix environment -m env.scm
```
**IMPORTANT**: The default prefix (path to where tools are installed
to) for installation will be `/usr/local/`, so if you do not have
permissions to write to this location (i.e. do not have root
permission) then just use a different location like a subdirectory
under `$HOME`.
./configure --prefix=$HOME/pigx
NOTE: The configure has multiple options, you can see a description using:
```
./configure --help
```
For example, the following command overrides the locations of the
executables for `R`, `Rscript`, and `samtools`, disables checks for
required R packages, and configures the package to be installed in the
current directory:
```
./configure --disable-r-packages-check \
R=$HOME/programs/R-3.4.1/bin/R \
RSCRIPT=$HOME/programs/R-3.4.1/bin/Rscript \
SAMTOOLS=$HOME/.guix-profile/bin/samtools \
--prefix=$PWD
```
Be aware that `--disable-r-packages-check` should only be used when
you are certain that all R packages are available at runtime. It
should not be used when installing the pipeline to a shared location
for all users.
## Building
Even if you don't choose to install the pipeline, you will still need
to build a couple of files. Do that by running `make`.
If you want to skip the installation step, you will need to set the
environment variable `PIGX_UNINSTALLED` to any value before running
the executable from the current working directory.
```
export PIGX_UNINSTALLED=1
```
Now finally you can call the executable:
```
./pigx-chipseq Tests/sample_sheet.yaml -s Tests/settings.yaml
```
and you should see the flying pig. :)
## Install
In order to properly set up the packages structure under the prefix
location run:
```
make install
```
## Releases
Releases are made by the core developers only. This section describes
the release process.
- Any new release tarball should have a unique version number. This
is achieved by updating the version string in the `VERSION` file.
- Run the tests and build a new tarball. Since we are using
Autotools, we can run the test suite and generate a new release
tarball with `make distcheck`.
> NOTE: You will find the output of the check in the installation
> directory ($PREFIX ) under `pigx_chipseq-0.0.1/_build/test-suite.log`.
- Once the tests pass and you are sure to make the release, create a
new signed tag with `git tag --sign v$(cat VERSION)`.
- Sign the release tarball with GPG to create a detached signature.
- Push the tag to Github, and then upload the tarball and the detached
signature to https://github.com/BIMSBbioinfo/pigx_chipseq/releases
## Conventions
- use the `shell` block to execute scripts. We cannot use Snakemake's
`script` block, because that assumes that the directory containing
the scripts is writable.
- use `nice` to run tools inside a `shell` block. `nice` expects a
tool name and a list of tool arguments. Optionally, you can provide
a third argument to specify a log file to which all output is
redirected.
- to reference a tool outside of a `shell` block, do not access
`config` directly, but use the helper `tool`.
- to print messages use the `fmt` helper, which ensures that messages
all have the same style.