Skip to content

Commit

Permalink
Merge pull request #5 from nf-core/dev
Browse files Browse the repository at this point in the history
Assembly/Binning
  • Loading branch information
HadrienG authored Jan 21, 2019
2 parents f49aa9c + b546498 commit 0fa1b1e
Show file tree
Hide file tree
Showing 27 changed files with 1,143 additions and 608 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ work/
results/
.DS_Store
tests/test_data
.vscode
db/
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ before_install:
# PRs made to 'master' branch should always orginate from another repo or the '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 hadrieng/mag
- docker pull nfcore/mag:dev
# Fake the tag locally so that the pipeline runs properly
- docker tag hadrieng/mag hadrieng/mag:0.1.0
- docker tag nfcore/mag:dev nfcore/mag:1.0.0

install:
# Install Nextflow
Expand All @@ -27,11 +27,11 @@ install:
- cd ${TRAVIS_BUILD_DIR}

env:
- NXF_VER=0.30.0 # Specify a minimum NF version that should be tested and work
- 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}
# Run the pipeline with the test profile
- make test
- nextflow run main.nf -profile test,docker
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## nf-core/mag version 1.0.0 -

## nf-core/mag version 0.1.0dev -
Initial release of nf-core/mag, created with the [nf-core](http://nf-co.re/) template.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM nfcore/base
=======
MAINTAINER Hadrien Gourlé <[email protected]>

LABEL maintainer="Hadrien Gourlé <[email protected]>"
LABEL description="Docker image containing all requirements for nf-core/mag pipeline"

COPY environment.yml /
RUN conda env create -f /environment.yml && conda clean -a
ENV PATH /opt/conda/envs/nf-core-mag-1.0dev/bin:$PATH
ENV PATH /opt/conda/envs/nf-core-mag-1.0.0/bin:$PATH

14 changes: 0 additions & 14 deletions Makefile

This file was deleted.

18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
# [UNDER CONSTRUCTION] nf-core/mag
# ![mag](https://raw.githubusercontent.com/nf-core/mag/master/docs/images/mag_logo.png)

# nf-core/mag

**Assembly, binning and annotation of metagenomes**

[![Build Status](https://travis-ci.org/nf-core/mag.svg?branch=master)](https://travis-ci.org/nf-core/mag)
[![Nextflow](https://img.shields.io/badge/nextflow-%E2%89%A50.30.0-brightgreen.svg)](https://www.nextflow.io/)
[![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/hadrieng/mag.svg)](https://hub.docker.com/r/hadrieng/mag)
![Singularity Container available](
https://img.shields.io/badge/singularity-available-7E4C74.svg)
![Singularity Container available](https://img.shields.io/badge/singularity-available-7E4C74.svg)

### 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 / singularity containers making installation trivial and results highly reproducible.

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.

### Documentation

The nf-core/mag pipeline comes with documentation about the pipeline, found in the `docs/` directory:

1. [Installation](docs/installation.md)
2. Pipeline configuration
* [Local installation](docs/configuration/local.md)
* [Adding your own system](docs/configuration/adding_your_own.md)
- [Local installation](docs/configuration/local.md)
- [Adding your own system](docs/configuration/adding_your_own.md)
3. [Running the pipeline](docs/usage.md)
4. [Output and how to interpret the results](docs/output.md)
5. [Troubleshooting](docs/troubleshooting.md)

### Credits

This pipeline was written by [Hadrien Gourlé](https://hadriengourle.com) at [SLU](https://slu.se).
4 changes: 2 additions & 2 deletions Singularity
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Bootstrap:docker
=======
MAINTAINER Hadrien Gourlé <[email protected]>
DESCRIPTION Singularity image containing all requirements for nf-core/mag pipeline
VERSION 0.1.0
VERSION 1.0.0

%environment
PATH=/opt/conda/envs/nf-core-mag-1.0dev/bin:$PATH
PATH=/opt/conda/envs/nf-core-mag-1.0.0/bin:$PATH
export PATH

%files
Expand Down
61 changes: 61 additions & 0 deletions bin/filter_ssu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/usr/bin/env python

from __future__ import print_function

import os
import sys
import argparse


def filter(args):
"""filter blast hits from refinem
Args:
args (obj): arguments from argparse
"""
with open(args.ssu, "r") as i, open(args.output, "w") as o:
header = i.readline()
for line in i:
splitted_line = line.split()
evalue = splitted_line[7]
align_length = splitted_line[8]
percent_ident = splitted_line[9]

if int(evalue) <= args.evalue:
o.write(line)
else:
continue


def main():
parser = argparse.ArgumentParser(
prog="filter_ssu.py",
usage="filter ssu hits from refinem"
)
parser.add_argument(
"--evalue",
help="evalue threshold"
)
parser.add_argument(
"ssu",
metavar="ssu.tsv",
help="ssu tsv file generated by refinem"
)
parser.add_argument(
"output",
metavar="output.tsv",
default="output.tsv",
help="output file name"
)
parser.set_defaults(func=filter)
args = parser.parse_args()

try:
args.func(args)
except AttributeError as e:
parser.print_help()
raise


if __name__ == "__main__":
main()
Loading

0 comments on commit 0fa1b1e

Please sign in to comment.