Mercurial > repos > pjbriggs > amplicon_analysis_pipeline
changeset 27:b5e43dfe07ac draft
planemo upload for repository https://github.com/pjbriggs/Amplicon_analysis-galaxy commit e4cd2df591ac5b9da5a1731e81f921313ed9e979
author | pjbriggs |
---|---|
date | Fri, 28 Sep 2018 11:28:17 -0400 |
parents | f0917c340f13 |
children | b355098dc1f6 |
files | README.rst amplicon_analysis_pipeline.py amplicon_analysis_pipeline.xml relabel_fasta.py tool_dependencies.xml |
diffstat | 5 files changed, 18 insertions(+), 107 deletions(-) [+] |
line wrap: on
line diff
--- a/README.rst Thu Aug 30 08:41:11 2018 -0400 +++ b/README.rst Fri Sep 28 11:28:17 2018 -0400 @@ -29,8 +29,12 @@ 1. Install the dependencies --------------------------- -The ``install_tool_deps.sh`` script can be used to fetch and install the -dependencies locally, for example:: +If the tool is installed from the Galaxy toolshed (recommended) then +the dependencies should be installed automatically and this step can +be skipped. + +Otherwise the ``install_tool_deps.sh`` script can be used to fetch and +install the dependencies locally, for example:: install_tool_deps.sh /path/to/local_tool_dependencies @@ -38,6 +42,8 @@ created a set of directories containing the dependencies under the specified top level directory. +*NB ``install_tool_deps.sh`` is no longer being maintained* + 2. Install the tool files ------------------------- @@ -203,9 +209,11 @@ The following dependencies are currently unavailable: - - fasta_number (need 02jun2015) + - R 3.2.1 (installed from the toolshed as the bioconda version + has conflicts ) - microbiomeutil (need r20110519) + (NB usearch 6.1.544 and 8.0.1623 are special cases which must be handled outside of Galaxy's dependency management systems.) @@ -215,7 +223,8 @@ ========== ====================================================================== Version Changes ---------- ---------------------------------------------------------------------- -1.2.2.1 Update to get dependencies from bioconda +1.2.3.0 Updated to Amplicon_Analysis_Pipeline version 1.2.3; install + dependencies from bioconda and via tool_dependencies.xml 1.2.2.0 Updated to Amplicon_Analysis_Pipeline version 1.2.2 (removes jackknifed analysis which is not captured by Galaxy tool) 1.2.1.0 Updated to Amplicon_Analysis_Pipeline version 1.2.1 (adds
--- a/amplicon_analysis_pipeline.py Thu Aug 30 08:41:11 2018 -0400 +++ b/amplicon_analysis_pipeline.py Fri Sep 28 11:28:17 2018 -0400 @@ -190,7 +190,7 @@ fasta_splitter = os.readlink( find_executable("fasta-splitter")) if fasta_splitter: - os.symlink(vsearch,os.path.join("bin","fasta-splitter.pl")) + os.symlink(fasta_splitter,os.path.join("bin","fasta-splitter.pl")) print "-- made symlink to %s" % fasta_splitter else: sys.stderr.write("Missing 'fasta-splitter[.pl]'\n") @@ -234,17 +234,6 @@ find_executable("single_rarefaction.py"))) os.environ["QIIME_CONFIG_FP"] = qiime_config_file print "-- set QIIME_CONFIG_FP: %s" % os.environ["QIIME_CONFIG_FP"] - # Check for fasta_number.py - fasta_number = find_executable("fasta_number.py") - if not fasta_number: - # Make a link to relabel_fasta.py - relabel_fasta_path = os.path.join(os.path.dirname(__file__), - "relabel_fasta.py") - fasta_number_path = os.path.join(os.path.abspath("bin"), - "fasta_number.py") - os.symlink(relabel_fasta_path,fasta_number_path) - print "-- linked %s to %s" % (relabel_fasta_path, - fasta_number_path) # Construct the pipeline command print "Amplicon analysis: constructing pipeline command"
--- a/amplicon_analysis_pipeline.xml Thu Aug 30 08:41:11 2018 -0400 +++ b/amplicon_analysis_pipeline.xml Fri Sep 28 11:28:17 2018 -0400 @@ -1,8 +1,8 @@ -<tool id="amplicon_analysis_pipeline" name="Amplicon Analysis Pipeline" version="1.2.2.1"> +<tool id="amplicon_analysis_pipeline" name="Amplicon Analysis Pipeline" version="1.2.3.0"> <description>analyse 16S rRNA data from Illumina Miseq paired-end reads</description> <requirements> <!-- non-bioconda dependencies --> - <requirement type="package" version="1.2.2">amplicon_analysis_pipeline</requirement> + <requirement type="package" version="1.2.3">amplicon_analysis_pipeline</requirement> <requirement type="package" version="2010-04-29">microbiomeutil-chimeraslayer</requirement> <requirement type="package" version="1.2.22">uclust-qiime</requirement> <!-- bioconda dependencies --> @@ -18,6 +18,7 @@ <requirement type="package" version="0.2.4">fasta-splitter</requirement> <requirement type="package" version="2.2">rdp_classifier</requirement> <requirement type="package" version="1.1.3">vsearch</requirement> + <!-- toolshed dependencies --> <requirement type="package" version="3.2.1">R</requirement> </requirements> <stdio>
--- a/relabel_fasta.py Thu Aug 30 08:41:11 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -#!/usr/bin/env python - -DESCRIPTION = \ -"""Replace FASTA labels with new labels <PREFIX>1, <PREFIX>2, -<PREFIX>3 ... (<PREFIX> is provided by the user via the command -line). - -Can be used to label OTUs as OTU_1, OTU_2 etc. - -This reimplements the functionality of the fasta_number.py utility -from https://drive5.com/python/fasta_number_py.html -""" - -import argparse - -def relabel_fasta(fp,prefix,include_size=False): - """ - Relabel sequence records in a FASTA file - - Arguments: - fp (File): file-like object opened for reading - input FASTA data from - prefix (str): prefix to use in new labels - include_size (bool): if True then copy - 'size=...' records into new labels (default - is not to copy the size) - - Yields: updated lines from the input FASTA. - """ - # Iterate over lines in file - nlabel = 0 - for line in fp: - # Strip trailing newlines - line = line.rstrip('\n') - if not line: - # Skip blank lines - continue - elif line.startswith('>'): - # Deal with start of a sequence record - nlabel += 1 - label = line[1:].strip() - if include_size: - # Extract size from the label - try: - size = filter( - lambda x: x.startswith("size="), - label.split(';'))[0] - except Exception as ex: - raise Exception("Couldn't locate 'size' in " - "label: %s" % label) - yield ">%s%d;%s" % (args.prefix, - nlabel, - size) - else: - yield ">%s%d" % (args.prefix, - nlabel) - else: - # Echo the line to output - yield line - -if __name__ == "__main__": - # Set up command line parser - p = argparse.ArgumentParser(description=DESCRIPTION) - p.add_argument("--needsize", - action="store_true", - help="include the size as part of the " - "output label ('size=...' must be present " - "in the input FASTA labels). Output labels " - "will be '<PREFIX><NUMBER>;size=<SIZE>'") - p.add_argument("--nosize", - action="store_true", - help="don't include the size as part of " - "the output label (this is the default)") - p.add_argument("fasta", - metavar="FASTA", - help="input FASTA file") - p.add_argument("prefix", - metavar="PREFIX", - help="prefix to use for labels in output") - # Process command line - args = p.parse_args() - # Relabel FASTA - with open(args.fasta,'rU') as fasta: - for line in relabel_fasta(fasta, - args.prefix, - include_size=args.needsize): - print line -
--- a/tool_dependencies.xml Thu Aug 30 08:41:11 2018 -0400 +++ b/tool_dependencies.xml Fri Sep 28 11:28:17 2018 -0400 @@ -1,6 +1,6 @@ <?xml version="1.0"?> <tool_dependency> - <package name="amplicon_analysis_pipeline" version="1.2.2"> + <package name="amplicon_analysis_pipeline" version="1.2.3"> <install version="1.0"> <actions> <action type="download_by_url">https://github.com/MTutino/Amplicon_analysis/archive/v1.2.2.tar.gz</action>