# HG changeset patch
# User bebatut
# Date 1487698177 18000
# Node ID 83f06bee818c505c7529bac6240eb27dbe93ea84
# Parent 99fe591b59fb67adfcb8e8ae414ad9828d087ddf
planemo upload for repository https://github.com/ASaiM/galaxytools/tree/master/tools/metaphlan2/ commit a6bf1721b4efa39b8cbcd059288c68e4abf8f9bd-dirty
diff -r 99fe591b59fb -r 83f06bee818c extract_markers.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/extract_markers.xml Tue Feb 21 12:29:37 2017 -0500
@@ -0,0 +1,50 @@
+
diff -r 99fe591b59fb -r 83f06bee818c generate_test_data.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/generate_test_data.sh Tue Feb 21 12:29:37 2017 -0500
@@ -0,0 +1,49 @@
+#/usr/bin/env bash
+
+metaphlan_hclust_heatmap.py \
+ --in test-data/merged_community_profile.tabular \
+ --out test-data/heatmap.png \
+ -m 'average' \
+ -d 'braycurtis' \
+ -f 'correlation' \
+ --minv '0' \
+ --tax_lev 'a' \
+ --sdend_h '0.1' \
+ --fdend_w '0.1' \
+ --cm_h '0.03' \
+ --font_size '7' \
+ --clust_line_w '1' \
+ --perc '90' \
+ -c 'jet'
+
+metaphlan_hclust_heatmap.py \
+ --in test-data/merged_community_profile.tabular \
+ --out test-data/heatmap.pdf \
+ -m 'ward' \
+ -d 'euclidean' \
+ -f 'euclidean' \
+ --minv '0' \
+ --tax_lev 'a' \
+ --sdend_h '0.1' \
+ --fdend_w '0.1' \
+ --cm_h '0.03' \
+ --font_size '7' \
+ --clust_line_w '1' \
+ --perc '90' \
+ -c 'pink'
+
+metaphlan_hclust_heatmap.py \
+ --in test-data/merged_community_profile.tabular \
+ --out test-data/heatmap.svg \
+ -m 'complete' \
+ -d 'hamming' \
+ -f 'matching' \
+ --minv '0' \
+ --tax_lev 'a' \
+ --sdend_h '0.1' \
+ --fdend_w '0.1' \
+ --cm_h '0.03' \
+ --font_size '7' \
+ --clust_line_w '1' \
+ --perc '90' \
+ -c 'pink'
\ No newline at end of file
diff -r 99fe591b59fb -r 83f06bee818c merge_metaphlan_tables.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/merge_metaphlan_tables.xml Tue Feb 21 12:29:37 2017 -0500
@@ -0,0 +1,55 @@
+
+
+ MetaPhlAn2 files
+
+
+ metaphlan2_macros.xml
+
+
+
+
+
+ merge_metaphlan_tables.py -v
+
+
+ '$output'
+]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `_.
+
+This tool performs a table join on one or more metaphlan output files
+
+ ]]>
+
+
+
diff -r 99fe591b59fb -r 83f06bee818c metaphlan2.xml
--- a/metaphlan2.xml Thu Jun 16 06:07:23 2016 -0400
+++ b/metaphlan2.xml Tue Feb 21 12:29:37 2017 -0500
@@ -1,4 +1,4 @@
-
+
to profile the composition of microbial communities
@@ -6,7 +6,10 @@
metaphlan2_macros.xml
-
+
+ bowtie2
+
+
@@ -24,87 +27,85 @@
#if $db.db_selector == "history"
mkdir ref_db
&&
- bowtie2-build $db.db_sequences ref_db/ref_db
+ bowtie2-build '$db.bowtie2db' 'ref_db/ref_db'
&&
- python $__tool_directory__/transform_json_to_pkl.py
- --json_input $db_metadata
- --pkl_output ref_db/metadata.pkl
+ python '$__tool_directory__/transform_json_to_pkl.py'
+ --json_input '$db.mpa_pkl'
+ --pkl_output 'ref_db/metadata.pkl'
&&
#end if
metaphlan2.py
- $input_file
- -o $output_file
- --input_type ${input_file.datatype.file_ext}
+ '$input_file'
+ -o '$output_file'
+ --input_type '${input_file.datatype.file_ext}'
--bowtie2_exe `which bowtie2`
#if $db.db_selector == "cached"
#set $table = dict([(_[0], _[2]) for _ in $db.cached_db.input.options.tool_data_table.data])
#set $db_choice = $db.cached_db.value
- --bowtie2db $table[$db_choice]
+ --bowtie2db '$table[$db_choice]'
--mpa_pkl $table[$db_choice]".pkl"
#else
- --bowtie2db ref_db/ref_db
- --mpa_pkl ref_db/metadata.pkl
+ --bowtie2db 'ref_db/ref_db'
+ --mpa_pkl 'ref_db/metadata.pkl'
#end if
--no_map
- -t $analysis_type.analysis_type_select
- #if $analysis_type.analysis_type_select == "rel_ab"
- --tax_lev $analysis_type.taxonomic_level
+ -t '$analysis_type.analysis_type_select'
+ #if $analysis_type.analysis_type_select == "rel_ab" or $analysis_type.analysis_type_select == "rel_ab_w_read_stats"
+ --tax_lev '$analysis_type.taxonomic_level'
#else if $analysis_type.analysis_type_select == "marker_ab_table"
- --nreads $analysis_type.nreads
+ --nreads '$analysis_type.nreads'
#else if $analysis_type.analysis_type_select == "marker_pres_table"
- --pres_th $analysis_type.pres_th
+ --pres_th '$analysis_type.pres_th'
#end if
- --min_cu_len $min_cu_len
- --min_alignment_len $min_alignment_len
+ --min_cu_len '$min_cu_len'
+ --min_alignment_len '$min_alignment_len'
$ignore_viruses
$ignore_eukaryotes
$ignore_bacteria
$ignore_archaea
- --stat_q $stat_q
- -s $sam_output_file
+ --stat_q '$stat_q'
+ -s '$sam_output_file'
+ --biom '$biom_output_file'
]]>
-
-
-
+
-
-
+
+
-
-
+
+
-
-
+
@@ -115,46 +116,51 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
+
+
@@ -164,6 +170,8 @@
+
+
@@ -207,7 +215,5 @@
]]>
-
- 10.1038/nmeth.3589
-
+
diff -r 99fe591b59fb -r 83f06bee818c metaphlan2_macros.xml
--- a/metaphlan2_macros.xml Thu Jun 16 06:07:23 2016 -0400
+++ b/metaphlan2_macros.xml Tue Feb 21 12:29:37 2017 -0500
@@ -1,10 +1,10 @@
+ 2.6.0
- bowtie2
- numpy
- metaphlan2
+ metaphlan2
+
@@ -20,4 +20,9 @@
description="" />
+
+
+ 10.1038/nmeth.3589
+
+
diff -r 99fe591b59fb -r 83f06bee818c metaphlan2krona.xml
--- a/metaphlan2krona.xml Thu Jun 16 06:07:23 2016 -0400
+++ b/metaphlan2krona.xml Tue Feb 21 12:29:37 2017 -0500
@@ -1,4 +1,4 @@
-
+
output for Krona
@@ -9,22 +9,18 @@
-
-
-
+ metaphlan2krona.py -v
-
+
@@ -33,7 +29,7 @@
-
+
@@ -48,7 +44,5 @@
]]>
-
- 10.1038/nmeth.3589
-
+
diff -r 99fe591b59fb -r 83f06bee818c metaphlan_hclust_heatmap.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/metaphlan_hclust_heatmap.xml Tue Feb 21 12:29:37 2017 -0500
@@ -0,0 +1,276 @@
+
+
+ with hierarchical clustering of both samples
+and microbial clades for MetaPhlAn2
+
+
+ metaphlan2_macros.xml
+
+
+
+
+
+ metaphlan_hclust_heatmap.py -v
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ output_format == "pdf"
+
+
+ output_format == "png"
+
+
+ output_format == "svg"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `_.
+
+This tool generates heatmaps with hierarchical clustering of both samples
+and microbial clades. The script can also subsample the number of clades to
+display based on the their nth percentile abundance value in each sample
+
+ ]]>
+
+
+
diff -r 99fe591b59fb -r 83f06bee818c repository_dependencies.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/repository_dependencies.xml Tue Feb 21 12:29:37 2017 -0500
@@ -0,0 +1,4 @@
+
+
+
+
diff -r 99fe591b59fb -r 83f06bee818c test-data/heatmap.pdf
Binary file test-data/heatmap.pdf has changed
diff -r 99fe591b59fb -r 83f06bee818c test-data/heatmap.png
Binary file test-data/heatmap.png has changed
diff -r 99fe591b59fb -r 83f06bee818c test-data/heatmap.svg
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/heatmap.svg Tue Feb 21 12:29:37 2017 -0500
@@ -0,0 +1,1291 @@
+
+
+
+
diff -r 99fe591b59fb -r 83f06bee818c test-data/merged_community_profile.tabular
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/merged_community_profile.tabular Tue Feb 21 12:29:37 2017 -0500
@@ -0,0 +1,11 @@
+ID community_profile community_profile
+k__Bacteria 100.0 100.0
+k__Bacteria|p__Bacteroidetes 100.0 100.0
+k__Bacteria|p__Bacteroidetes|c__Bacteroidia 100.0 100.0
+k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales 100.0 100.0
+k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Bacteroidaceae 100.0 100.0
+k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Bacteroidaceae|g__Bacteroides 100.0 100.0
+k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Bacteroidaceae|g__Bacteroides|s__Bacteroides_stercoris 68.05418 68.05418
+k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Bacteroidaceae|g__Bacteroides|s__Bacteroides_stercoris|t__Bacteroides_stercoris_unclassified 68.05418 68.05418
+k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Bacteroidaceae|g__Bacteroides|s__Bacteroides_thetaiotaomicron 31.94582 31.94582
+k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Bacteroidaceae|g__Bacteroides|s__Bacteroides_thetaiotaomicron|t__Bacteroides_thetaiotaomicron_unclassified 31.94582 31.94582
diff -r 99fe591b59fb -r 83f06bee818c tool-data/metaphlan2_database.loc.sample
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tool-data/metaphlan2_database.loc.sample Tue Feb 21 12:29:37 2017 -0500
@@ -0,0 +1,4 @@
+#This is a sample file distributed with Galaxy that enables tools
+#to use a directory of metagenomics files.
+#file has this format (white space characters are TAB characters)
+#02_16_2014 MetaPhlAn2 clade-specific marker genes db_v20 /path/to/data
\ No newline at end of file
diff -r 99fe591b59fb -r 83f06bee818c tool-data/metaphlan2_db.loc.sample
--- a/tool-data/metaphlan2_db.loc.sample Thu Jun 16 06:07:23 2016 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-# Bowtie2 db have to be downloaded from https://bitbucket.org/biobakery/metaphlan2/src/5424bb911dfc/db_v20/?at=default (whole directory)
-#
-#Since MetaPhlAn comes bundled with 1 Bowtie2 database, you can use it
-#by downloading it as explained above and uncommenting the following lines.
-#mpa_v20_m200 Defaut database with clade-specific marker genes $METAPHLAN2_DIR/db_v20/mpa_v20_m200
diff -r 99fe591b59fb -r 83f06bee818c tool_data_table_conf.xml.sample
--- a/tool_data_table_conf.xml.sample Thu Jun 16 06:07:23 2016 -0400
+++ b/tool_data_table_conf.xml.sample Tue Feb 21 12:29:37 2017 -0500
@@ -1,6 +1,6 @@
-
+
diff -r 99fe591b59fb -r 83f06bee818c tool_dependencies.xml
--- a/tool_dependencies.xml Thu Jun 16 06:07:23 2016 -0400
+++ b/tool_dependencies.xml Tue Feb 21 12:29:37 2017 -0500
@@ -1,7 +1,7 @@
-
+
diff -r 99fe591b59fb -r 83f06bee818c transform_json_to_pkl.py
--- a/transform_json_to_pkl.py Thu Jun 16 06:07:23 2016 -0400
+++ b/transform_json_to_pkl.py Tue Feb 21 12:29:37 2017 -0500
@@ -1,10 +1,11 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-import cPickle as pickle
+import argparse
import bz2
+import cPickle as pickle
import json
-import argparse
+
def transform_json_to_pkl(args):
with open(args.json_input, 'r') as json_file:
@@ -12,17 +13,18 @@
metadata = json.loads(json_str)
for marker in metadata["markers"]:
- metadata["markers"][marker]["ext"] = set(metadata["markers"][marker]["ext"])
+ a_set = set(metadata["markers"][marker]["ext"])
+ metadata["markers"][marker]["ext"] = a_set
pkl_output = bz2.BZ2File(args.pkl_output, 'w')
pickle.dump(metadata, pkl_output, pickle.HIGHEST_PROTOCOL)
pkl_output.close()
+
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--json_input', required=True)
parser.add_argument('--pkl_output', required=True)
-
args = parser.parse_args()
transform_json_to_pkl(args)