Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tools/generic_filter/.shed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
categories: [Metabolomics]
description: '[W4M][Utils] Filtering according to specific variables'
homepage_url: http://workflow4metabolomics.org
remote_repository_url: https://github.com/workflow4metabolomics/tools-metabolomics
long_description: 'Part of the W4M project: http://workflow4metabolomics.org / The
R script removes all samples and/or variables corresponding to specific values
regarding designated factors or numerical variables, in datasets corresponding to
dataMatrix, sampleMetadata and variableMetadata.'
name: generic_filter
owner: melpetera
19 changes: 19 additions & 0 deletions tools/generic_filter/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This is a special configuration file to run tests on Travis-CI via
# GitHub notifications when changes are committed.
#
# See http://travis-ci.org/ for details
language: python

before_install:
- sudo apt-get install -y python-virtualenv
- virtualenv planemo-venv
- . planemo-venv/bin/activate
- pip install --upgrade pip setuptools
- pip install planemo
- planemo conda_init

install:
- planemo conda_install ${TRAVIS_BUILD_DIR}

script:
- planemo test --install_galaxy --no_cache_galaxy --conda_dependency_resolution ${TRAVIS_BUILD_DIR}
87 changes: 87 additions & 0 deletions tools/generic_filter/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
################################################################################
###
### [CONTAINER CORE FUNCTIONS]:
### install "Tool - Generic Filter" Galaxy tool (and required third part softwares, libraries, ...).
### [NOTE]
### please refer to README.md and about_docker.md files for further informations
###
################################################################################

################################################################################
### fix parent containter
FROM ubuntu:16.04

################################################################################
### set author
MAINTAINER Nils Paulhe <[email protected]>

################################################################################
### sets the environment variables
ENV TOOL_VERSION = "release_2016.03.03"
ENV CONTAINER_VERSION = 0.1

LABEL version = "${CONTAINER_VERSION}"
LABEL tool_version = "${TOOL_VERSION}"

################################################################################
### install third part tools

# add debian repo for latest version of R
RUN echo "deb http://cran.univ-paris1.fr/bin/linux/ubuntu trusty/" >> /etc/apt/sources.list && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9

# Update and upgrade system
RUN apt-get update && \
apt-get -y upgrade

# install R
RUN apt-get install -y \
r-base \
libcurl4-openssl-dev \
libxml2-dev
# NOTE: add `apt-get install -y git` if required

# init R env. (Docker)
RUN echo "r <- getOption('repos'); r['CRAN'] <- 'http://cran.us.r-project.org'; options(repos = r);" > ~/.Rprofile

# install R libs
RUN Rscript -e "install.packages('batch', dep=TRUE)"

################################################################################
### install core scripts

# init. WORKDIR
RUN [ "mkdir", "/scripts" ]

#
# [NOTE] to add scripts, we have two options: get them from GitHub OR copy them from this directory
#

# get scripts using Git (option 1)
# RUN cd /scripts && \
# git clone -b release/${TOOL_VERSION} --recursive https://github.com/workflow4metabolomics/tool-generic_filter.git

# copy scripts files from this directory (option 2)
COPY "." "/scripts/"

## set WORKDIR
# WORKDIR "/scripts"

# set authorizations
RUN ["chmod", "a+x", "/scripts/filter_wrap.R"]

# make tool accessible through PATH
ENV PATH = $PATH:/scripts

################################################################################
### clean
RUN apt-get clean && \
apt-get autoremove -y && \
rm -rf /var/lib/{apt,dpkg,cache,log}/ /tmp/* /var/tmp/*
# NOTE: run `apt-get remove -y git && \` if required

################################################################################
### Define Entry point script
## ENTRYPOINT ["/scripts/filter_wrap.R"]

### [END]
53 changes: 53 additions & 0 deletions tools/generic_filter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Generic Filter
=======

Metadata
-----------

* **@name**: Generic Filter
* **@version**: 2020.01
* **@authors**: Marion Landi and Melanie Petera for first version - Maintainer: Melanie Petera (PFEM ; INRAE ; MetaboHUB)
* **@init date**: 2014, december
* **@main usage**: This tool allows to remove all samples and/or variables corresponding to specific values regarding designated factors or numerical variables.


Context
-----------

This tool is provided as one of the [Workflow4Metabolomics](http://workflow4metabolomics.org) Galaxy instance utilities. W4M is a French infrastructure providing software tools to process, analyse and annotate metabolomics data.

User interface is based on the Galaxy platform (homepage: https://galaxyproject.org/). It is an open, web-based platform for data intensive biomedical research. Whether on the free public server or your own instance, you can perform, reproduce, and share complete analyses.


Configuration
-----------

### Requirement:
* R software: version > 3.0.0 recommended
* Specific R library: 'batch'

### Docker:
* Use of this tool in a docker context:
Information is provided in the [about_docker.md file](about_docker.md).


Technical description
-----------

Main files:

- filter_script.R: R function (core script)
- filter_wrap.R: R script to link the main R function to inputs
- generic_filter.xml: XML wrapper (interface for Galaxy)


Services provided
-----------

* Help and support: [email protected]


License
-----------

* Cea Cnrs Inria Logiciel Libre License, version 2.1 (CECILL-2.1)
121 changes: 121 additions & 0 deletions tools/generic_filter/about_docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Tool - Generic Filter [Dockerfile]


## Metadata

- **@authors**: Nils Paulhe <[email protected]> (Only the docker part)
- **@date creation**: `2017-09-04`
- **@main usage**: create a Docker environment / container for "Tool - Generic Filter"

## About

For all informations about the tool please refer to its [README file](README.md).
For further information about Workflow4Metabolomics project and the people involved, please refer to [workflow4metabolomics.org](http://workflow4metabolomics.org/), [W4M github](https://github.com/workflow4metabolomics/) and [W4M Docker Hub](https://hub.docker.com/r/workflow4metabolomics/).

## Configuration

### Requirement:
* Docker Engine, Docker skills
* a Galaxy server docker compliant

### Warning:
* These scripts are provided WITHOUT ANY WARRANTY.
* These scripts should be run by a system administrator (expert).

## Services provided

Build a docker container for "Tool - Generic Filter" Galaxy Tool.
Provide a XML Galaxy wrapper: generic_filter.docker.xml

## Technical description

### Create the docker container

``` bash
docker build -t workflow4metabolomics/tool-generic_filter:2017.06 .
```

### Add the tool in Galaxy

Note: the files name and path are just examples. Adapt them to your own Galaxy configuration / practices.

If required, add in `config/job_conf.xml` file the minimal docker options:

``` xml
<destinations default="docker_local">
<destination id="local" runner="local"/>
<destination id="docker_local" runner="local">
<param id="docker_enabled">true</param>
<param id="docker_sudo">false</param>
</destination>
</destinations>
```

For more options please refer to the [official documentation](https://galaxyproject.org/admin/tools/docker/).

Copy or create a symbolic link of generic_filter.docker.xml file into your `tools/docker` directory (feel free to create or change the target directory).
Then add this XML resource in your `config/tool_conf.xml` file. For example:

``` xml
<section id="docker_tools" name="Docker Tools">
<tool file="docker/generic_filter.docker.xml"/>
</section>
```

### Modify this tool's XML config. file

replace these sections:
```xml
<!-- requirements -->
<requirements>
<requirement type="package" version="1.1_4">r-batch</requirement>
</requirements>

<!-- cmd -->
<command>
Rscript '$__tool_directory__/filter_wrap.R'
dataMatrix_in "$dataMatrix_in"
sampleMetadata_in "$sampleMetadata_in"
<!-- ... -->
```

by these sections:
```xml
<!-- requirements -->
<requirements>
<container type="docker">workflow4metabolomics/tool-generic_filter:2017.06</container>
</requirements>

<!-- cmd -->
/usr/bin/Rscript /scripts/filter_wrap.R
dataMatrix_in "$dataMatrix_in"
<!-- ... -->
```

## License (Dockerfile only!)

The `Dockerfile` file is under the following license:
```
Copyright (c) 2017 workflow4metabolomics.org / INRA

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.
```

- For the Galaxy Tool's license, please refer to its `README` file.
- For the Galaxy Wrapper's license, please refer to its `XML` file.
Loading
Loading