Skip to content

Commit 481964d

Browse files
authored
Merge pull request #37 from nf-core/dev
bump v1.1.0
2 parents f7a827e + e089d0b commit 481964d

22 files changed

+834
-795
lines changed

.travis.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ matrix:
88
fast_finish: true
99

1010
before_install:
11-
# PRs to master are only ok if coming from dev branch
12-
- '[ $TRAVIS_PULL_REQUEST = "false" ] || [ $TRAVIS_BRANCH != "master" ] || ([ $TRAVIS_PULL_REQUEST_SLUG = $TRAVIS_REPO_SLUG ] && [ $TRAVIS_PULL_REQUEST_BRANCH = "dev" ])'
11+
- '[ $TRAVIS_PULL_REQUEST = "false" ] || [ $TRAVIS_BRANCH != "master" ] || ([ $TRAVIS_PULL_REQUEST_SLUG = $TRAVIS_REPO_SLUG ] && ([ $TRAVIS_PULL_REQUEST_BRANCH = "dev" ] || [ $TRAVIS_PULL_REQUEST_BRANCH = "patch" ]))'
1312
# Pull the docker image first so the test doesn't wait for this
1413
- docker pull nfcore/hic:dev
1514
# Fake the tag locally so that the pipeline runs properly
1615
# Looks weird when this is :dev to :dev, but makes sense when testing code for a release (:dev to :1.0.1)
17-
- docker tag nfcore/hic:dev nfcore/hic:1.0.0
16+
- docker tag nfcore/hic:dev nfcore/hic:1.1.0
1817

1918
install:
2019
# Install Nextflow
@@ -30,7 +29,7 @@ install:
3029
- sudo apt-get install npm && npm install -g markdownlint-cli
3130

3231
env:
33-
- NXF_VER='0.32.0' # Specify a minimum NF version that should be tested and work
32+
- NXF_VER='19.04.0' # Specify a minimum NF version that should be tested and work
3433
- NXF_VER='' # Plus: get the latest NF version and check that it works
3534

3635
script:

CHANGELOG.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
11
# nf-core/hic: Changelog
22

3+
## v1.1.0 - 2019-10-15
4+
5+
* Support 'N' base motif in restriction/ligation sites
6+
* Support multiple restriction enzymes/ligattion sites (comma separated) ([#31](https://github.com/nf-core/hic/issues/31))
7+
* Add --saveInteractionBAM option
8+
* Add DOI ([#29](https://github.com/nf-core/hic/issues/29))
9+
* Fix bug for reads extension _1/_2 ([#30](https://github.com/nf-core/hic/issues/30))
10+
* Update manual ([#28](https://github.com/nf-core/hic/issues/28))
11+
312
## v1.0 - 2019-05-06
413

5-
First version of nf-core Hi-C pipeline which is a Nextflow implementation of the [HiC-Pro pipeline](https://github.com/nservant/HiC-Pro/).
14+
First version of nf-core Hi-C pipeline which is a Nextflow implementation of
15+
the [HiC-Pro pipeline](https://github.com/nservant/HiC-Pro/).
616
Note that all HiC-Pro functionalities are not yet all implemented.
7-
The current version supports most protocols including Hi-C, in situ Hi-C, DNase Hi-C, Micro-C, capture-C or HiChip data.
17+
The current version supports most protocols including Hi-C, in situ Hi-C,
18+
DNase Hi-C, Micro-C, capture-C or HiChip data.
819

920
In summary, this version allows :
1021

11-
* Automatic detection and generation of annotation files based on igenomes if not provided.
22+
* Automatic detection and generation of annotation files based on igenomes
23+
if not provided.
1224
* Two-steps alignment of raw sequencing reads
1325
* Reads filtering and detection of valid interaction products
1426
* Generation of raw contact matrices for a set of resolutions

CODE_OF_CONDUCT.md

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@
22

33
## Our Pledge
44

5-
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project
7+
and our community a harassment-free experience for everyone, regardless of
8+
age, body size, disability, ethnicity, gender identity and expression, level
9+
of experience, nationality, personal appearance, race, religion, or sexual
10+
identity and orientation.
611

712
## Our Standards
813

9-
Examples of behavior that contributes to creating a positive environment include:
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
1016

1117
* Using welcoming and inclusive language
1218
* Being respectful of differing viewpoints and experiences
@@ -16,31 +22,55 @@ Examples of behavior that contributes to creating a positive environment include
1622

1723
Examples of unacceptable behavior by participants include:
1824

19-
* The use of sexualized language or imagery and unwelcome sexual attention or advances
25+
* The use of sexualized language or imagery and unwelcome sexual attention
26+
or advances
2027
* Trolling, insulting/derogatory comments, and personal or political attacks
2128
* Public or private harassment
22-
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23-
* Other conduct which could reasonably be considered inappropriate in a professional setting
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
2433

2534
## Our Responsibilities
2635

27-
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
2839

29-
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
3045

3146
## Scope
3247

33-
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an
52+
appointed representative at an online or offline event. Representation of a
53+
project may be further defined and clarified by project maintainers.
3454

3555
## Enforcement
3656

37-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team on [Slack](https://nf-core-invite.herokuapp.com/). The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team on
59+
[Slack](https://nf-core-invite.herokuapp.com/). The project team will review
60+
and investigate all complaints, and will respond in a way that it deems
61+
appropriate to the circumstances. The project team is obligated to maintain
62+
confidentiality with regard to the reporter of an incident. Further details
63+
of specific enforcement policies may be posted separately.
3864

39-
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
65+
Project maintainers who do not follow or enforce the Code of Conduct in good
66+
faith may face temporary or permanent repercussions as determined by other
67+
members of the project's leadership.
4068

4169
## Attribution
4270

43-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
71+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
72+
version 1.4, available at
73+
[http://contributor-covenant.org/version/1/4][version]
4474

4575
[homepage]: http://contributor-covenant.org
4676
[version]: http://contributor-covenant.org/version/1/4/

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM nfcore/base
1+
FROM nfcore/base:1.7
22
LABEL authors="Nicolas Servant" \
33
description="Docker image containing all requirements for nf-core/hic pipeline"
44

@@ -7,4 +7,4 @@ RUN apt-get update && apt-get install -y gcc g++ && apt-get clean -y
77

88
COPY environment.yml /
99
RUN conda env create -f /environment.yml && conda clean -a
10-
ENV PATH /opt/conda/envs/nf-core-hic-1.0.0/bin:$PATH
10+
ENV PATH /opt/conda/envs/nf-core-hic-1.1.0/bin:$PATH

README.md

Lines changed: 77 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,99 @@
33
**Analysis of Chromosome Conformation Capture data (Hi-C)**.
44

55
[![Build Status](https://travis-ci.com/nf-core/hic.svg?branch=master)](https://travis-ci.com/nf-core/hic)
6-
[![Nextflow](https://img.shields.io/badge/nextflow-%E2%89%A50.32.0-brightgreen.svg)](https://www.nextflow.io/)
6+
[![Nextflow](https://img.shields.io/badge/nextflow-%E2%89%A519.04.0-brightgreen.svg)](https://www.nextflow.io/)
77

88
[![install with bioconda](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg)](http://bioconda.github.io/)
99
[![Docker](https://img.shields.io/docker/automated/nfcore/hic.svg)](https://hub.docker.com/r/nfcore/hic)
10-
![Singularity Container available](
11-
https://img.shields.io/badge/singularity-available-7E4C74.svg)
10+
![Singularity Container available](https://img.shields.io/badge/singularity-available-7E4C74.svg)
1211

13-
### Introduction
14-
This pipeline is based on the [HiC-Pro workflow](https://github.com/nservant/HiC-Pro).
15-
It was designed to process Hi-C data from raw fastq files (paired-end Illumina data) to normalized contact maps.
16-
The current version supports most protocols, including digestion protocols as well as protocols that do not require restriction enzymes such as DNase Hi-C.
17-
In practice, this workflow was successfully applied to many data-sets including dilution Hi-C, in situ Hi-C, DNase Hi-C, Micro-C, capture-C, capture Hi-C or HiChip data.
12+
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.2669513.svg)](https://doi.org/10.5281/zenodo.2669513)
1813

19-
The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool to run tasks across multiple compute infrastructures in a very portable manner. It comes with docker / singularity containers making installation trivial and results highly reproducible.
14+
## Introduction
2015

21-
### Pipeline summary
22-
1. Mapping using a two steps strategy to rescue reads spanning the ligation sites (bowtie2)
16+
This pipeline is based on the
17+
[HiC-Pro workflow](https://github.com/nservant/HiC-Pro).
18+
It was designed to process Hi-C data from raw fastq files (paired-end Illumina
19+
data) to normalized contact maps.
20+
The current version supports most protocols, including digestion protocols as
21+
well as protocols that do not require restriction enzymes such as DNase Hi-C.
22+
In practice, this workflow was successfully applied to many data-sets including
23+
dilution Hi-C, in situ Hi-C, DNase Hi-C, Micro-C, capture-C, capture Hi-C or
24+
HiChip data.
25+
26+
The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool
27+
to run tasks across multiple compute infrastructures in a very portable manner.
28+
It comes with docker / singularity containers making installation trivial and
29+
results highly reproducible.
30+
31+
## Pipeline summary
32+
33+
1. Mapping using a two steps strategy to rescue reads spanning the ligation
34+
sites (bowtie2)
2335
2. Detection of valid interaction products
2436
3. Duplicates removal
2537
4. Create genome-wide contact maps at various resolution
2638
5. Contact maps normalization using the ICE algorithm (iced)
2739
6. Quality controls and report (MultiQC)
2840
7. Addition export for visualisation and downstream analysis (cooler)
2941

30-
### Documentation
31-
The nf-core/hic pipeline comes with documentation about the pipeline, found in the `docs/` directory:
42+
## Quick Start
43+
44+
i. Install [`nextflow`](https://nf-co.re/usage/installation)
45+
46+
ii. Install one of [`docker`](https://docs.docker.com/engine/installation/),
47+
[`singularity`](https://www.sylabs.io/guides/3.0/user-guide/) or
48+
[`conda`](https://conda.io/miniconda.html)
49+
50+
iii. Download the pipeline and test it on a minimal dataset with a single command
51+
52+
```bash
53+
nextflow run hic -profile test,<docker/singularity/conda>
54+
```
55+
56+
iv. Start running your own analysis!
57+
58+
```bash
59+
nextflow run hic -profile <docker/singularity/conda> --reads '*_R{1,2}.fastq.gz' --genome GRCh37
60+
```
61+
62+
See [usage docs](docs/usage.md) for all of the available options when running the pipeline.
3263

33-
1. [Installation](docs/installation.md)
64+
## Documentation
65+
66+
The nf-core/hic pipeline comes with documentation about the pipeline, found in
67+
the `docs/` directory:
68+
69+
1. [Installation](https://nf-co.re/usage/installation)
3470
2. Pipeline configuration
35-
* [Local installation](docs/configuration/local.md)
36-
* [Adding your own system](docs/configuration/adding_your_own.md)
37-
* [Reference genomes](docs/configuration/reference_genomes.md)
71+
* [Local installation](https://nf-co.re/usage/local_installation)
72+
* [Adding your own system config](https://nf-co.re/usage/adding_own_config)
73+
* [Reference genomes](https://nf-co.re/usage/reference_genomes)
3874
3. [Running the pipeline](docs/usage.md)
3975
4. [Output and how to interpret the results](docs/output.md)
40-
5. [Troubleshooting](docs/troubleshooting.md)
76+
5. [Troubleshooting](https://nf-co.re/usage/troubleshooting)
77+
78+
## Contributions and Support
79+
80+
If you would like to contribute to this pipeline, please see the
81+
[contributing guidelines](.github/CONTRIBUTING.md).
82+
83+
For further information or help, don't hesitate to get in touch on
84+
[Slack](https://nfcore.slack.com/channels/hic).
85+
You can join with [this invite](https://nf-co.re/join/slack).
86+
87+
88+
## Credits
4189

42-
### Credits
4390
nf-core/hic was originally written by Nicolas Servant.
91+
92+
## Citation
93+
94+
If you use nf-core/hic for your analysis, please cite it using the following
95+
doi: [10.5281/zenodo.2669513](https://doi.org/10.5281/zenodo.2669513)
96+
97+
You can cite the `nf-core` pre-print as follows:
98+
Ewels PA, Peltzer A, Fillinger S, Alneberg JA, Patel H, Wilm A, Garcia MU, Di
99+
Tommaso P, Nahnsen S. **nf-core: Community curated bioinformatics pipelines**.
100+
*bioRxiv*. 2019. p. 610741.
101+
[doi: 10.1101/610741](https://www.biorxiv.org/content/10.1101/610741v1).

bin/digest_genome.py

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def find_re_sites(filename, sequences, offset):
4747
indices.sort()
4848
all_indices.append(indices)
4949
indices = []
50+
5051
# This is a new chromosome. Empty the sequence string, and add the
5152
# correct chrom id
5253
big_str = ""
@@ -67,6 +68,7 @@ def find_re_sites(filename, sequences, offset):
6768
for m in re.finditer(pattern, big_str)]
6869
indices.sort()
6970
all_indices.append(indices)
71+
7072
return contig_names, all_indices
7173

7274

@@ -87,6 +89,22 @@ def find_chromsomose_lengths(reference_filename):
8789
return chromosome_names, np.array(chromosome_lengths)
8890

8991

92+
def replaceN(cs):
93+
npos = int(cs.find('N'))
94+
cseql = []
95+
if npos!= -1:
96+
for nuc in ["A","C","G","T"]:
97+
tmp = cs.replace('N', nuc, 1)
98+
tmpl = replaceN(tmp)
99+
if type(tmpl)==list:
100+
cseql = cseql + tmpl
101+
else:
102+
cseql.append(tmpl)
103+
else:
104+
cseql.append(cs)
105+
return cseql
106+
107+
90108
if __name__ == "__main__":
91109
parser = argparse.ArgumentParser()
92110
parser.add_argument('fastafile')
@@ -102,8 +120,13 @@ def find_chromsomose_lengths(reference_filename):
102120

103121
filename = args.fastafile
104122
out = args.out
105-
cutsites = args.res_sites
106-
123+
124+
# Split restriction sites if comma-separated
125+
cutsites=[]
126+
for s in args.res_sites:
127+
for m in s.split(','):
128+
cutsites.append(m)
129+
107130
# process args and get restriction enzyme sequences
108131
sequences = []
109132
offset = []
@@ -112,15 +135,34 @@ def find_chromsomose_lengths(reference_filename):
112135
cseq = ''.join(RE_cutsite[cs.lower()])
113136
else:
114137
cseq = cs
138+
115139
offpos = int(cseq.find('^'))
116140
if offpos == -1:
117141
print "Unable to detect offset for", cseq
118142
print "Please, use '^' to specified the cutting position,",
119143
print "i.e A^GATCT for HindIII digestion"
120144
sys.exit(-1)
145+
146+
for nuc in list(set(cs)):
147+
if nuc != 'A' and nuc != 'C' and nuc != 'G' and nuc != 'T' and nuc != 'N' and nuc != '^':
148+
print "Find unexpected character ['",nuc,"']in restriction motif"
149+
print "Note that multiple motifs should be separated by a space (not a comma !)"
150+
sys.exit(-1)
151+
121152
offset.append(offpos)
122153
sequences.append(re.sub('\^', '', cseq))
123154

155+
# replace all N in restriction motif
156+
sequences_without_N = []
157+
offset_without_N = []
158+
for rs in range(len(sequences)):
159+
nrs = replaceN(sequences[rs])
160+
sequences_without_N = sequences_without_N + nrs
161+
offset_without_N = offset_without_N + [offset[rs]] * len(nrs)
162+
163+
sequences = sequences_without_N
164+
offset = offset_without_N
165+
124166
if out is None:
125167
out = os.path.splitext(filename)[0] + "_fragments.bed"
126168

@@ -129,8 +171,7 @@ def find_chromsomose_lengths(reference_filename):
129171
print "Offset(s)", ','.join(str(x) for x in offset)
130172

131173
# Read fasta file and look for rs per chromosome
132-
contig_names, all_indices = find_re_sites(filename, sequences,
133-
offset=offset)
174+
contig_names, all_indices = find_re_sites(filename, sequences, offset=offset)
134175
_, lengths = find_chromsomose_lengths(filename)
135176

136177
valid_fragments = []

0 commit comments

Comments
 (0)