Skip to content
Snippets Groups Projects
Commit 0dc4580c authored by nservant's avatar nservant
Browse files

Initial template commit

parents
No related branches found
No related tags found
No related merge requests found
Showing
with 525 additions and 0 deletions
*.config linguist-language=nextflow
# nf-core/hic: Contributing Guidelines
Hi there! Many thanks for taking an interest in improving nf-core/hic.
We try to manage the required tasks for nf-core/hic using GitHub issues, you probably came to this page when creating one. Please use the pre-filled template to save time.
However, don't be put off by this template - other more general issues and suggestions are welcome! Contributions to the code are even more welcome ;)
> If you need help using or modifying nf-core/hic then the best place to ask is on the pipeline channel on [Slack](https://nf-core-invite.herokuapp.com/).
## Contribution workflow
If you'd like to write some code for nf-core/hic, the standard workflow
is as follows:
1. Check that there isn't already an issue about your idea in the
[nf-core/hic issues](https://github.com/nf-core/hic/issues) to avoid
duplicating work.
* If there isn't one already, please create one so that others know you're working on this
2. Fork the [nf-core/hic repository](https://github.com/nf-core/hic) to your GitHub account
3. Make the necessary changes / additions within your forked repository
4. Submit a Pull Request against the `dev` branch and wait for the code to be reviewed and merged.
If you're not used to this workflow with git, you can start with some [basic docs from GitHub](https://help.github.com/articles/fork-a-repo/) or even their [excellent interactive tutorial](https://try.github.io/).
## Tests
When you create a pull request with changes, [Travis CI](https://travis-ci.org/) will run automatic tests.
Typically, pull-requests are only fully reviewed when these tests are passing, though of course we can help out before then.
There are typically two types of tests that run:
### Lint Tests
The nf-core has a [set of guidelines](http://nf-co.re/guidelines) which all pipelines must adhere to.
To enforce these and ensure that all pipelines stay in sync, we have developed a helper tool which runs checks on the pipeline code. This is in the [nf-core/tools repository](https://github.com/nf-core/tools) and once installed can be run locally with the `nf-core lint <pipeline-directory>` command.
If any failures or warnings are encountered, please follow the listed URL for more documentation.
### Pipeline Tests
Each nf-core pipeline should be set up with a minimal set of test-data.
Travis CI then runs the pipeline on this data to ensure that it exists successfully.
If there are any failures then the automated tests fail.
These tests are run both with the latest available version of Nextflow and also the minimum required version that is stated in the pipeline code.
## Getting help
For further information/help, please consult the [nf-core/hic documentation](https://github.com/nf-core/hic#documentation) and don't hesitate to get in touch on the pipeline channel on [Slack](https://nf-core-invite.herokuapp.com/).
Hi there!
Thanks for telling us about a problem with the pipeline. Please delete this text and anything that's not relevant from the template below:
#### Describe the bug
A clear and concise description of what the bug is.
#### Steps to reproduce
Steps to reproduce the behaviour:
1. Command line: `nextflow run ...`
2. See error: _Please provide your error message_
#### Expected behaviour
A clear and concise description of what you expected to happen.
#### System:
- Hardware: [e.g. HPC, Desktop, Cloud...]
- Executor: [e.g. slurm, local, awsbatch...]
- OS: [e.g. CentOS Linux, macOS, Linux Mint...]
- Version [e.g. 7, 10.13.6, 18.3...]
#### Nextflow Installation:
- Version: [e.g. 0.31.0]
#### Container engine:
- Engine: [e.g. Conda, Docker or Singularity]
- version: [e.g. 1.0.0]
- Image tag: [e.g. nfcore/hic:1.0.0]
#### Additional context
Add any other context about the problem here.
Hi there!
Thanks for suggesting a new feature for the pipeline! Please delete this text and anything that's not relevant from the template below:
#### Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.
Ex. I'm always frustrated when [...]
#### Describe the solution you'd like
A clear and concise description of what you want to happen.
#### Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
#### Additional context
Add any other context about the feature request here.
Many thanks to contributing to nf-core/hic!
Please fill in the appropriate checklist below (delete whatever is not relevant). These are the most common things requested on pull requests (PRs).
## PR checklist
- [ ] This comment contains a description of changes (with reason)
- [ ] If you've fixed a bug or added code that should be tested, add tests!
- [ ] If necessary, also make a PR on the [nf-core/hic branch on the nf-core/test-datasets repo]( https://github.com/nf-core/test-datasets/pull/new/nf-core/hic)
- [ ] Ensure the test suite passes (`nextflow run . -profile test,docker`).
- [ ] Make sure your code lints (`nf-core lint .`).
- [ ] Documentation in `docs` is updated
- [ ] `CHANGELOG.md` is updated
- [ ] `README.md` is updated
**Learn more about contributing:** https://github.com/nf-core/hic/tree/master/.github/CONTRIBUTING.md
# Markdownlint configuration file
default: true,
line-length: false
no-multiple-blanks: 0
blanks-around-headers: false
blanks-around-lists: false
header-increment: false
no-duplicate-header:
siblings_only: true
.nextflow*
work/
data/
results/
.DS_Store
tests/test_data
*.pyc
sudo: required
language: python
jdk: openjdk8
services: docker
python: '3.6'
cache: pip
matrix:
fast_finish: true
before_install:
# PRs to master are only ok if coming from dev branch
- '[ $TRAVIS_PULL_REQUEST = "false" ] || [ $TRAVIS_BRANCH != "master" ] || ([ $TRAVIS_PULL_REQUEST_SLUG = $TRAVIS_REPO_SLUG ] && [ $TRAVIS_PULL_REQUEST_BRANCH = "dev" ])'
# Pull the docker image first so the test doesn't wait for this
- docker pull nfcore/hic:dev
# Fake the tag locally so that the pipeline runs properly
# Looks weird when this is :dev to :dev, but makes sense when testing code for a release (:dev to :1.0.1)
- docker tag nfcore/hic:dev nfcore/hic:dev
install:
# Install Nextflow
- mkdir /tmp/nextflow && cd /tmp/nextflow
- wget -qO- get.nextflow.io | bash
- sudo ln -s /tmp/nextflow/nextflow /usr/local/bin/nextflow
# Install nf-core/tools
- pip install --upgrade pip
- pip install nf-core
# Reset
- mkdir ${TRAVIS_BUILD_DIR}/tests && cd ${TRAVIS_BUILD_DIR}/tests
# Install markdownlint-cli
- sudo apt-get install npm && npm install -g markdownlint-cli
env:
- NXF_VER='0.32.0' # Specify a minimum NF version that should be tested and work
- NXF_VER='' # Plus: get the latest NF version and check that it works
script:
# Lint the pipeline code
- nf-core lint ${TRAVIS_BUILD_DIR}
# Lint the documentation
- markdownlint ${TRAVIS_BUILD_DIR} -c ${TRAVIS_BUILD_DIR}/.github/markdownlint.yml
# Run the pipeline with the test profile
- nextflow run ${TRAVIS_BUILD_DIR} -profile test,docker
# nf-core/hic: Changelog
## v1.0dev - [date]
Initial release of nf-core/hic, created with the [nf-core](http://nf-co.re/) template.
# Contributor Covenant Code of Conduct
## Our Pledge
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.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
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.
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.
## Scope
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.
## Enforcement
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.
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.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
FROM nfcore/base
LABEL authors="Nicolas Servant" \
description="Docker image containing all requirements for nf-core/hic pipeline"
COPY environment.yml /
RUN conda env create -f /environment.yml && conda clean -a
ENV PATH /opt/conda/envs/nf-core-hic-1.0dev/bin:$PATH
LICENSE 0 → 100644
MIT License
Copyright (c) Nicolas Servant
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# nf-core/hic
**Analysis of Chromosome Conformation Capture data (Hi-C)**.
[![Build Status](https://travis-ci.com/nf-core/hic.svg?branch=master)](https://travis-ci.com/nf-core/hic)
[![Nextflow](https://img.shields.io/badge/nextflow-%E2%89%A50.32.0-brightgreen.svg)](https://www.nextflow.io/)
[![install with bioconda](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg)](http://bioconda.github.io/)
[![Docker](https://img.shields.io/docker/automated/nfcore/hic.svg)](https://hub.docker.com/r/nfcore/hic)
## Introduction
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 containers making installation trivial and results highly reproducible.
## Documentation
The nf-core/hic pipeline comes with documentation about the pipeline, found in the `docs/` directory:
1. [Installation](https://nf-co.re/usage/installation)
2. Pipeline configuration
* [Local installation](https://nf-co.re/usage/local_installation)
* [Adding your own system config](https://nf-co.re/usage/adding_own_config)
* [Reference genomes](https://nf-co.re/usage/reference_genomes)
3. [Running the pipeline](docs/usage.md)
4. [Output and how to interpret the results](docs/output.md)
5. [Troubleshooting](https://nf-co.re/usage/troubleshooting)
<!-- TODO nf-core: Add a brief overview of what the pipeline does and how it works -->
## Credits
nf-core/hic was originally written by Nicolas Servant.
<html>
<head>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="nf-core/hic: Analysis of Chromosome Conformation Capture data (Hi-C)">
<title>nf-core/hic Pipeline Report</title>
</head>
<body>
<div style="font-family: Helvetica, Arial, sans-serif; padding: 30px; max-width: 800px; margin: 0 auto;">
<h1>nf-core/hic v${version}</h1>
<h2>Run Name: $runName</h2>
<% if (!success){
out << """
<div style="color: #a94442; background-color: #f2dede; border-color: #ebccd1; padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px;">
<h4 style="margin-top:0; color: inherit;">nf-core/hic execution completed unsuccessfully!</h4>
<p>The exit status of the task that caused the workflow execution to fail was: <code>$exitStatus</code>.</p>
<p>The full error message was:</p>
<pre style="white-space: pre-wrap; overflow: visible; margin-bottom: 0;">${errorReport}</pre>
</div>
"""
} else {
out << """
<div style="color: #3c763d; background-color: #dff0d8; border-color: #d6e9c6; padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px;">
nf-core/hic execution completed successfully!
</div>
"""
}
%>
<p>The workflow was completed at <strong>$dateComplete</strong> (duration: <strong>$duration</strong>)</p>
<p>The command used to launch the workflow was as follows:</p>
<pre style="white-space: pre-wrap; overflow: visible; background-color: #ededed; padding: 15px; border-radius: 4px; margin-bottom:30px;">$commandLine</pre>
<h3>Pipeline Configuration:</h3>
<table style="width:100%; max-width:100%; border-spacing: 0; border-collapse: collapse; border:0; margin-bottom: 30px;">
<tbody style="border-bottom: 1px solid #ddd;">
<% out << summary.collect{ k,v -> "<tr><th style='text-align:left; padding: 8px 0; line-height: 1.42857143; vertical-align: top; border-top: 1px solid #ddd;'>$k</th><td style='text-align:left; padding: 8px; line-height: 1.42857143; vertical-align: top; border-top: 1px solid #ddd;'><pre style='white-space: pre-wrap; overflow: visible;'>$v</pre></td></tr>" }.join("\n") %>
</tbody>
</table>
<p>nf-core/hic</p>
<p><a href="https://github.com/nf-core/hic">https://github.com/nf-core/hic</a></p>
</div>
</body>
</html>
========================================
nf-core/hic v${version}
========================================
Run Name: $runName
<% if (success){
out << "## nf-core/hic execution completed successfully! ##"
} else {
out << """####################################################
## nf-core/hic execution completed unsuccessfully! ##
####################################################
The exit status of the task that caused the workflow execution to fail was: $exitStatus.
The full error message was:
${errorReport}
"""
} %>
The workflow was completed at $dateComplete (duration: $duration)
The command used to launch the workflow was as follows:
$commandLine
Pipeline Configuration:
-----------------------
<% out << summary.collect{ k,v -> " - $k: $v" }.join("\n") %>
--
nf-core/hic
https://github.com/nf-core/hic
report_comment: >
This report has been generated by the <a href="https://github.com/nf-core/hic" target="_blank">nf-core/hic</a>
analysis pipeline. For information about how to interpret these results, please see the
<a href="https://github.com/nf-core/hic" target="_blank">documentation</a>.
report_section_order:
nf-core/hic-software-versions:
order: -1000
export_plots: true
To: $email
Subject: $subject
Mime-Version: 1.0
Content-Type: multipart/related;boundary="nfcoremimeboundary"
--nfcoremimeboundary
Content-Type: text/html; charset=utf-8
$email_html
<%
if (mqcFile){
def mqcFileObj = new File("$mqcFile")
if (mqcFileObj.length() < mqcMaxSize){
out << """
--nfcoremimeboundary
Content-Type: text/html; name=\"multiqc_report\"
Content-Transfer-Encoding: base64
Content-ID: <mqcreport>
Content-Disposition: attachment; filename=\"${mqcFileObj.getName()}\"
${mqcFileObj.
bytes.
encodeBase64().
toString().
tokenize( '\n' )*.
toList()*.
collate( 76 )*.
collect { it.join() }.
flatten().
join( '\n' )}
"""
}}
%>
--nfcoremimeboundary--
#!/usr/bin/env Rscript
# Command line argument processing
args = commandArgs(trailingOnly=TRUE)
if (length(args) < 2) {
stop("Usage: markdown_to_html.r <input.md> <output.html>", call.=FALSE)
}
markdown_fn <- args[1]
output_fn <- args[2]
# Load / install packages
if (!require("markdown")) {
install.packages("markdown", dependencies=TRUE, repos='http://cloud.r-project.org/')
library("markdown")
}
base_css_fn <- getOption("markdown.HTML.stylesheet")
base_css <- readChar(base_css_fn, file.info(base_css_fn)$size)
custom_css <- paste(base_css, "
body {
padding: 3em;
margin-right: 350px;
max-width: 100%;
}
#toc {
position: fixed;
right: 20px;
width: 300px;
padding-top: 20px;
overflow: scroll;
height: calc(100% - 3em - 20px);
}
#toc_header {
font-size: 1.8em;
font-weight: bold;
}
#toc > ul {
padding-left: 0;
list-style-type: none;
}
#toc > ul ul { padding-left: 20px; }
#toc > ul > li > a { display: none; }
img { max-width: 800px; }
")
markdownToHTML(
file = markdown_fn,
output = output_fn,
stylesheet = custom_css,
options = c('toc', 'base64_images', 'highlight_code')
)
#!/usr/bin/env python
from __future__ import print_function
from collections import OrderedDict
import re
# TODO nf-core: Add additional regexes for new tools in process get_software_versions
regexes = {
'nf-core/hic': ['v_pipeline.txt', r"(\S+)"],
'Nextflow': ['v_nextflow.txt', r"(\S+)"],
'FastQC': ['v_fastqc.txt', r"FastQC v(\S+)"],
'MultiQC': ['v_multiqc.txt', r"multiqc, version (\S+)"],
}
results = OrderedDict()
results['nf-core/hic'] = '<span style="color:#999999;\">N/A</span>'
results['Nextflow'] = '<span style="color:#999999;\">N/A</span>'
results['FastQC'] = '<span style="color:#999999;\">N/A</span>'
results['MultiQC'] = '<span style="color:#999999;\">N/A</span>'
# Search each file using its regex
for k, v in regexes.items():
with open(v[0]) as x:
versions = x.read()
match = re.search(v[1], versions)
if match:
results[k] = "v{}".format(match.group(1))
# Remove software set to false in results
for k in results:
if not results[k]:
del(results[k])
# Dump to YAML
print ('''
id: 'software_versions'
section_name: 'nf-core/hic Software Versions'
section_href: 'https://github.com/nf-core/hic'
plot_type: 'html'
description: 'are collected at run time from the software output.'
data: |
<dl class="dl-horizontal">
''')
for k,v in results.items():
print(" <dt>{}</dt><dd><samp>{}</samp></dd>".format(k,v))
print (" </dl>")
# Write out regexes as csv file:
with open('software_versions.csv', 'w') as f:
for k,v in results.items():
f.write("{}\t{}\n".format(k,v))
/*
* -------------------------------------------------
* Nextflow config file for running on AWS batch
* -------------------------------------------------
* Base config needed for running with -profile awsbatch
*/
params {
config_profile_name = 'AWSBATCH'
config_profile_description = 'AWSBATCH Cloud Profile'
config_profile_contact = 'Alexander Peltzer (@apeltzer)'
config_profile_url = 'https://aws.amazon.com/de/batch/'
}
aws.region = params.awsregion
process.executor = 'awsbatch'
process.queue = params.awsqueue
executor.awscli = '/home/ec2-user/miniconda/bin/aws'
params.tracedir = './'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment