changeset 0:003162f90751 draft

Uploaded
author azuzolo
date Wed, 06 Jun 2012 16:40:30 -0400
parents
children 2c1d19ebac20
files qiime/README qiime/align_seqs.xml qiime/alpha_diversity.xml qiime/assign_taxonomy.xml qiime/beta_diversity.xml qiime/check_id_map.xml qiime/collate_alpha.xml qiime/filter_alignment.xml qiime/identify_chimeric_seqs.xml qiime/lib/._galaxy qiime/lib/galaxy/._datatypes qiime/lib/galaxy/datatypes/metagenomics.py qiime/make_2d_plots.xml qiime/make_distance_histograms.xml qiime/make_otu_heatmap_html.xml qiime/make_otu_table.xml qiime/make_phylogeny.xml qiime/make_prefs_file.xml qiime/make_rarefaction_plots.xml qiime/multiple_rarefactions.xml qiime/per_library_stats.xml qiime/pick_otus.xml qiime/pick_rep_set.xml qiime/plot_taxa_summary.xml qiime/principal_coordinates.xml qiime/qiime_wrapper.py qiime/single_rarefaction.xml qiime/split_libraries.xml qiime/summarize_otu_by_cat.xml qiime/summarize_taxa.xml
diffstat 30 files changed, 3509 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/README	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,129 @@
+This was a first attempt at providing galaxy tool_wrappers for the Qiime metagenomics package:
+You must first istall Qiime:  http://qiime.sourceforge.net/install/install.html
+
+
+
+Initial tool wrappers were generated by a script searching the qiime scripts (version 1.2.1)  for usage info, 
+and then were hand edited afterwards.  
+
+NOTE:  A few of the tool configs worked on the galaxy-central code in April 2011.  
+I haven't taken time to check them with more recent galaxy releases.
+
+
+I executed the qiime scripts via qiime_wrapper.py
+This was to accommmodate moving multiple outputs to history items:  http://wiki.g2.bx.psu.edu/Admin/Tools/Multiple%20Output%20Files
+
+
+The datatypes file:  metagenomics.py has Mothur datatypes with a start at qiime types added at the end.
+
+
+
+
+The most common used qiime scripts are:
+- check_id_map.py
+- split_libraries.py
+- pick_otus_through_otu_table.py
+- beta_diversity_through_3d_plots.py
+- alpha_rarefaction.py
+- jackknifed_beta_diversity.py
+- filter_by_metadata.py
+- filter_otu_table.py
+- merge_otu_tables.py
+- merge_mapping_files.py
+
+
+Tool_config development status:
+The tool configs with a * indicate that the tool at least displayed in galaxy at least once upon time.
+( Since these were intially auto generated, some may not make sense in a galaxy framework. )
+
+	add_taxa.xml
+	adjust_seq_orientation.xml
+* 	align_seqs.xml		
+*   	alpha_diversity.xml	metrics - select  input/output repeat   conditional tree
+*	alpha_rarefaction.xml	
+*	assign_taxonomy.xmlA	assignment_method-select
+*	beta_diversity.xml 
+*	beta_diversity_through_3d_plots.xml html-plots  
+	beta_significance.xml
+	blast_wrapper.xml
+*	check_id_map.xml
+	collate_alpha.xml
+*	compare_3d_plots.xml
+	consensus_tree.xml
+	convert_otu_table_to_unifrac_sample_mapping.xml
+	convert_unifrac_sample_mapping_to_otu_table.xml
+*	denoise.xml
+*	dissimilarity_mtx_stats.xml
+	exclude_seqs_by_blast.xml
+	extract_seqs_by_sample_id.xml
+*	filter_alignment.xml
+	filter_by_metadata.xml
+	filter_fasta.xml
+	filter_otu_table.xml
+*	filter_otus_by_sample.xml
+	fix_arb_fasta.xml
+	identify_chimeric_seqs.xml
+*	jackknifed_beta_diversity.xml
+*	make_2d_plots.xml
+*	make_3d_plots.xml
+	make_bootstrapped_tree.xml
+	make_distance_histograms.xml
+	make_fastq.xml
+	make_library_id_lists.xml
+*	make_otu_heatmap_html.xml
+*	make_otu_network.xml
+	make_otu_table.xml
+	make_per_library_sff.xml
+	make_phylogeny.xml
+	make_pie_charts.xml
+	make_prefs_file.xml
+	make_qiime_py_file.xml
+*	make_qiime_rst_file.xml
+*	make_rarefaction_plots.xml
+*	make_sra_submission.xml
+*	merge_denoiser_output.xml
+	merge_mapping_files.xml
+	merge_otu_maps.xml
+	merge_otu_tables.xml
+	multiple_rarefactions.xml
+	multiple_rarefactions_even_depth.xml
+	otu_category_significance.xml
+*	parallel_align_seqs_pynast.xml
+	parallel_alpha_diversity.xml
+*	parallel_assign_taxonomy_blast.xml
+*	parallel_assign_taxonomy_rdp.xml
+	parallel_beta_diversity.xml
+*	parallel_blast.xml
+	parallel_identify_chimeric_seqs.xml
+	parallel_multiple_rarefactions.xml
+*	parallel_pick_otus_blast.xml
+*	parallel_pick_otus_uclust_ref.xml
+	per_library_stats.xml
+*	pick_otus.xml
+*	pick_otus_through_otu_table.xml
+	pick_rep_set.xml
+*	plot_rank_abundance_graph.xml
+	poller.xml
+	poller_example.xml
+	pool_by_metadata.xml
+	principal_coordinates.xml
+	print_qiime_config.xml
+*	process_sff.xml
+*	process_sra_submission.xml
+*	quality_scores_plot.xml
+	shared_phylotypes.xml
+	single_rarefaction.xml
+	sort_denoiser_output.xml
+*	split_libraries.xml
+*	split_libraries_illumina.xml
+	sra_spreadsheet_to_map_files.xml
+	start_parallel_jobs.xml
+	summarize_otu_by_cat.xml
+	summarize_taxa.xml
+*	supervised_learning.xml
+*	transform_coordinate_matrices.xml
+*	tree_compare.xml
+	trflp_file_to_otu_table.xml
+	trim_sff_primers.xml
+*	truncate_fasta_qual_files.xml
+	upgma_cluster.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/align_seqs.xml	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,93 @@
+<tool id="align_seqs" name="align_seqs" version="2.0.0">
+ <description>Align sequences using a variety of alignment methods</description>
+ <requirements>
+  <requirement type="binary">align_seqs.py</requirement>
+ </requirements>
+ <command interpreter="python">
+  qiime_wrapper.py
+  --galaxy_outputdir='$log.extra_files_path'
+  --galaxy_datasets='^\S+_aligned\.\S+$:'$aligned_fasta,'^\S+_log\.txt$:'$log,'^\S+_failures\.fasta$:'$failures
+  align_seqs.py
+  --input_fasta_fp=$input_fasta_fp
+  --alignment_method=$alignment_method
+  #if $alignment_method.__str__ == 'pynast':
+    #if $alignment.template_fp != None and $alignment.template_fp.__str__ != 'None' and $alignment.template_fp.__str__ != '':
+    --template_fp=$alignment.template_fp
+    #end if
+    --pairwise_alignment_method=$pairwise_alignment_method
+    --min_length=$min_length
+    --min_percent_id=$min_percent_id
+    #if $blast_db != None and $blast_db.__str__ != 'None' and $blast_db.__str__ != '':
+    --blast_db=$blast_db
+    #end if
+  #elif $alignment_method.__str__ == 'infernal':
+    --template_fp=$alignment.template_fp
+  #end if
+
+  --output_dir='$log.extra_files_path'
+ </command>
+ <inputs>
+  <param name="input_fasta_fp" type="data" format="fasta" label="input_fasta_fp" help="path to the input fasta file (usually output from pick_rep_set) [REQUIRED]"/>
+    <param name="alignment_method" type="select" label="alignment_method"
+     help="Method for aligning sequences. [default: pynast]">
+      <option value="pynast" selected="true">pynast</option>
+      <option value="infernal">infernal</option>
+      <option value="clustalw">clustalw</option>
+      <option value="muscle">muscle</option>
+      <option value="mafft">mafft</option>
+    </param>
+    <conditional name="alignment">
+       <param name="source" type="select" label="Select Template from" help="">
+        <option value="hist">History</option>
+        <option value="ref">Cached Reference</option>
+       </param>
+       <when value="ref">
+        <param name="template_fp" type="select" label="template - Select an alignment database " help="">
+         <options>
+          <column name="name" index="0" />
+          <column name="value" index="1" />
+         </options>
+        </param>
+       </when>
+       <when value="hist">
+        <param name="template_fp" type="data" format="txt" label="template_fp" optional="true"
+         help="Filepath for template against [REQUIRED ONLY if for alignment_method pynast or infernal]"/>
+       </when>
+      </conditional> <!--alignment-->
+      <param name="pairwise_alignment_method" type="select" label="pairwise_alignment_method"
+       help="Method for performing pairwise alignment; only required for PyNAST. [default: uclust]">
+        <option value="muscle">muscle</option>
+        <option value="pair_hmm">pair_hmm</option>
+        <option value="clustal">clustal</option>
+        <option value="blast">blast</option>
+        <option value="uclust" selected="true">uclust</option>
+        <option value="mafft">mafft</option>
+      </param>
+      <param name="min_length" type="integer" optional="true" value="150" label="min_length"
+       help="Minimum sequence length to include in alignment [default: 150]"/>
+      <param name="min_percent_id" type="float" value="0.75" optional="true" label="min_percent_id"
+       help="Minimum percent sequence identity to closest blast hit to include sequence in alignment [default: 0.75]"/>
+      <param name="blast_db" type="data" format="txt"  label="blast_db" optional="true"
+       help="Database to blast against when -m pynast [default: created on-the-fly from template_alignment]"/>
+      <!-- Template alignment must be in Stockholm format with corresponding secondary structure annotation when using InfernalAligner. -->
+    
+ </inputs>
+ <outputs>
+   <data format="txt" name="log" label="${tool.name} on ${on_string}: log" />
+   <data format="fasta" name="aligned_fasta" label="${tool.name} on ${on_string}: aligned fasta" />
+   <data format="fasta" name="failures" label="${tool.name} on ${on_string}: failures" />
+ </outputs>
+ <tests>
+ </tests>
+ <help>  .. class:: warningmark
+Note: MUSCLE alignment is still not verified. Use at your own risk.
+  
+For more information, see align_seqs_ in the Qiime documentation.
+ 
+Updated and validated 01/16/12 by Amanda Zuzolo, Microbiome Analysis Center, George Mason University, Fairfax, VA
+
+Qiime integration courtesy Jim Johnson, Minnesota Supercomputing Institute, University of Minnesota, Minneapolis, MN  
+
+.. _align_seqs: http://qiime.org/scripts/align_seqs.html</help>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/alpha_diversity.xml	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,86 @@
+<tool id="alpha_diversity" name="alpha_diversity" version="1.2.0">
+ <description>Calculate alpha diversity on each sample in an otu table, using a variety of alpha diversity metrics</description>
+ <requirements>
+  <requirement type="binary">alpha_diversity.py</requirement>
+ </requirements>
+ <command interpreter="python">
+  qiime_wrapper.py
+  #if $run_type.input_type.__str__ == "multi":
+  --galaxy_logfile=$output_path
+  --galaxy_outputdir=$output_path.extra_files_path
+  #end if
+  alpha_diversity.py
+  #if $run_type.input_type.__str__ == "multi":
+  --input_path=$input_path.extra_files_path
+  --output_path=$output_path.extra_files_path
+  #else:
+  --output_path=$output_path
+  --input_path=$input_path
+  #end if
+  --metrics=$metrics
+  #if $metrics.__str__ == 'PD_whole_tree':
+  --tree_path=$tree_path
+  #end if
+
+ </command>
+ <inputs>
+  <conditional name="run_type">
+  <param name="input_type" type="select" label="Input Type" help="Select the type/number of input file(s). If multiple rarefactions have been run, select Multiple File Alpha Diversity.">
+   <option value="single">Single File Alpha Diversity</option>
+   <option value="multi" selected="true">Multiple File (batch) Alpha Diversity</option>
+  </param>
+  <when value="single">
+    <param name="input_path" type="data"  format="txt"  label="OTU table" help="Rarefied table for single file operation [REQUIRED]"/>
+  </when>
+  <when value="multi">
+    <param name="input_path" type="data" format="txt" label="Multiple Rarefactions Log File" help="multiple_rarefactions log file for multiple file operation. [REQUIRED]"/>
+  </when>
+  </conditional>
+  <param name="metrics" type="select"  multiple="true" label="metrics"
+   help="metrics to use">
+      <option value="ACE">ACE</option>
+      <option value="berger_parker_d">berger_parker_d</option>
+      <option value="brillouin_d">brillouin_d</option>
+      <option value="chao1">chao1</option>
+      <option value="chao1_confidence">chao1_confidence</option>
+      <option value="dominance">dominance</option>
+      <option value="doubles">doubles</option>
+      <option value="equitability">equitability</option>
+      <option value="fisher_alpha">fisher_alpha</option>
+      <option value="heip_e">heip_e</option>
+      <option value="kempton_taylor_q">kempton_taylor_q</option>
+      <option value="margalef">margalef</option>
+      <option value="mcintosh_d">mcintosh_d</option>
+      <option value="mcintosh_e">mcintosh_e</option>
+      <option value="menhinick">menhinick</option>
+      <option value="michaelis_menten_fit">michaelis_menten_fit</option>
+      <option value="observed_species">observed_species</option>
+      <option value="osd">osd</option>
+      <option value="reciprocal_simpson">reciprocal_simpson</option>
+      <option value="robbins">robbins</option>
+      <option value="shannon">shannon</option>
+      <option value="simpson">simpson</option>
+      <option value="simpson_e">simpson_e</option>
+      <option value="singles">singles</option>
+      <option value="strong">strong</option>
+      <option value="PD_whole_tree">PD_whole_tree</option>
+  </param>
+  <param name="tree_path" type="data"  format="tre"  label="tree_path" optional="true"
+   help="path to newick tree file, REQUIRED for phylogenetic metrics: PD_whole_tree"/>
+ </inputs>
+ <outputs>
+  <data format="txt" name="output_path" label="${tool.name} on ${on_string}: alpha_diversity log file"/>
+ </outputs>
+ <tests>
+ </tests>
+ <help>This tool calculates alpha diversity, or within-sample diversity, using an otu table. Metrics may be selected in any combination. Input can be the log file from multiple_rarefactions (batch alpha diversity), or a single rarefied OTU table (single_rarefaction/single file alpha diversity). When the phylogenetic metric PD_whole_tree is selected, a .tre file must be supplied for the tool to run. The output file is a log file listing all the alpha rarefaction files produced.
+ 
+For more information, see alpha_diversity_ in the Qiime documentation.
+ 
+Updated and validated 01/16/12 by Amanda Zuzolo, Microbiome Analysis Center, George Mason University, Fairfax, VA
+
+Qiime integration courtesy Jim Johnson, Minnesota Supercomputing Institute, University of Minnesota, Minneapolis, MN
+
+.. _alpha_diversity: http://qiime.org/scripts/alpha_diversity.html</help>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/assign_taxonomy.xml	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,53 @@
+<tool id="assign_taxonomy" name="assign_taxonomy" version="2.0.0">
+ <description>Assign taxonomy to each sequence</description>
+ <requirements>
+  <requirement type="binary">assign_taxonomy.py</requirement>
+ </requirements>
+ <command interpreter="python">
+ qiime_wrapper.py
+ --galaxy_outputdir='$outputfile.extra_files_path'
+ --galaxy_datasets='^\S+\.txt$:'$outputfile
+ assign_taxonomy.py
+ --input_fasta_fp=$input_fasta_fp
+ #if $id_to_taxonomy_fp != None and $id_to_taxonomy_fp.__str__ != 'None' and $id_to_taxonomy_fp.__str__ != '':
+ --id_to_taxonomy_fp=$id_to_taxonomy_fp
+ #end if
+ #if $reference_seqs_fp != None and $reference_seqs_fp.__str__ != 'None' and $reference_seqs_fp.__str__ != '':
+ --reference_seqs_fp=$reference_seqs_fp
+ #end if
+ #if $training_data_properties_fp != None and $training_data_properties_fp.__str__ != 'None' and $training_data_properties_fp.__str__ != '':
+ --training_data_properties_fp.$training_data_properties_fp
+ #end if
+ --confidence=$confidence
+ --assignment_method=rdp
+ --output_dir='$outputfile.extra_files_path'
+ </command>
+ 
+ <inputs>
+  <param name="input_fasta_fp" type="data" format="fasta" label="input_fasta_fp"
+   help="path to the input fasta file (usually output from pick_rep_set) [REQUIRED]"/>
+  <param name="confidence" type="float" value="0.8" label="confidence"
+      help="Minimum confidence to record an assignment, only used for rdp method [default: 0.8]"/>
+  <param name="id_to_taxonomy_fp" type="data" format="rdp.taxonomy" optional="true" label="id_to_taxonomy_fp"
+      help="Path to tab-delimited file mapping sequences to assigned taxonomy. Each assigned taxonomy is provided as a semicolon-separated list. For assignment with rdp, each assigned taxonomy must be exactly 6 levels deep. If you upload an id-to-taxonomy-file, you must also a refseq file."/>
+  <param name="reference_seqs_fp" type="data" format="txt" optional="true" label="reference_seqs_fp"
+      help="Reference sequences.  For assignment with rdp, they are used as training sequences for the classifier. If you upload a refseq, you must also upload an id-to-taxonomy file."/>
+  <param name="training_data_properties_fp" type="data" format="txt" optional="true" label="training_data_properties_fp"
+      help="Path to 'properties' file in pre-compiled training data for the RDP Classifier.  This option is overridden by the id-to-taxonomy file and the refseqs file."/>
+ </inputs>
+ <outputs>
+  <data format="txt" name="outputfile" metadata_source="input_fasta_fp"/>
+ </outputs>
+ <tests>
+ </tests>
+ <help>Only uses RDP. For blast, use MBAC blast tools.
+ 
+For more information, see assign_taxonomy_ in the Qiime documentation.
+ 
+Updated and validated 01/16/12 by Amanda Zuzolo, Microbiome Analysis Center, George Mason University, Fairfax, VA
+
+Qiime integration courtesy Jim Johnson, Minnesota Supercomputing Institute, University of Minnesota, Minneapolis, MN
+
+.. _assign_taxonomy: http://qiime.org/scripts/assign_taxonomy.html</help>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/beta_diversity.xml	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,351 @@
+<tool id="beta_diversity" name="beta_diversity" version="2.0.0">
+ <description>Calculate beta diversity (pairwise sample dissimilarity) on one or many otu tables</description>
+ <requirements>
+  <requirement type="binary">beta_diversity.py</requirement>
+ </requirements>
+ <command interpreter="python">
+  qiime_wrapper.py
+  --galaxy_outputdir=$__new_file_path__
+  #set datasets = []
+  #set $path = ""
+  #if $binary_chisq.__str__ != "None":
+   #set  datasets = $datasets + ["'binary_chisq_.*$:'" + $binary_chisq.__str__]
+   #if path == "":
+   #set $path=$binary_chisq.extra_files_path
+   #end if
+  #end if
+  #if $binary_chord.__str__ != "None":
+   #set  datasets = $datasets + ["'binary_chord_.*$:'" + $binary_chord.__str__]
+   #if path == "":
+   #set $path=$binary_chord.extra_files_path
+   #end if
+  #end if
+  #if $binary_euclidean.__str__ != "None":
+   #set  datasets = $datasets + ["'binary_euclidean_.*$:'" + $binary_euclidean.__str__]
+   #if path == "":
+   #set $path=$binary_euclidean.extra_files_path
+   #end if
+  #end if
+  #if $binary_hamming.__str__ != "None":
+   #set  datasets = $datasets + ["'binary_hamming_.*$:'" + $binary_hamming.__str__]
+   #if path == "":
+   #set $path=$binary_hamming.extra_files_path
+   #end if
+  #end if
+  #if $binary_jaccard.__str__ != "None":
+   #set  datasets = $datasets + ["'binary_jaccard_.*$:'" + $binary_jaccard.__str__]
+   #if path == "":
+   #set $path=$binary_jaccard.extra_files_path
+   #end if
+  #end if
+  #if $binary_lennon.__str__ != "None":
+   #set  datasets = $datasets + ["'binary_lennon_.*$:'" + $binary_lennon.__str__]
+   #if path == "":
+   #set $path=$binary_lennon.extra_files_path
+   #end if
+  #end if
+  #if $binary_ochiai.__str__ != "None":
+   #set  datasets = $datasets + ["'binary_ochiai_.*$:'" + $binary_ochiai.__str__]
+   #if path == "":
+   #set $path=$binary_ochiai.extra_files_path
+   #end if
+  #end if
+  #if $binary_pearson.__str__ != "None":
+   #set  datasets = $datasets + ["'binary_pearson_.*$:'" + $binary_pearson.__str__]
+   #if path == "":
+   #set $path=$binary_pearson.extra_files_path
+   #end if
+  #end if
+  #if $binary_sorensen_dice.__str__ != "None":
+   #set  datasets = $datasets + ["'binary_sorensen_dice_.*$:'" + $binary_sorensen_dice.__str__]
+   #if path == "":
+   #set $path=$binary_sorensen.extra_files_path
+   #end if
+  #end if
+  #if $bray_curtis.__str__ != "None":
+   #set  datasets = $datasets + ["'bray_curtis_.*$:'" + $bray_curtis.__str__]
+   #if path == "":
+   #set $path=$bray_curtis.extra_files_path
+   #end if
+  #end if
+  #if $canberra.__str__ != "None":
+   #set  datasets = $datasets + ["'canberra_.*$:'" + $canberra.__str__]
+   #if path == "":
+   #set $path=$canberra.extra_files_path
+   #end if
+  #end if
+  #if $chisq.__str__ != "None":
+   #set  datasets = $datasets + ["'chisq_.*$:'" + $chisq.__str__]
+   #if path == "":
+   #set $path=$binary_euclidean.extra_files_path
+   #end if
+  #end if
+  #if $chord.__str__ != "None":
+   #set  datasets = $datasets + ["'chord_.*$:'" + $chord.__str__]
+   #if path == "":
+   #set $path=$chord.extra_files_path
+   #end if
+  #end if
+  #if $euclidean.__str__ != "None":
+   #set  datasets = $datasets + ["'euclidean_.*$:'" + $euclidean.__str__]
+   #if path == "":
+   #set $path=$euclidean.extra_files_path
+   #end if
+  #end if
+  #if $gower.__str__ != "None":
+   #set  datasets = $datasets + ["'gower_.*$:'" + $gower.__str__]
+   #if path == "":
+   #set $path=$gower.extra_files_path
+   #end if
+  #end if
+  #if $hellinger.__str__ != "None":
+   #set  datasets = $datasets + ["'hellinger_.*$:'" + $hellinger.__str__]
+   #if path == "":
+   #set $path=$hellinger.extra_files_path
+   #end if
+  #end if
+  #if $kulczynski.__str__ != "None":
+   #set  datasets = $datasets + ["'kulczynski_.*$:'" + $kulczynski.__str__]
+   #if path == "":
+   #set $path=$kulczynski.extra_files_path
+   #end if
+  #end if
+  #if $manhattan.__str__ != "None":
+   #set  datasets = $datasets + ["'manhattan_.*$:'" + $manhattan.__str__]
+   #if path == "":
+   #set $path=$manhattan.extra_files_path
+   #end if
+  #end if
+  #if $morisita_horn.__str__ != "None":
+   #set  datasets = $datasets + ["'morisita_horn_.*$:'" + $morisita_horn.__str__]
+   #if path == "":
+   #set $path=$morisita_horn.extra_files_path
+   #end if
+  #end if
+  #if $pearson.__str__ != "None":
+   #set  datasets = $datasets + ["'pearson_.*$:'" + $pearson.__str__]
+   #if path == "":
+   #set $path=$pearson.extra_files_path
+   #end if
+  #end if
+  #if $soergel.__str__ != "None":
+   #set  datasets = $datasets + ["'soergel_.*$:'" + $soergel.__str__]
+   #if path == "":
+   #set $path=$soergel.extra_files_path
+   #end if
+  #end if
+  #if $spearman_approx.__str__ != "None":
+   #set  datasets = $datasets + ["'spearman_approx_.*$:'" + $spearman_approx.__str__]
+   #if path == "":
+   #set $path=$spearman_approx.extra_files_path
+   #end if
+  #end if
+  #if $specprof.__str__ != "None":
+   #set  datasets = $datasets + ["'specprof_.*$:'" + $specprof.__str__]
+   #if path == "":
+   #set $path=$specprof.extra_files_path
+   #end if
+  #end if
+  #if $unifrac.__str__ != "None":
+   #set  datasets = $datasets + ["'unifrac_.*$:'" + $unifrac.__str__]
+   #if path == "":
+   #set $path=$unifrac.extra_files_path
+   #end if
+  #end if
+  #if $unifrac_g.__str__ != "None":
+   #set  datasets = $datasets + ["'unifrac_g_.*$:'" + $unifrac_g.__str__]
+   #if path == "":
+   #set $path=$unifrac_g.extra_files_path
+   #end if
+  #end if
+  #if $unifrac_g_full_tree.__str__ != "None":
+   #set  datasets = $datasets + ["'unifrac_g_full_tree_.*$:'" + $unifrac_g_full_tree.__str__]
+   #if path == "":
+   #set $path=$unifrac_g_full_tree.extra_files_path
+   #end if
+  #end if
+  #if $unweighted_unifrac.__str__ != "None":
+   #set  datasets = $datasets + ["'unweighted_unifrac_.*$:'" + $unweighted_unifrac.__str__]
+   #if path == "":
+   #set $path=$unweighted_unifrac.extra_files_path
+   #end if
+  #end if
+  #if $unweighted_unifrac_full_tree.__str__ != "None":
+   #set  datasets = $datasets + ["'unweighted_unifrac_full_tree_.*$:'" + $unweighted_unifrac_full_tree.__str__]
+   #if path == "":
+   #set $path=$unweighted_unifrac_full_tree.extra_files_path
+   #end if
+  #end if
+  #if $weighted_normalized_unifrac.__str__ != "None":
+   #set  datasets = $datasets + ["'weighted_normalized_unifrac_.*$:'" + $weighted_normalized_unifrac.__str__]
+   #if path == "":
+   #set $path=$weighted_normalized_unifrac.extra_files_path
+   #end if
+  #end if
+  #if $weighted_unifrac.__str__ != "None":
+   #set  datasets = $datasets + ["'weighted_unifrac_.*$:'" + $weighted_unifrac.__str__]
+   #if path == "":
+   #set $path=$weighted_unifrac.extra_files_path
+   #end if
+  #end if
+  --galaxy_datasets=#echo ','.join($datasets)
+  --galaxy_new_files_path='$path'
+  beta_diversity.py
+  --input_path=$input_path
+  #if $rows.__str__ != '':
+   --rows=$rows
+  #end if
+  --output_dir=$__new_file_path__
+  --metrics=$metrics
+  #if $tree_path.__str__ != "None" and len($tree_path.__str__) > 0:
+   --tree_path=$tree_path
+  #end if
+  $full_tree
+ </command>
+ <inputs>
+  <param name="input_path" type="data" format="qiimeotutable"  label="input_path"
+   help="input path: otu table (e.g., output from make_otu_table or single_rarefaction)"/>
+  <param name="rows" type="text"  label="rows"
+   help="compute only these rows of the distance matrix. pass a list of sample names, e.g. 's1,s3' [by default, +      the full n x n matrix is generated]"/>
+  <param name="metrics" type="select" multiple="true"  label="metrics" help="metrics to use">
+    <option value="abund_jaccard">abund_jaccard</option>
+    <option value="binary_chisq">binary_chisq</option>
+    <option value="binary_chord">binary_chord</option>
+    <option value="binary_euclidean">binary_euclidean</option>
+    <option value="binary_hamming">binary_hamming</option>
+    <option value="binary_jaccard">binary_jaccard</option>
+    <option value="binary_lennon">binary_lennon</option>
+    <option value="binary_ochiai">binary_ochiai</option>
+    <option value="binary_otu_gain">binary_otu_gain</option>
+    <option value="binary_pearson">binary_pearson</option>
+    <option value="binary_sorensen_dice">binary_sorensen_dice</option>
+    <option value="bray_curtis">bray_curtis</option>
+    <option value="canberra">canberra</option>
+    <option value="chisq">chisq</option>
+    <option value="chord">chord</option>
+    <option value="euclidean">euclidean</option>
+    <option value="gower">gower</option>
+    <option value="hellinger">hellinger</option>
+    <option value="kulczynski">kulczynski</option>
+    <option value="manhattan">manhattan</option>
+    <option value="morisita_horn">morisita_horn</option>
+    <option value="pearson">pearson</option>
+    <option value="soergel">soergel</option>
+    <option value="spearman_approx">spearman_approx</option>
+    <option value="specprof">specprof</option>
+    <option value="unifrac">unifrac</option>
+    <option value="unifrac_g">unifrac_g</option>
+    <option value="unifrac_g_full_tree">unifrac_g_full_tree</option>
+    <option value="unweighted_unifrac">unweighted_unifrac</option>
+    <option value="unweighted_unifrac_full_tree">unweighted_unifrac_full_tree</option>
+    <option value="weighted_normalized_unifrac">weighted_normalized_unifrac</option>
+    <option value="weighted_unifrac">weighted_unifrac</option>
+  </param>
+  <param name="tree_path" type="data" optional="true" label="tree_path"
+   help="path to newick tree file, required for phylogenetic metrics [default: None]"/>
+  <param name="full_tree" type="boolean" truevalue="--full_tree" falsevalue="" checked="false" label="full_tree"
+   help="by default, we first compute the intersection of the tree with the otus present in the otu table. pass -f if you already have a minimal tree, and this script will run faster"/>
+ </inputs>
+ <outputs>
+  <data format="qiimedistmat" name="binary_chisq" label="${tool.name} on ${on_string}: binary_chisq.dist">
+   <filter>'binary_chisq' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="binary_chord" label="${tool.name} on ${on_string}: binary_chord.dist">
+   <filter>'binary_chord' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="binary_euclidean" label="${tool.name} on ${on_string}: binary_euclidean.dist">
+   <filter>'binary_euclidean' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="binary_hamming" label="${tool.name} on ${on_string}: binary_hamming.dist">
+   <filter>'binary_hamming' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="binary_jaccard" label="${tool.name} on ${on_string}: binary_jaccard.dist">
+   <filter>'binary_jaccard' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="binary_lennon" label="${tool.name} on ${on_string}: binary_lennon.dist">
+   <filter>'binary_lennon' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="binary_ochiai" label="${tool.name} on ${on_string}: binary_ochiai.dist">
+   <filter>'binary_ochiai' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="binary_pearson" label="${tool.name} on ${on_string}: binary_pearson.dist">
+   <filter>'binary_pearson' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="binary_sorensen_dice" label="${tool.name} on ${on_string}: binary_sorensen_dice.dist">
+   <filter>'binary_sorensen_dice' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="bray_curtis" label="${tool.name} on ${on_string}: bray_curtis.dist">
+   <filter>'bray_curtis' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="canberra" label="${tool.name} on ${on_string}: canberra.dist">
+   <filter>'canberra' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="chisq" label="${tool.name} on ${on_string}: chisq.dist">
+   <filter>'chisq' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="chord" label="${tool.name} on ${on_string}: chord.dist">
+   <filter>'chord' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="euclidean" label="${tool.name} on ${on_string}: euclidean.dist">
+   <filter>'euclidean' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="gower" label="${tool.name} on ${on_string}: gower.dist">
+   <filter>'gower' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="hellinger" label="${tool.name} on ${on_string}: hellinger.dist">
+   <filter>'hellinger' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="kulczynski" label="${tool.name} on ${on_string}: kulczynski.dist">
+   <filter>'kulczynski' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="manhattan" label="${tool.name} on ${on_string}: manhattan.dist">
+   <filter>'manhattan' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="morisita_horn" label="${tool.name} on ${on_string}: morisita_horn.dist">
+   <filter>'morisita_horn' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="pearson" label="${tool.name} on ${on_string}: pearson.dist">
+   <filter>'pearson' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="soergel" label="${tool.name} on ${on_string}: soergel.dist">
+   <filter>'soergel' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="spearman_approx" label="${tool.name} on ${on_string}: spearman_approx.dist">
+   <filter>'spearman_approx' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="specprof" label="${tool.name} on ${on_string}: specprof.dist">
+   <filter>'specprof' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="unifrac" label="${tool.name} on ${on_string}: unifrac.dist">
+   <filter>'unifrac' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="unifrac_g" label="${tool.name} on ${on_string}: unifrac_g.dist">
+   <filter>'unifrac_g' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="unifrac_g_full_tree" label="${tool.name} on ${on_string}: unifrac_g_full_tree.dist">
+   <filter>'unifrac_g_full_tree' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="unweighted_unifrac" label="${tool.name} on ${on_string}: unweighted_unifrac.dist">
+   <filter>'unweighted_unifrac' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="unweighted_unifrac_full_tree" label="${tool.name} on ${on_string}: unweighted_unifrac_full_tree.dist">
+   <filter>'unweighted_unifrac_full_tree' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="weighted_normalized_unifrac" label="${tool.name} on ${on_string}: weighted_normalized_unifrac.dist">
+   <filter>'weighted_normalized_unifrac' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+  <data format="qiimedistmat" name="weighted_unifrac" label="${tool.name} on ${on_string}: weighted_unifrac.dist">
+   <filter>'weighted_unifrac' in (metrics if isinstance(metrics,list) else [metrics])</filter>
+  </data>
+ </outputs>
+ <tests>
+ </tests>
+ <help>For more information, see beta_diversity_ in the Qiime documentation.
+ 
+Updated and validated 01/18/12 by Amanda Zuzolo, Microbiome Analysis Center, George Mason University, Fairfax, VA
+
+Qiime integration courtesy Jim Johnson, Minnesota Supercomputing Institute, University of Minnesota, Minneapolis, MN
+ 
+ .. _beta_diversity: http://qiime.org/scripts/beta_diversity.html</help>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/check_id_map.xml	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,52 @@
+<tool id="check_id_map" name="check_id_map" version="2.0.0">
+ <description>Checks user's metadata mapping file for required data, valid format</description>
+ <requirements>
+  <requirement type="binary">check_id_map.py</requirement>
+ </requirements>
+ <command interpreter="python">
+  qiime_wrapper.py
+  --galaxy_outputdir='$log.extra_files_path'
+  --galaxy_datasets='^\S+_corrected\.txt$:'$corrected_mapping,'^\S+\.log:'$log
+  check_id_map.py
+  --map=$map
+  --output_dir='$log.extra_files_path'
+  --char_replace=$char_replace
+  $not_barcoded
+  $variable_len_barcodes
+  $disable_primer_check
+  $verbose
+  #if $added_demultiplex_field != None and $added_demultiplex_field.__str__ != "":
+  --added_demultiplex_field=$added_demultiplex_field
+  #end if
+ </command>
+ <inputs>
+  <param name="map" type="data" format="tabular" label="map"
+   help="Metadata mapping file filepath [REQUIRED]"/>
+  <param name="char_replace" type="text" value="_" label="char_replace"
+   help="Changes the default character used to replace invalid characters found in the mapping file.  Must be a valid character (alphanumeric or underscore).  NOT IMPLEMENTED CURRENTLY [default: _]"/>
+  <param name="not_barcoded" type="boolean" truevalue="--not_barcoded" falsevalue="" checked="false" label="not_barcoded"
+   help="Use this option if barcodes are not present. [default: False]"/>
+  <param name="variable_len_barcodes" type="boolean" truevalue="--variable_len_barcodes" falsevalue="" checked="false" label="variable_len_barcodes"
+   help="Use this option if variable length barcodes are present to suppress warnings about barcodes of unequal length. [default: False]"/>
+  <param name="disable_primer_check" type="boolean" truevalue="--disable_primer_check" falsevalue="" checked="false" label="disable_primer_check"
+   help="Use this option to disable checks for primers. [default: False]"/>
+  <param name="verbose" type="boolean" truevalue="" falsevalue="--verbose" checked="false" label="verbose"
+   help="Turn on this flag to disable verbose output.  [default: True]"/>
+  <param name="added_demultiplex_field" type="text" value="" label="added_demultiplex_field"
+   help="Use this option to add a field to use in the mapping file as an additional demultiplexing option to the barcode. All combinations of barcodes and the values in these fields must be unique. The fields must contain values that can be parsed from the fasta labels such as 'plate==R_2008_12_09'. In this case, 'plate' would be the column header and 'R_2008_12_09' would be the field data (minus quotes) in the mapping file. To use the run prefix from the fasta label, such as '>FLP3FBN01ELBSX', where 'FLP3FBN01' is generated from the run ID, enter 'run_prefix' in the field and set the run prefix to be used as the data under the column header 'run_prefix'. [default: None]"/>
+ </inputs>
+ <outputs>
+   <data format="txt" name="log"/>
+   <data format="tabular" name="corrected_mapping" label="${tool.name} on ${on_string}: corrected_mapping"/>
+ </outputs>
+ <tests>
+ </tests>
+ <help>For more information, see check_id_map_ in the Qiime documentation.
+ 
+Updated and validated 01/19/12 by Amanda Zuzolo, Microbiome Analysis Center, George Mason University, Fairfax, VA
+
+Qiime integration courtesy Jim Johnson, Minnesota Supercomputing Institute, University of Minnesota, Minneapolis, MN
+ 
+ .. _check_id_map: http://qiime.org/scripts/check_id_map.html</help>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/collate_alpha.xml	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,38 @@
+<tool id="collate_alpha" name="collate_alpha" version="1.2.0">
+ <description>Collate alpha diversity results</description>
+ <requirements>
+  <requirement type="binary">collate_alpha.py</requirement>
+ </requirements>
+ <command interpreter="python">
+  qiime_wrapper.py
+  --galaxy_outputdir=$output1.extra_files_path
+  --galaxy_new_files_path='$__new_file_path__'
+  --galaxy_logfile=$output1
+  --galaxy_new_datasets='^\S+\.txt$:txt'
+  --galaxy_datasetid=$output1.id
+  collate_alpha.py
+  --input_path=$input_path.extra_files_path
+  --output_path='$__new_file_path__'
+ </command>
+ <inputs>
+  <param name="input_path" type="data" format="txt"  label="input_path"
+   help="Input is alpha diversity log file [REQUIRED]"/>
+  <!--<param name="example_path" type="text"  label="example_path"
+   help="example alpha_diversity analysis file, containing all samples and all metrics to be included in the collated result[Default: chosen automatically (see usage string)]"/>-->
+ </inputs>
+ <outputs>
+  <data format="txt" name="output1" label="${tool.name} on ${on_string}"/>
+ </outputs>
+ <tests>
+ </tests>
+ <help>This tool concatenates all the files generated by alpha_diversity in order to generate rarefaction curves. The input is therefore the log file generated by alpha_diversity, and the output is a log file listing all the output files, as well as the files themselves. Galaxy must be manually refreshed after running this tool to view all output files.
+ 
+For more information, see collate_alpha_ in the Qiime documentation.
+ 
+Updated and validated 01/16/12 by Amanda Zuzolo, Microbiome Analysis Center, George Mason University, Fairfax, VA
+
+Qiime integration courtesy Jim Johnson, Minnesota Supercomputing Institute, University of Minnesota, Minneapolis, MN
+
+.. _collate_alpha: http://qiime.org/scripts/collate_alpha.html</help>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/filter_alignment.xml	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,51 @@
+<tool id="filter_alignment" name="filter_alignment" version="2.0.0">
+ <description>Filter sequence alignment by removing highly variable regions</description>
+ <requirements>
+  <requirement type="binary">filter_alignment.py</requirement>
+ </requirements>
+ <command interpreter="python">
+  qiime_wrapper.py
+  ## --galaxy_tmpdir='$__new_file_path__'
+  --galaxy_outputdir='$pfiltered_fasta.extra_files_path'
+  --galaxy_datasets='^\S+_pfiltered\.\S+$:'$pfiltered_fasta
+  filter_alignment.py
+  --input_fasta_file=$input_fasta_file
+  --output_dir='$pfiltered_fasta.extra_files_path'
+  --lane_mask_fp=$lane_mask_fp
+  $suppress_lane_mask_filter
+  --allowed_gap_frac=$allowed_gap_frac
+  $remove_outliers
+  --threshold=$threshold
+  #if $entropy_threshold != 0.0:
+  --entropy_threshold=$entropy_threshold
+  #end if
+ </command>
+ <inputs>
+  <param name="input_fasta_file" type="data" format="align" label="input_fasta_file"
+   help="input FASTA file (usually output from align_seqs)  [REQUIRED]"/>
+  <param name="lane_mask_fp" type="data" format="filter" label="lane_mask_fp"
+   help="path to lanemask file (usually lanemask_in_1s_and_0s.txt)"/>
+  <param name="suppress_lane_mask_filter" type="boolean" truevalue="--suppress_lane_mask_filter" falsevalue="" checked="false" label="suppress_lane_mask_filter"
+   help="suppress lane mask filtering (necessary to turn off lane-mask-based filtering when a qiime_config default is  provided for --lane_mask_fp) [default: False]"/>
+  <param name="allowed_gap_frac" type="float" value="0.999999" label="allowed_gap_frac"
+   help="gap filter threshold, filters positions which are gaps in } allowed_gap_frac of the sequences [default: 0.999999]"/>
+  <param name="remove_outliers" type="boolean" truevalue="--remove_outliers" falsevalue="" checked="false" label="remove_outliers"
+   help="remove seqs very dissimilar to the alignment consensus (see --threshold).  [default: False]"/>
+  <param name="threshold" type="float" value="3.0" label="threshold"
+   help="with -r, remove seqs whose dissimilarity to the consensus sequence is approximately } x standard devaitions above the mean of the sequences [default: 3.0]"/>
+  <param name="entropy_threshold" type="float" value="0" label="entropy_threshold" help="Sets percent threshold for removing base positions with the highest entropy. For example, if 0.10 were specified, the top 10% most entropic base positions would be filtered. If this value is used, any lane mask supplied will be ignored. Entropy filtered occurs after gap filtering. [default: None]"/>
+ </inputs>
+ <outputs>
+  <data format="align" name="pfiltered_fasta" label="${tool.name} on ${on_string}: pfiltered.fasta"/>
+ </outputs>
+ <tests>
+ </tests>
+ <help>For more information, see filter_alignment_ in the Qiime documentation.
+  
+Updated and validated 01/16/12 by Amanda Zuzolo, Microbiome Analysis Center, George Mason University, Fairfax, VA
+
+Qiime integration courtesy Jim Johnson, Minnesota Supercomputing Institute, University of Minnesota, Minneapolis, MN
+
+.. _filter_alignment: http://qiime.org/scripts/filter_alignment.html</help>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/identify_chimeric_seqs.xml	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,73 @@
+<tool id="identify_chimeric_seqs" name="identify_chimeric_seqs" version="2.0.0">
+ <description>Identify chimeric sequences in input FASTA file</description>
+ <requirements>
+  <requirement type="binary">identify_chimeric_seqs.py</requirement>
+ </requirements>
+ <command interpreter="python">
+  qiime_wrapper.py
+  identify_chimeric_seqs.py
+  --input_fasta_fp=$input_fasta_fp
+  #if $pick.chimera_detection_method == 'ChimeraSlayer':
+    --chimera_detection_method=$pick.chimera_detection_method
+    --aligned_reference_seqs_fp=$pick.aligned_reference_seqs_fp
+    #if $pick.min_div_ratio.__str__ != '0.0':
+    --min_div_ratio=$pick.min_div_ratio
+    #end if
+  #elif $pick.chimera_detection_method == 'blast_fragments':
+    --chimera_detection_method=$pick.chimera_detection_method
+    --id_to_taxonomy_fp=$pick.id_to_taxonomy_fp
+    #if $pick.blast_db != None and $pick.blast_db.__str__ != "":
+    --blast_db=$pick.blast_db
+    #else:
+    --reference_seqs_fp=$pick.reference_seqs_fp
+    #end if
+    --num_fragments=$pick.num_fragments
+    --taxonomy_depth=$pick.taxonomy_depth
+    --max_e_value=$pick.max_e_value
+  #end if
+  --output_fp=$output_fp
+ </command>
+ <inputs>
+  <param name="input_fasta_fp" type="data" format="fasta" label="input_fasta_fp"
+   help="path to the input fasta file (usually result from pick_rep_set) [REQUIRED]"/>
+  <conditional name="pick">
+   <param name="chimera_detection_method" type="select" label="chimera_detection_method"
+    help="Chimera detection method. Choices: blast_fragments or ChimeraSlayer. [default:ChimeraSlayer]">
+     <option value="blast_fragments">blast_fragments</option>
+     <option value="ChimeraSlayer" selected="true">ChimeraSlayer</option>
+   </param>
+   <when value="ChimeraSlayer">
+    <param name="aligned_reference_seqs_fp" type="data" format="txt" label="aligned_reference_seqs_fp"
+     help="Path to (Py)Nast aligned reference sequences. [REQUIRED]"/>
+    <param name="min_div_ratio" type="float" value="0.0" label="min_div_ratio"
+     help="min divergence ratio (passed to ChimeraSlayer). If set to None uses ChimeraSlayer default value.  [default: None]"/>
+   </when>
+   <when value="blast_fragments">
+    <param name="blast_db" type="text"  label="blast_db"
+     help="Database to blast against. Must provide either blast_db or reference_seqs_fp when method is blast_fragments [default: None]"/>
+    <param name="reference_seqs_fp" type="data" format="txt" label="reference_seqs_fp"
+     help="Path to reference sequences (used to build a blast db when method blast_fragments). [default: None; REQUIRED if no blast_db is provided;]"/>
+    <param name="id_to_taxonomy_fp" type="data" format="tabular" label="id_to_taxonomy_fp"
+     help="Path to tab-delimited file mapping sequences to assigned taxonomy. Each assigned taxonomy is provided as a comma-separated list. [REQUIRED]"/>
+    <param name="taxonomy_depth" type="integer" value="4" label="taxonomy_depth"
+     help="Number of taxonomic divisions to consider when comparing taxonomy assignments [default: 4]"/>
+    <param name="num_fragments" type="integer" value="3" label="num_fragments"
+     help="Number of fragments to split sequences into (i.e., number of expected breakpoints + 1) [default: 3]"/>
+    <param name="max_e_value" type="float" value="1e-30" label="max_e_value"
+     help="Max e-value to assign taxonomy [default: 1e-30]"/>
+   </when>
+  </conditional> <!-- pick -->
+ </inputs>
+ <outputs>
+  <data format="txt" name="output_fp" label="${tool.name} on ${on_string}: chimeras"/>
+ </outputs>
+ <tests>
+ </tests>
+ <help>For more information, see identify_chimeric_seqs_ in the Qiime documentation.
+ 
+Updated and validated 01/19/12 by Amanda Zuzolo, Microbiome Analysis Center, George Mason University, Fairfax, VA
+Qiime integration courtesy Jim Johnson, Minnesota Supercomputing Institute, University of Minnesota, Minneapolis, MN
+
+.. _identify_chimeric_seqs: http://qiime.org/scripts/identify_chimeric_seqs.html</help>
+</tool>
+
Binary file qiime/lib/._galaxy has changed
Binary file qiime/lib/galaxy/._datatypes has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/lib/galaxy/datatypes/metagenomics.py	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,1121 @@
+"""
+metagenomics datatypes
+James E Johnson - University of Minnesota
+for Mothur
+"""
+
+import data
+import logging, os, sys, time, tempfile, shutil, string, glob, re
+import galaxy.model
+from galaxy.datatypes import metadata
+from galaxy.datatypes import tabular
+from galaxy.datatypes import sequence
+from galaxy.datatypes.metadata import MetadataElement
+from galaxy.datatypes.tabular import Tabular
+from galaxy.datatypes.sequence import Fasta
+from galaxy import util
+from galaxy.datatypes.images import Html
+from sniff import *
+
+log = logging.getLogger(__name__)
+
+
+## Mothur Classes 
+
+class Otu( Tabular ):
+    file_ext = 'otu'
+
+    def sniff( self, filename ):
+        """
+        Determines whether the file is a otu (operational taxonomic unit) format
+        """
+        try:
+            fh = open( filename )
+            count = 0
+            while True:
+                line = fh.readline()
+                line = line.strip()
+                if not line:
+                    break #EOF
+                if line:
+                    if line[0] != '@':
+                        linePieces = line.split('\t')
+                        if len(linePieces) < 2:
+                            return False
+                        try:
+                            check = int(linePieces[1])
+                            if check + 2 != len(linePieces):
+                                return False
+                        except ValueError:
+                            return False
+                        count += 1
+                        if count == 5:
+                            return True
+            fh.close()
+            if count < 5 and count > 0:
+                return True
+        except:
+            pass
+        finally:
+            fh.close()
+        return False
+
+class OtuList( Otu ):
+    file_ext = 'list'
+
+class Sabund( Otu ):
+    file_ext = 'sabund'
+
+    def sniff( self, filename ):
+        """
+        Determines whether the file is a otu (operational taxonomic unit) format
+        label<TAB>count[<TAB>value(1..n)]
+        
+        """
+        try:
+            fh = open( filename )
+            count = 0
+            while True:
+                line = fh.readline()
+                line = line.strip()
+                if not line:
+                    break #EOF
+                if line:
+                    if line[0] != '@':
+                        linePieces = line.split('\t')
+                        if len(linePieces) < 2:
+                            return False
+                        try:
+                            check = int(linePieces[1])
+                            if check + 2 != len(linePieces):
+                                return False
+                            for i in range( 2, len(linePieces)):
+                                ival = int(linePieces[i])
+                        except ValueError:
+                            return False
+                        count += 1
+                        if count >= 5:
+                            return True
+            fh.close()
+            if count < 5 and count > 0:
+                return True
+        except:
+            pass
+        finally:
+            fh.close()
+        return False
+
+class Rabund( Sabund ):
+    file_ext = 'rabund'
+
+class GroupAbund( Otu ):
+    file_ext = 'grpabund'
+    def init_meta( self, dataset, copy_from=None ):
+        Otu.init_meta( self, dataset, copy_from=copy_from )
+    def set_meta( self, dataset, overwrite = True, skip=1, max_data_lines = 100000, **kwd ):
+        # See if file starts with header line
+        if dataset.has_data():
+            try:
+                fh = open( dataset.file_name )
+                line = fh.readline()
+                line = line.strip()
+                linePieces = line.split('\t')
+                if linePieces[0] == 'label' and linePieces[1] == 'Group':
+                    skip=1
+                else:
+                    skip=0
+            finally:
+                fh.close()
+        Otu.set_meta( self, dataset, overwrite, skip, max_data_lines, **kwd)
+    def sniff( self, filename, vals_are_int=False):
+        """
+        Determines whether the file is a otu (operational taxonomic unit) Shared format
+        label<TAB>group<TAB>count[<TAB>value(1..n)]
+        The first line is column headings as of Mothur v 1.20
+        """
+        log.info( "sniff GroupAbund vals_are_int %s" % vals_are_int)
+        try:
+            fh = open( filename )
+            count = 0
+            while True:
+                line = fh.readline()
+                line = line.strip()
+                if not line:
+                    break #EOF
+                if line:
+                    if line[0] != '@':
+                        linePieces = line.split('\t')
+                        if len(linePieces) < 3:
+                            return False
+                        if count > 0 or linePieces[0] != 'label':
+                            try:
+                                check = int(linePieces[2])
+                                if check + 3 != len(linePieces):
+                                    return False
+                                for i in range( 3, len(linePieces)):
+                                    if vals_are_int:
+                                        ival = int(linePieces[i])
+                                    else:
+                                        fval = float(linePieces[i])
+                            except ValueError:
+                                return False
+                        count += 1
+                        if count >= 5:
+                            return True
+            fh.close()
+            if count < 5 and count > 0:
+                return True
+        except:
+            pass
+        finally:
+            fh.close()
+        return False
+
+class SharedRabund( GroupAbund ):
+    file_ext = 'shared'
+
+
+    def sniff( self, filename ):
+        """
+        Determines whether the file is a otu (operational taxonomic unit) Shared format
+        label<TAB>group<TAB>count[<TAB>value(1..n)]
+        The first line is column headings as of Mothur v 1.20
+        """
+        # return GroupAbund.sniff(self,filename,True)
+        isme = GroupAbund.sniff(self,filename,True)
+        log.info( "is SharedRabund %s" % isme)
+        return isme
+        
+
+class RelAbund( GroupAbund ):
+    file_ext = 'relabund'
+
+    def sniff( self, filename ):
+        """
+        Determines whether the file is a otu (operational taxonomic unit) Relative Abundance format
+        label<TAB>group<TAB>count[<TAB>value(1..n)]
+        The first line is column headings as of Mothur v 1.20
+        """
+        # return GroupAbund.sniff(self,filename,False)
+        isme = GroupAbund.sniff(self,filename,False)
+        log.info( "is RelAbund %s" % isme)
+        return isme
+
+class SecondaryStructureMap(Tabular):
+    file_ext = 'map'
+    def __init__(self, **kwd):
+        """Initialize secondary structure map datatype"""
+        Tabular.__init__( self, **kwd )
+        self.column_names = ['Map']
+
+    def sniff( self, filename ):
+        """
+        Determines whether the file is a secondary structure map format
+        A single column with an integer value which indicates the row that this row maps to.
+        check you make sure is structMap[10] = 380 then structMap[380] = 10.
+        """
+        try:
+            fh = open( filename )
+            line_num = 0
+            rowidxmap = {}
+            while True:
+                line = fh.readline()
+                line_num += 1
+                line = line.strip()
+                if not line:
+                    break #EOF
+                if line:
+                    try:
+                        pointer = int(line)
+                        if pointer > 0:
+                            if pointer > line_num:
+                                rowidxmap[line_num] = pointer 
+                            elif pointer < line_num & rowidxmap[pointer] != line_num:
+                                return False
+                    except ValueError:
+                        return False
+            fh.close()
+            if count < 5 and count > 0:
+                return True
+        except:
+            pass
+        finally:
+            fh.close()
+        return False
+
+class SequenceAlignment( Fasta ):
+    file_ext = 'align'
+    def __init__(self, **kwd):
+        Fasta.__init__( self, **kwd )
+        """Initialize AlignCheck datatype"""
+
+    def sniff( self, filename ):
+        """
+        Determines whether the file is in Mothur align fasta format
+        Each sequence line must be the same length
+        """
+        
+        try:
+            fh = open( filename )
+            len = -1
+            while True:
+                line = fh.readline()
+                if not line:
+                    break #EOF
+                line = line.strip()
+                if line: #first non-empty line
+                    if line.startswith( '>' ):
+                        #The next line.strip() must not be '', nor startwith '>'
+                        line = fh.readline().strip()
+                        if line == '' or line.startswith( '>' ):
+                            break
+                        if len < 0:
+                            len = len(line)
+                        elif len != len(line):
+                            return False
+                    else:
+                        break #we found a non-empty line, but its not a fasta header
+            if len > 0:
+                return True
+        except:
+            pass
+        finally:
+            fh.close()
+        return False
+
+class AlignCheck( Tabular ):
+    file_ext = 'align.check'
+    def __init__(self, **kwd):
+        """Initialize AlignCheck datatype"""
+        Tabular.__init__( self, **kwd )
+        self.column_names = ['name','pound','dash','plus','equal','loop','tilde','total']
+        self.column_types = ['str','int','int','int','int','int','int','int']
+        self.comment_lines = 1
+
+    def set_meta( self, dataset, overwrite = True, **kwd ):
+        # Tabular.set_meta( self, dataset, overwrite = overwrite, first_line_is_header = True, skip = 1 )
+        data_lines = 0
+        if dataset.has_data():
+            dataset_fh = open( dataset.file_name )
+            while True:
+                line = dataset_fh.readline()
+                if not line: break
+                data_lines += 1
+            dataset_fh.close()
+        dataset.metadata.comment_lines = 1
+        dataset.metadata.data_lines = data_lines - 1 if data_lines > 0 else 0
+        dataset.metadata.column_names = self.column_names
+        dataset.metadata.column_types = self.column_types
+
+class AlignReport(Tabular):
+    """
+QueryName	QueryLength	TemplateName	TemplateLength	SearchMethod	SearchScore	AlignmentMethod	QueryStart	QueryEnd	TemplateStart	TemplateEnd	PairwiseAlignmentLength	GapsInQuery	GapsInTemplate	LongestInsert	SimBtwnQuery&Template
+AY457915	501		82283		1525		kmer		89.07		needleman	5		501		1		499		499			2		0		0		97.6
+    """
+    file_ext = 'align.report'
+    def __init__(self, **kwd):
+        """Initialize AlignCheck datatype"""
+        Tabular.__init__( self, **kwd )
+        self.column_names = ['QueryName','QueryLength','TemplateName','TemplateLength','SearchMethod','SearchScore',
+                             'AlignmentMethod','QueryStart','QueryEnd','TemplateStart','TemplateEnd',
+                             'PairwiseAlignmentLength','GapsInQuery','GapsInTemplate','LongestInsert','SimBtwnQuery&Template'
+                             ]
+
+class BellerophonChimera( Tabular ):
+    file_ext = 'bellerophon.chimera'
+    def __init__(self, **kwd):
+        """Initialize AlignCheck datatype"""
+        Tabular.__init__( self, **kwd )
+        self.column_names = ['Name','Score','Left','Right']
+
+class SecondaryStructureMatch(Tabular):
+    """
+	name	pound	dash	plus	equal	loop	tilde	total
+	9_1_12	42	68	8	28	275	420	872
+	9_1_14	36	68	6	26	266	422	851
+	9_1_15	44	68	8	28	276	418	873
+	9_1_16	34	72	6	30	267	430	860
+	9_1_18	46	80	2	36	261	
+    """
+    def __init__(self, **kwd):
+        """Initialize SecondaryStructureMatch datatype"""
+        Tabular.__init__( self, **kwd )
+        self.column_names = ['name','pound','dash','plus','equal','loop','tilde','total']
+
+class DistanceMatrix(data.Text):
+    file_ext = 'dist'
+    """Add metadata elements"""
+    MetadataElement( name="sequence_count", default=0, desc="Number of sequences", readonly=False, optional=True, no_value=0 )
+
+
+class LowerTriangleDistanceMatrix(DistanceMatrix):
+    file_ext = 'lower.dist'
+    def __init__(self, **kwd):
+        """Initialize secondary structure map datatype"""
+        DistanceMatrix.__init__( self, **kwd )
+
+    def sniff( self, filename ):
+        """
+        Determines whether the file is a lower-triangle distance matrix (phylip) format
+        The first line has the number of sequences in the matrix.
+        The remaining lines have the sequence name followed by a list of distances from all preceeding sequences
+                5
+                U68589
+                U68590	0.3371
+                U68591	0.3609	0.3782
+                U68592	0.4155	0.3197	0.4148
+                U68593	0.2872	0.1690	0.3361	0.2842
+        """
+        try:
+            fh = open( filename )
+            count = 0
+            while True:
+                line = fh.readline()
+                line = line.strip()
+                if not line:
+                    break #EOF
+                if line:
+                    if line[0] != '@':
+                        linePieces = line.split('\t')
+                        if len(linePieces) != 3:
+                            return False
+                        try:
+                            check = float(linePieces[2])
+                        except ValueError:
+                            return False
+                        count += 1
+                        if count == 5:
+                            return True
+            fh.close()
+            if count < 5 and count > 0:
+                return True
+        except:
+            pass
+        finally:
+            fh.close()
+        return False
+
+class SquareDistanceMatrix(DistanceMatrix,Tabular):
+    file_ext = 'square.dist'
+    sequence_count = -1
+
+    def __init__(self, **kwd):
+        """Initialize secondary structure map datatype"""
+        Tabular.__init__( self, **kwd )
+    def init_meta( self, dataset, copy_from=None ):
+        data.Text.init_meta( self, dataset, copy_from=copy_from )
+    def set_meta( self, dataset, overwrite = True, skip = None, **kwd ):
+        dataset.metadata.sequences = 0 
+
+    def sniff( self, filename ):
+        """
+        Determines whether the file is a square distance matrix (Column-formatted distance matrix) format
+        The first line has the number of sequences in the matrix.
+        The following lines have the sequence name in the first column plus a column for the distance to each sequence 
+        in the row order in which they appear in the matrix.
+               3
+               U68589  0.0000  0.3371  0.3610
+               U68590  0.3371  0.0000  0.3783
+               U68590  0.3371  0.0000  0.3783
+        """
+        try:
+            fh = open( filename )
+            count = 0
+            line = fh.readline()
+            line = line.strip()
+            sequence_count = int(line)
+            col_cnt = seq_cnt + 1
+            while True:
+                line = fh.readline()
+                line = line.strip()
+                if not line:
+                    break #EOF
+                if line:
+                    if line[0] != '@':
+                        linePieces = line.split('\t')
+                        if len(linePieces) != col_cnt :
+                            return False
+                        try:
+                            for i in range(1, col_cnt):
+                                check = float(linePieces[i])
+                        except ValueError:
+                            return False
+                        count += 1
+                        if count == 5:
+                            return True
+            fh.close()
+            if count < 5 and count > 0:
+                return True
+        except:
+            pass
+        finally:
+            fh.close()
+        return False
+
+class PairwiseDistanceMatrix(DistanceMatrix,Tabular):
+    file_ext = 'pair.dist'
+    def __init__(self, **kwd):
+        """Initialize secondary structure map datatype"""
+        Tabular.__init__( self, **kwd )
+        self.column_names = ['Sequence','Sequence','Distance']
+        self.column_types = ['str','str','float']
+        self.comment_lines = 1
+
+    def sniff( self, filename ):
+        """
+        Determines whether the file is a pairwise distance matrix (Column-formatted distance matrix) format
+        The first and second columns have the sequence names and the third column is the distance between those sequences.
+        """
+        try:
+            fh = open( filename )
+            count = 0
+            while True:
+                line = fh.readline()
+                line = line.strip()
+                if not line:
+                    break #EOF
+                if line:
+                    if line[0] != '@':
+                        linePieces = line.split('\t')
+                        if len(linePieces) != 3:
+                            return False
+                        try:
+                            check = float(linePieces[2])
+                        except ValueError:
+                            return False
+                        count += 1
+                        if count == 5:
+                            return True
+            fh.close()
+            if count < 5 and count > 0:
+                return True
+        except:
+            pass
+        finally:
+            fh.close()
+        return False
+
+class AlignCheck(Tabular):
+    file_ext = 'align.check'
+    def __init__(self, **kwd):
+        """Initialize secondary structure map datatype"""
+        Tabular.__init__( self, **kwd )
+        self.column_names = ['name','pound','dash','plus','equal','loop','tilde','total']
+        self.columns = 8
+
+class Names(Tabular):
+    file_ext = 'names'
+    def __init__(self, **kwd):
+        """Name file shows the relationship between a representative sequence(col 1)  and the sequences(comma-separated) it represents(col 2)"""
+        Tabular.__init__( self, **kwd )
+        self.column_names = ['name','representatives']
+        self.columns = 2
+
+class Summary(Tabular):
+    file_ext = 'summary'
+    def __init__(self, **kwd):
+        """summarizes the quality of sequences in an unaligned or aligned fasta-formatted sequence file"""
+        Tabular.__init__( self, **kwd )
+        self.column_names = ['seqname','start','end','nbases','ambigs','polymer']
+        self.columns = 6
+
+class Group(Tabular):
+    file_ext = 'groups'
+    def __init__(self, **kwd):
+        """Name file shows the relationship between a representative sequence(col 1)  and the sequences it represents(col 2)"""
+        Tabular.__init__( self, **kwd )
+        self.column_names = ['name','group']
+        self.columns = 2
+
+class Design(Tabular):
+    file_ext = 'design'
+    def __init__(self, **kwd):
+        """Name file shows the relationship between a group(col 1) and a grouping (col 2), providing a way to merge groups."""
+        Tabular.__init__( self, **kwd )
+        self.column_names = ['group','grouping']
+        self.columns = 2
+
+class AccNos(Tabular):
+    file_ext = 'accnos'
+    def __init__(self, **kwd):
+        """A list of names"""
+        Tabular.__init__( self, **kwd )
+        self.column_names = ['name']
+        self.columns = 1
+
+class Oligos( data.Text ):
+    file_ext = 'oligos'
+
+    def sniff( self, filename ):
+        """
+        Determines whether the file is a otu (operational taxonomic unit) format
+        """
+        try:
+            fh = open( filename )
+            count = 0
+            while True:
+                line = fh.readline()
+                line = line.strip()
+                if not line:
+                    break #EOF
+                else:
+                    if line[0] != '#':
+                        linePieces = line.split('\t')
+                        if len(linePieces) == 2 and re.match('forward|reverse',linePieces[0]):
+                            count += 1
+                            continue
+                        elif len(linePieces) == 3 and re.match('barcode',linePieces[0]):
+                            count += 1
+                            continue
+                        else:
+                            return False
+                        if count > 20:
+                            return True
+            if count > 0:
+                return True
+        except:
+            pass
+        finally:
+            fh.close()
+        return False
+
+class Frequency(Tabular):
+    file_ext = 'freq'
+    def __init__(self, **kwd):
+        """A list of names"""
+        Tabular.__init__( self, **kwd )
+        self.column_names = ['position','frequency']
+        self.column_types = ['int','float']
+
+    def sniff( self, filename ):
+        """
+        Determines whether the file is a frequency tabular format for chimera analysis
+        #1.14.0
+        0	0.000
+        1	0.000
+        ...
+        155	0.975
+        """
+        try:
+            fh = open( filename )
+            count = 0
+            while True:
+                line = fh.readline()
+                line = line.strip()
+                if not line:
+                    break #EOF
+                else:
+                    if line[0] != '#':
+                        try:
+                            linePieces = line.split('\t')
+                            i = int(linePieces[0])
+                            f = float(linePieces[1])
+                            count += 1
+                            continue
+                        except:
+                            return False
+                        if count > 20:
+                            return True
+            if count > 0:
+                return True
+        except:
+            pass
+        finally:
+            fh.close()
+        return False
+
+class Quantile(Tabular):
+    file_ext = 'quan'
+    MetadataElement( name="filtered", default=False, no_value=False, optional=True , desc="Quantiles calculated using a mask", readonly=True)
+    MetadataElement( name="masked", default=False, no_value=False, optional=True , desc="Quantiles calculated using a frequency filter", readonly=True)
+    def __init__(self, **kwd):
+        """Quantiles for chimera analysis"""
+        Tabular.__init__( self, **kwd )
+        self.column_names = ['num','ten','twentyfive','fifty','seventyfive','ninetyfive','ninetynine']
+        self.column_types = ['int','float','float','float','float','float','float']
+    def set_meta( self, dataset, overwrite = True, skip = None, **kwd ):
+        log.info( "Mothur Quantile set_meta %s" % kwd)
+    def sniff( self, filename ):
+        """
+        Determines whether the file is a quantiles tabular format for chimera analysis
+        1	0	0	0	0	0	0
+        2       0.309198        0.309198        0.37161 0.37161 0.37161 0.37161
+        3       0.510982        0.563213        0.693529        0.858939        1.07442 1.20608
+        ...
+        """
+        try:
+            fh = open( filename )
+            count = 0
+            while True:
+                line = fh.readline()
+                line = line.strip()
+                if not line:
+                    break #EOF
+                else:
+                    if line[0] != '#':
+                        try:
+                            linePieces = line.split('\t')
+                            i = int(linePieces[0])
+                            f = float(linePieces[1])
+                            f = float(linePieces[2])
+                            f = float(linePieces[3])
+                            f = float(linePieces[4])
+                            f = float(linePieces[5])
+                            f = float(linePieces[6])
+                            count += 1
+                            continue
+                        except:
+                            return False
+                        if count > 10:
+                            return True
+            if count > 0:
+                return True
+        except:
+            pass
+        finally:
+            fh.close()
+        return False
+
+class FilteredQuantile(Quantile):
+    file_ext = 'filtered.quan'
+    def __init__(self, **kwd):
+        """Quantiles for chimera analysis"""
+        Quantile.__init__( self, **kwd )
+        self.filtered = True
+
+class MaskedQuantile(Quantile):
+    file_ext = 'masked.quan'
+    def __init__(self, **kwd):
+        """Quantiles for chimera analysis"""
+        Quantile.__init__( self, **kwd )
+        self.masked = True
+        self.filtered = False
+
+class FilteredMaskedQuantile(Quantile):
+    file_ext = 'filtered.masked.quan'
+    def __init__(self, **kwd):
+        """Quantiles for chimera analysis"""
+        Quantile.__init__( self, **kwd )
+        self.masked = True
+        self.filtered = True
+
+class LaneMask(data.Text):
+    file_ext = 'filter'
+
+    def sniff( self, filename ):
+        """
+        Determines whether the file is a lane mask filter:  1 line consisting of zeros and ones.
+        """
+        try:
+            fh = open( filename )
+            while True:
+                buff = fh.read(1000)
+                if not buff:
+                    break #EOF
+                else:
+                    if not re.match('^[01]+$',line):
+                        return False
+            return True
+        except:
+            pass
+        finally:
+            close(fh)
+        return False
+
+class SequenceTaxonomy(Tabular):
+    file_ext = 'seq.taxonomy'
+    """
+        A table with 2 columns:
+        - SequenceName
+        - Taxonomy (semicolon-separated taxonomy in descending order)
+        Example:
+          X56533.1        Eukaryota;Alveolata;Ciliophora;Intramacronucleata;Oligohymenophorea;Hymenostomatida;Tetrahymenina;Glaucomidae;Glaucoma;
+          X97975.1        Eukaryota;Parabasalidea;Trichomonada;Trichomonadida;unclassified_Trichomonadida;
+          AF052717.1      Eukaryota;Parabasalidea;
+    """
+    def __init__(self, **kwd):
+        Tabular.__init__( self, **kwd )
+        self.column_names = ['name','taxonomy']
+
+    def sniff( self, filename ):
+        """
+        Determines whether the file is a SequenceTaxonomy
+        """
+        try:
+            pat = '^([^ \t\n\r\f\v;]+([(]\d+[)])?[;])+$'
+            fh = open( filename )
+            count = 0
+            while True:
+                line = fh.readline()
+                if not line:
+                    break #EOF
+                line = line.strip()
+                if line:
+                    fields = line.split('\t')
+                    if len(fields) != 2:
+                        return False
+                    if not re.match(pat,fields[1]):
+                        return False
+                    count += 1
+                    if count > 10:
+                        break
+            if count > 0:
+                return True
+        except:
+            pass
+        finally:
+            fh.close()
+        return False
+
+class RDPSequenceTaxonomy(SequenceTaxonomy):
+    file_ext = 'rdp.taxonomy'
+    """
+        A table with 2 columns:
+        - SequenceName
+        - Taxonomy (semicolon-separated taxonomy in descending order, RDP requires exactly 6 levels deep)
+        Example:
+          AB001518.1      Bacteria;Bacteroidetes;Sphingobacteria;Sphingobacteriales;unclassified_Sphingobacteriales;
+          AB001724.1      Bacteria;Cyanobacteria;Cyanobacteria;Family_II;GpIIa;
+          AB001774.1      Bacteria;Chlamydiae;Chlamydiae;Chlamydiales;Chlamydiaceae;Chlamydophila;
+    """
+    def sniff( self, filename ):
+        """
+        Determines whether the file is a SequenceTaxonomy
+        """
+        try:
+            pat = '^([^ \t\n\r\f\v;]+([(]\d+[)])?[;]){6}$'
+            fh = open( filename )
+            count = 0
+            while True:
+                line = fh.readline()
+                if not line:
+                    break #EOF
+                line = line.strip()
+                if line:
+                    fields = line.split('\t')
+                    if len(fields) != 2:
+                        return False
+                    if not re.match(pat,fields[1]):
+                        return False
+                    count += 1
+                    if count > 10:
+                        break
+            if count > 0:
+                return True
+        except:
+            pass
+        finally:
+            fh.close()
+        return False
+
+class ConsensusTaxonomy(Tabular):
+    file_ext = 'cons.taxonomy'
+    def __init__(self, **kwd):
+        """A list of names"""
+        Tabular.__init__( self, **kwd )
+        self.column_names = ['OTU','count','taxonomy']
+
+class TaxonomySummary(Tabular):
+    file_ext = 'tax.summary'
+    def __init__(self, **kwd):
+        """A Summary of taxon classification"""
+        Tabular.__init__( self, **kwd )
+        self.column_names = ['taxlevel','rankID','taxon','daughterlevels','total']
+
+class Phylip(data.Text):
+    file_ext = 'phy'
+
+    def sniff( self, filename ):
+        """
+        Determines whether the file is in Phylip format (Interleaved or Sequential)
+        The first line of the input file contains the number of species and the
+        number of characters, in free format, separated by blanks (not by
+        commas). The information for each species follows, starting with a
+        ten-character species name (which can include punctuation marks and blanks),
+        and continuing with the characters for that species.
+        http://evolution.genetics.washington.edu/phylip/doc/main.html#inputfiles
+        Interleaved Example:
+            6   39
+        Archaeopt CGATGCTTAC CGCCGATGCT
+        HesperorniCGTTACTCGT TGTCGTTACT
+        BaluchitheTAATGTTAAT TGTTAATGTT
+        B. virginiTAATGTTCGT TGTTAATGTT
+        BrontosaurCAAAACCCAT CATCAAAACC
+        B.subtilisGGCAGCCAAT CACGGCAGCC
+        
+        TACCGCCGAT GCTTACCGC
+        CGTTGTCGTT ACTCGTTGT
+        AATTGTTAAT GTTAATTGT
+        CGTTGTTAAT GTTCGTTGT
+        CATCATCAAA ACCCATCAT
+        AATCACGGCA GCCAATCAC
+        """
+        try:
+            fh = open( filename )
+            # counts line
+            line = fh.readline().strip()
+            linePieces = line.split()
+            count = int(linePieces[0])
+            seq_len = int(linePieces[1])
+            # data lines
+            """
+            TODO check data lines
+            while True:
+                line = fh.readline()
+                # name is the first 10 characters
+                name = line[0:10]
+                seq = line[10:].strip()
+                # nucleic base or amino acid 1-char designators (spaces allowed)
+                bases = ''.join(seq.split())
+                # float per base (each separated by space)
+            """
+            return True
+        except:
+            pass
+        finally:
+            close(fh)
+        return False
+
+
+class Axes(Tabular):
+    file_ext = 'axes'
+
+    def __init__(self, **kwd):
+        """Initialize axes datatype"""
+        Tabular.__init__( self, **kwd )
+    def sniff( self, filename ):
+        """
+        Determines whether the file is an axes format
+        The first line may have column headings.
+        The following lines have the name in the first column plus float columns for each axis.
+		==> 98_sq_phylip_amazon.fn.unique.pca.axes <==
+		group   axis1   axis2
+		forest  0.000000        0.145743        
+		pasture 0.145743        0.000000        
+		
+		==> 98_sq_phylip_amazon.nmds.axes <==
+        		axis1   axis2   
+		U68589  0.262608        -0.077498       
+		U68590  0.027118        0.195197        
+		U68591  0.329854        0.014395        
+        """
+        try:
+            fh = open( filename )
+            count = 0
+            line = fh.readline()
+            line = line.strip()
+            col_cnt = None
+            while True:
+                line = fh.readline()
+                line = line.strip()
+                if not line:
+                    break #EOF
+                if line:
+                    fields = line.split('\t')
+                    if col_cnt == None:  # ignore values in first line as they may be column headings
+                        col_cnt = len(fields)
+                    else:  
+                        if len(fields) != col_cnt :
+                            return False
+                        try:
+                            for i in range(1, col_cnt):
+                                check = float(fields[i])
+                        except ValueError:
+                            return False
+                        count += 1
+                    if count > 10:
+                        return True
+            if count > 0:
+                return True
+        except:
+            pass
+        finally:
+            fh.close()
+        return False
+
+## Qiime Classes
+
+class QiimeMetadataMapping(Tabular):
+    MetadataElement( name="column_names", default=[], desc="Column Names", readonly=False, visible=True, no_value=[] )
+    file_ext = 'qiimemapping'
+
+    def __init__(self, **kwd):
+        """
+        http://qiime.sourceforge.net/documentation/file_formats.html#mapping-file-overview
+        Information about the samples necessary to perform the data analysis. 
+        # self.column_names = ['#SampleID','BarcodeSequence','LinkerPrimerSequence','Description']
+        """
+        Tabular.__init__( self, **kwd )
+
+    def sniff( self, filename ):
+        """
+        Determines whether the file is a qiime mapping file
+        Just checking for an appropriate header line for now, could be improved
+        """
+        try:
+            pat = '#SampleID(\t[a-zA-Z][a-zA-Z0-9_]*)*\tDescription'
+            fh = open( filename )
+            while True:
+                line = dataset_fh.readline()
+                if re.match(pat,line):
+                    return True
+        except:
+            pass
+        finally:
+            close(fh)
+        return False
+
+    def set_column_names(self, dataset):
+        if dataset.has_data():
+            dataset_fh = open( dataset.file_name )
+            line = dataset_fh.readline()
+            if line.startswith('#SampleID'):
+                dataset.metadata.column_names = line.strip().split('\t');
+            dataset_fh.close()
+
+    def set_meta( self, dataset, overwrite = True, skip = None, max_data_lines = None, **kwd ):
+        Tabular.set_meta(self, dataset, overwrite, skip, max_data_lines)
+        self.set_column_names(dataset)
+
+class QiimeOTU(Tabular):
+    """
+    Associates OTUs with sequence IDs
+    Example:
+    0	FLP3FBN01C2MYD	FLP3FBN01B2ALM
+    1	FLP3FBN01DF6NE	FLP3FBN01CKW1J	FLP3FBN01CHVM4
+    2	FLP3FBN01AXQ2Z
+    """
+    file_ext = 'qiimeotu'
+
+class QiimeOTUTable(Tabular):
+    """
+        #Full OTU Counts
+        #OTU ID	PC.354	PC.355	PC.356	Consensus Lineage
+        0	0	1	0	Root;Bacteria;Firmicutes;"Clostridia";Clostridiales
+        1	1	3	1	Root;Bacteria
+        2	0	2	2	Root;Bacteria;Bacteroidetes
+    """
+    MetadataElement( name="column_names", default=[], desc="Column Names", readonly=False, visible=True, no_value=[] )
+    file_ext = 'qiimeotutable'
+    def init_meta( self, dataset, copy_from=None ):
+        tabular.Tabular.init_meta( self, dataset, copy_from=copy_from )
+    def set_meta( self, dataset, overwrite = True, skip = None, **kwd ):
+        self.set_column_names(dataset) 
+    def set_column_names(self, dataset):
+        if dataset.has_data():
+            dataset_fh = open( dataset.file_name )
+            line = dataset_fh.readline()
+            line = dataset_fh.readline()
+            if line.startswith('#OTU ID'):
+                dataset.metadata.column_names = line.strip().split('\t');
+            dataset_fh.close()
+            dataset.metadata.comment_lines = 2
+
+class QiimeDistanceMatrix(Tabular):
+    """
+        	PC.354	PC.355	PC.356
+        PC.354	0.0	3.177	1.955	
+        PC.355	3.177	0.0	3.444
+        PC.356	1.955	3.444	0.0
+    """
+    file_ext = 'qiimedistmat'
+    def init_meta( self, dataset, copy_from=None ):
+        tabular.Tabular.init_meta( self, dataset, copy_from=copy_from )
+    def set_meta( self, dataset, overwrite = True, skip = None, **kwd ):
+        self.set_column_names(dataset) 
+    def set_column_names(self, dataset):
+        if dataset.has_data():
+            dataset_fh = open( dataset.file_name )
+            line = dataset_fh.readline()
+            # first line contains the names
+            dataset.metadata.column_names = line.strip().split('\t');
+            dataset_fh.close()
+            dataset.metadata.comment_lines = 1
+
+class QiimePCA(Tabular):
+    """
+    Principal Coordinate Analysis Data
+    The principal coordinate (PC) axes (columns) for each sample (rows). 
+    Pairs of PCs can then be graphed to view the relationships between samples. 
+    The bottom of the output file contains the eigenvalues and % variation explained for each PC.
+    Example:
+    pc vector number	1	2	3
+    PC.354	-0.309063936588	0.0398252112257	0.0744672231759
+    PC.355	-0.106593922619	0.141125998277	0.0780204374172
+    PC.356	-0.219869362955	0.00917241121781	0.0357281314115
+    
+    
+    eigvals	0.480220500471	0.163567082874	0.125594470811
+    % variation explained	51.6955484555	17.6079322939
+    """
+    file_ext = 'qiimepca'
+
+class QiimeParams(Tabular):
+    """
+###pick_otus_through_otu_table.py parameters###
+
+# OTU picker parameters
+pick_otus:otu_picking_method    uclust
+pick_otus:clustering_algorithm  furthest
+
+# Representative set picker parameters
+pick_rep_set:rep_set_picking_method     first
+pick_rep_set:sort_by    otu
+    """
+    file_ext = 'qiimeparams'
+
+class QiimePrefs(data.Text):
+    """
+    A text file, containing coloring preferences to be used by make_distance_histograms.py, make_2d_plots.py and make_3d_plots.py.
+    Example:
+{
+'background_color':'black',
+
+'sample_coloring':
+        {
+                'Treatment':
+                {
+                        'column':'Treatment',
+                        'colors':(('red',(0,100,100)),('blue',(240,100,100)))
+                },
+                'DOB':
+                {
+                        'column':'DOB',
+                        'colors':(('red',(0,100,100)),('blue',(240,100,100)))
+                }
+        },
+'MONTE_CARLO_GROUP_DISTANCES':
+        {
+                'Treatment': 10,
+                'DOB': 10
+        }
+}
+    """
+    file_ext = 'qiimeprefs'
+
+class QiimeTaxaSummary(Tabular):
+    """
+        Taxon	PC.354	PC.355	PC.356
+        Root;Bacteria;Actinobacteria	0.0	0.177	0.955	
+        Root;Bacteria;Firmicutes	0.177	0.0	0.444
+        Root;Bacteria;Proteobacteria	0.955	0.444	0.0
+    """
+    MetadataElement( name="column_names", default=[], desc="Column Names", readonly=False, visible=True, no_value=[] )
+    file_ext = 'qiimetaxsummary'
+
+    def set_column_names(self, dataset):
+        if dataset.has_data():
+            dataset_fh = open( dataset.file_name )
+            line = dataset_fh.readline()
+            if line.startswith('Taxon'):
+                dataset.metadata.column_names = line.strip().split('\t');
+            dataset_fh.close()
+
+    def set_meta( self, dataset, overwrite = True, skip = None, max_data_lines = None, **kwd ):
+        Tabular.set_meta(self, dataset, overwrite, skip, max_data_lines)
+        self.set_column_names(dataset)
+
+if __name__ == '__main__':
+    import doctest, sys
+    doctest.testmod(sys.modules[__name__])
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/make_2d_plots.xml	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,66 @@
+<tool id="make_2d_plots" name="make_2d_plots" version="2.0.0">
+ <description>Make 2D PCoA Plots</description>
+ <requirements>
+  <requirement type="binary">make_2d_plots.py</requirement>
+ </requirements>
+ <command interpreter="python">
+  qiime_wrapper.py
+  --galaxy_outputdir=$plot.extra_files_path
+  ##--galaxy_tmpdir='$__new_file_path__'
+  ##--galaxy_datasets='^\S+_2D_PCoA_plots\.html$:'$plot
+  --galaxy_datasets='^\S+\.html$:'$plot
+  ##--galaxy_datasetid=$output1.id
+  ##--galaxy_new_files_path='$__new_file_path__'
+  ##--galaxy_tmpdir='$__new_file_path__'
+  make_2d_plots.py
+  --coord_fname=$coord_fname
+  --map_fname=$map_fname
+  #if $colorby != None and $colorby.__str__ != 'None':
+  --colorby=$colorby
+  #end if
+  #if $prefs_path != None and $prefs_path.__str__ != 'None' and len($prefs_path.__str__) > 0:
+  --prefs_path=$prefs_path
+  #end if
+  --background_color=$background_color
+  --ellipsoid_opacity=$ellipsoid_opacity
+  --ellipsoid_method=$ellipsoid_method
+  #if $master_pcoa != None and $master_pcoa.__str__ != 'None' and len($master_pcoa.__str__) > 0:
+  --master_pcoa=$master_pcoa
+  #end if
+  --output_dir=$plot.extra_files_path
+ </command>
+ <inputs>
+  <param name="coord_fname" type="data" format="qiimepca" label="coord_fname"
+   help="This is the path to the principal coordinates file (i.e., resulting file from principal_coordinates.py).  Alternatively, the user can supply a directory containing multiple principal coordinates files. [REQUIRED]"/>
+  <param name="map_fname" type="data" format="tabular" label="map_fname"
+   help="This is the metadata mapping file [REQUIRED]"/>
+  <param name="colorby" type="text"  label="colorby"
+   help="This is the categories to color by in the plots from the user-generated mapping file. The categories must match the name of a column header in the mapping file exactly and multiple categories can be list by comma separating them without spaces. The user can also combine columns in the mapping file by separating the categories by '&#38;&#38;' without spaces [default=color by all; leave blank]"/>
+  <param name="prefs_path" type="data" format="txt" optional="true" label="prefs_path"
+   help="This is the user-generated preferences file. NOTE: This is a file with a dictionary containing preferences for the analysis [OPTIONAL]"/>
+  <param name="background_color" type="text"  label="background_color"
+   help="This is the background color to use in the plots. [default: white]" value="white"/>
+  <param name="ellipsoid_opacity" type="float" value="0.33" label="ellipsoid_opacity"
+   help="Used when plotting ellipsoids for jackknifed beta diversity (i.e. using a directory of coord files instead of a single coordfile). Valid range is 0-1. A value of 0 produces completely transparent (invisible) ellipsoids. A value of 1 produces completely opaque ellipsoids. [default=0.33]"/>
+  <param name="ellipsoid_method" type="select" value="IQR" label="ellipsoid_method"
+   help="Used when plotting ellipsoids for jackknifed beta diversity (i.e. using a directory of coord files instead of a single coord file). Choose between 'IQR' (The Interquartile Range) and 'sdev' (The standard deviation). [default=IQR]">
+    <option value="IQR" selected="true">IQR</option>
+    <option value="sdev">sdev</option>
+   </param>
+  <param name="master_pcoa" type="text"  label="master_pcoa"
+   help="Used only when plotting ellipsoids for jackknifed beta diversity (i.e. using a directory of coord files instead of a single coord file). These coordinates will be the center of each ellipisoid. [default: None; arbitrarily chosen PC matrix will define the center point]"/>
+ </inputs>
+ <outputs>
+ <data format="html" name="plot" label="${tool.name} on ${on_string}"/>
+ </outputs>
+ <tests>
+ </tests>
+ <help>For more information, see make_2d_plots_ in the Qiime documentation.
+ 
+Updated and validated 01/18/12 by Amanda Zuzolo, Microbiome Analysis Center, George Mason University, Fairfax, VA
+
+Qiime integration courtesy Jim Johnson, Minnesota Supercomputing Institute, University of Minnesota, Minneapolis, MN
+ 
+ .. _make_2d_plots: http://qiime.org/scripts/make_2d_plots.html</help>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/make_distance_histograms.xml	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,56 @@
+<tool id="make_distance_histograms" name="make_distance_histograms" version="2.0.0">
+ <description>Make distance histograms</description>
+ <requirements>
+  <requirement type="binary">make_distance_histograms.py</requirement>
+ </requirements>
+ <command interpreter="python">
+  qiime_wrapper.py
+  --galaxy_outputdir=$plot.extra_files_path
+  --galaxy_datasets='^\S+\.html$:'$plot
+  make_distance_histograms.py
+  --distance_matrix_file=$distance_matrix_file
+  --map_fname=$map_fname
+  #if $prefs_path != None and $prefs_path.__str__ != 'None' and len($prefs_path.__str__) > 0:
+  --prefs_path=$prefs_path
+  #end if
+  --dir_path=$plot.extra_files_path
+  --background_color=$background_color
+  $monte_carlo
+  #if $fields != None and $fields.__str__ != ' ' and $fields.__str__ !='':
+  --fields=$fields
+  #end if
+  --monte_carlo_iters=$monte_carlo_iters
+ </command>
+ <inputs>
+  <param name="distance_matrix_file" type="data" format="qiimedistmat" label="distance_matrix_file"
+   help="Path to distance matrix file (IE, the output from beta diversity). [REQUIRED]"/>
+  <param name="map_fname" type="data" format="tabular" label="map_fname"
+   help="This is the metadata mapping file [REQUIRED]"/>
+  <param name="prefs_path" type="data" format="txt"  optional="true" label="prefs_path"
+   help="This is the user-generated preferences file. NOTE: This is a file with a dictionary containing preferences for the analysis.  This dict must have a 'Fields' key mapping to a list of desired fields. [default: ('NO', 'DEFAULT')]"/>
+  <param name="background_color" type="select" label="background_color"
+   help="This is the background color to use in the plots [default: white]">
+    <option value="white" selected="true">White</option>
+    <option value="black">Black</option>
+    </param>
+  <param name="monte_carlo" type="boolean" truevalue="--monte_carlo" falsevalue="" checked="false" label="monte_carlo"
+   help="Perform Monte Carlo analysis on distances.  [Default: False]"/>
+  <param name="fields" type="text"  label="fields"
+   help="Comma delimited list of fields to compare. Put list of fields in quotes. This overwrites fields in prefs file. If this is not provided, the first field in metadata mapping file will be used.  Usage: 'Field1,Field2,Field3'"/>
+  <param name="monte_carlo_iters" type="integer" value="0" label="monte_carlo_iters"
+   help="Number of iterations to perform for Monte Carlo analysis. [default: 0/no monte carlo simulation performed]"/>
+ </inputs>
+ <outputs>
+ <data format="html" name="plot" label="${tool.name} on ${on_string}"/>
+ </outputs>
+ <tests>
+ </tests>
+ <help>For more information, see make_distance_histograms_ in the Qiime documentation.
+ 
+Updated and validated 01/18/12 by Amanda Zuzolo, Microbiome Analysis Center, George Mason University, Fairfax, VA
+
+Qiime integration courtesy Jim Johnson, Minnesota Supercomputing Institute, University of Minnesota, Minneapolis, MN
+ 
+ .. _make_distance_histograms: http://qiime.org/scripts/make_distance_histograms.html</help>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/make_otu_heatmap_html.xml	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,60 @@
+<tool id="make_otu_heatmap_html" name="make_otu_heatmap_html" version="1.2.1">
+ <description>Make heatmap of OTU table</description>
+ <requirements>
+  <requirement type="binary">make_otu_heatmap_html.py</requirement>
+ </requirements>
+ <command interpreter="python">
+  qiime_wrapper.py
+  --galaxy_outputdir='$otu_heatmp.extra_files_path'
+  --galaxy_datasets='^\S+\.html$:'$otu_heatmp
+  make_otu_heatmap_html.py
+  --otu_table_fp=$otu_table_fp
+  --output_dir='$otu_heatmp.extra_files_path'
+  --num_otu_hits=$num_otu_hits
+  #if $tree != None and $tree.__str__ != 'None':
+   --tree=$tree
+  #end if
+  #if $map_fname != None and $map_fname.__str__ != 'None' > 0:
+   --map_fname=$map_fname
+  #end if
+  #if $sample_tree != None and $sample_tree.__str__ != 'None':
+   --sample_tree=$sample_tree
+  #end if
+  $log_transform
+  --log_eps=$log_eps
+ </command>
+ <inputs>
+  <param name="otu_table_fp" type="data" format="txt" label="otu_table_fp"
+   help="path to the input OTU table (i.e., the output from make_otu_table.py) [REQUIRED]"/>
+  <param name="num_otu_hits" type="integer" value="5" label="num_otu_hits"
+   help="This is the minimum number of Samples that an OTU is present in, for an OTU to be kept in the OTU table [default: 5]"/>
+  <param name="tree" type="data" format="tre"  optional="true" label="tree"
+   help="Tree file to be used for sorting OTUs in the heatmap"/>
+  <param name="map_fname" type="data" format="qiimemapping" optional="true" label="map_fname"
+   help="Metadata mapping file to be used for sorting Samples in the heatmap"/>
+  <param name="sample_tree" type="data" format="tre"  optional="true" label="sample_tree"
+   help="Tree file to be used for sorting samples (e.g, output from upgma_cluster.py). If both this and the sample mapping file are provided, the mapping file is ignored."/>
+  <param name="log_transform" type="boolean" truevalue="--log_transform" falsevalue="" checked="false" label="log_transform"
+   help="Data will be log-transformed. All zeros will be set to a small value (default is 1/2 the smallest non-zero entry). Data will be translated to be non-negative after log transform, and num_otu_hits will be set to 0."/>
+  <param name="log_eps" type="float" value="0.0" label="log_eps"
+   help="Small value to replace zeros for log transform. [default: 1/2 the smallest non-zero entry]."/>
+ </inputs>
+ <outputs>
+    <!-- TODO 
+     the html output has a js sub dir:
+       move the js/* to the html .extra_files_path/
+       filter the html to remove 'js/' sub dir
+     -->
+   <data name="otu_heatmp" format="html" label="${tool.name} on ${on_string}: otu_heatmp"/>
+ </outputs>
+ <tests>
+ </tests>
+ <help>For more information, see make_otu_heatmap_html_ in the Qiime documentation.
+ 
+Updated and validated 02/10/12 by Amanda Zuzolo, Microbiome Analysis Center, George Mason University, Fairfax, VA
+
+Qiime integration courtesy Jim Johnson, Minnesota Supercomputing Institute, University of Minnesota, Minneapolis, MN
+ 
+.. _make_otu_heatmap_html: http://qiime.org/scripts/make_otu_heatmap_html.html</help>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/make_otu_table.xml	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,39 @@
+<tool id="make_otu_table" name="make_otu_table" version="2.0.0">
+ <description>Make OTU table</description>
+ <requirements>
+  <requirement type="binary">make_otu_table.py</requirement>
+ </requirements>
+ <command interpreter="python">
+  qiime_wrapper.py
+  make_otu_table.py
+  --otu_map_fp=$otu_map_fp
+  --output_fp=$output_fp
+  #if $taxonomy.__str__ != 'None': 
+  --taxonomy=$taxonomy 
+  #end if
+  #if $exclude_otus_fp.__str__ != 'None':
+  --exclude_otus_fp=$exclude_otus_fp
+  #end if
+ </command>
+ <inputs>
+  <param name="otu_map_fp" type="data" format="qiimeotu" label="otu_map_fp"
+   help="path to the input OTU map (i.e., the output from pick_otus.py) [REQUIRED]"/>
+  <param name="taxonomy" type="data" format="seq.taxonomy"  optional="true" label="taxonomy"
+   help="Path to taxonomy assignment, containing the assignments of taxons to sequences (i.e., resulting txt file from assign_taxonomy.py)  [OPTIONAL]"/>
+  <param name="exclude_otus_fp" type="data" format="txt" optional="true" label="exclude_otus_fp"
+   help="a filepath listing OTU identifiers that should not be included in the OTU table (e.g., the output of identify_chimeric_seqs.py) or a fasta file where seq ids should be excluded (e.g., failures fasta file from align_seqs.py) [OPTIONAL]"/>
+ </inputs>
+ <outputs>
+  <data format="qiimeotutable" name="output_fp" label="${tool.name} on ${on_string}: otu_table"/>
+ </outputs>
+ <tests>
+ </tests>
+ <help>For more information, see make_otu_table_ in the Qiime documentation.
+ 
+Updated and validated 01/16/12 by Amanda Zuzolo, Microbiome Analysis Center, George Mason University, Fairfax, VA
+
+Qiime integration courtesy Jim Johnson, Minnesota Supercomputing Institute, University of Minnesota, Minneapolis, MN
+ 
+.. _make_otu_table: http://qiime.org/scripts/make_otu_table</help>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/make_phylogeny.xml	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,49 @@
+<tool id="make_phylogeny" name="make_phylogeny" version="2.0.0">
+ <description>Make Phylogeny</description>
+ <requirements>
+  <requirement type="binary">make_phylogeny.py</requirement>
+ </requirements>
+ <command interpreter="python">
+ qiime_wrapper.py
+ --galaxy_inputdir='$__new_file_path__'
+ --galaxy_ext_change='$input_fp'
+ --galaxy_new_ext='fasta'
+ make_phylogeny.py
+ --input_fp='$__new_file_path__'/temporary.fasta
+ --tree_method=$tree_method
+ --result_fp=$result_fp
+ --log_fp=$log_fp
+ --root_method=$root_method</command>
+ <inputs>
+  <param name="input_fp" type="data" format="align" label="input_fp"
+   help="Path to read input alignment (output from filter_alignment) [REQUIRED]"/>
+  <param name="tree_method" type="select" label="tree_method"
+   help="Method for tree building. [default: fasttree]">
+    <option value="clearcut">clearcut</option>
+    <option value="clustalw">clustalw</option>
+    <option value="raxml">raxml</option>
+    <option value="fasttree_v1">fasttree_v1</option>
+    <option value="fasttree" selected="true">fasttree</option>
+    <option value="muscle">muscle</option>
+  </param>
+  <param name="root_method" type="select" label="root_method"
+   help="method for choosing root of phylo tree [default: tree_method_default]">
+    <option value="tree_method_default" selected="true">tree_method_default</option>
+    <option value="midpoint">midpoint</option>
+  </param>
+ </inputs>
+ <outputs>
+  <data format="tre" name="result_fp" label="${tool.name} on ${on_string}: tree" />
+  <data format="txt" name="log_fp" label="${tool.name} on ${on_string}: log" />
+ </outputs>
+ <tests>
+ </tests>
+ <help>For more information, see make_phylogeny_ in the Qiime documentation.
+
+Updated and validated 01/16/12 by Amanda Zuzolo, Microbiome Analysis Center, George Mason University, Fairfax, VA
+
+Qiime integration courtesy Jim Johnson, Minnesota Supercomputing Institute, University of Minnesota, Minneapolis, MN
+
+.. _make_phylogeny: http://qiime.org/scripts/make_phylogeny.html</help>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/make_prefs_file.xml	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,54 @@
+<tool id="make_prefs_file" name="make_prefs_file" version="2.0.0">
+ <description>Generate preferences file</description>
+ <requirements>
+  <requirement type="binary">make_prefs_file.py</requirement>
+ </requirements>
+ <command interpreter="python">
+  qiime_wrapper.py
+  make_prefs_file.py
+  --map_fname=$map_fname
+  --output_fp=$output_fp
+  #if $mapping_headers_to_use != None and $mapping_headers_to_use.__str__ != '':
+  --mapping_headers_to_use=$mapping_headers_to_use
+  #end if
+  --background_color=$background_color
+  --monte_carlo_dists=$monte_carlo_dists
+  #if $input_taxa_file != None and $input_taxa_file.__str__ != '' and $input_taxa_file.__str__ != 'None':
+  --input_taxa_file=$input_taxa_file
+  #end if
+  --ball_scale=$ball_scale
+  --arrow_line_color=$arrow_line_color
+  --arrow_head_color=$arrow_head_color
+ </command>
+ <inputs>
+  <param name="map_fname" type="data" format="tabular" label="map_fname"
+   help="This is the metadata mapping file [REQUIRED]"/>
+  <param name="mapping_headers_to_use" type="text" label="mapping_headers_to_use"
+   help="mapping fields to use in prefs file [default: leave empty; ALL]"/>
+  <param name="background_color" type="text" value="black" label="background_color"
+   help="This is the background color to  use in the plots. [default: black]"/>
+  <param name="monte_carlo_dists" type="text" value="10" label="monte_carlo_dists"
+   help="monte carlo distanceto use for each sample header [default: 10]"/>
+  <param name="input_taxa_file" type="data" format="txt" optional="true" label="input_taxa_file"
+   help="summarized taxa file with samplecounts by taxonomy (resulting file from summarize_taxa.py)"/>
+  <param name="ball_scale" type="float" value="1.0" label="ball_scale"
+   help="scale factor for the size of each ball in the plots [default: 1.0]"/>
+  <param name="arrow_line_color" type="text" value="white" label="arrow_line_color"
+   help="arrow line color forprocrustes analysis. [default: white]"/>
+  <param name="arrow_head_color" type="text" value="red" label="arrow_head_color"
+   help="arrow head color forprocrustes analysis. [default: red]"/>
+ </inputs>
+ <outputs>
+  <data format="txt" name="output_fp"/>
+ </outputs>
+ <tests>
+ </tests>
+ <help>For more information, see make_prefs_file_ in the Qiime documentation.
+ 
+Updated and validated 01/18/12 by Amanda Zuzolo, Microbiome Analysis Center, George Mason University, Fairfax, VA
+
+Qiime integration courtesy Jim Johnson, Minnesota Supercomputing Institute, University of Minnesota, Minneapolis, MN
+ 
+ .. _make_prefs_file: http://qiime.org/scripts/make_prefs_file.html</help>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/make_rarefaction_plots.xml	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,62 @@
+<tool id="make_rarefaction_plots" name="make_rarefaction_plots" version="1.2.0">
+ <description>Generate Rarefaction Plots</description>
+ <requirements>
+  <requirement type="binary">make_rarefaction_plots.py</requirement>
+ </requirements>
+ <command interpreter="python">
+  qiime_wrapper.py
+  --galaxy_datasets='^\S+\.html$:'$plot
+  --galaxy_outputdir=$plot.extra_files_path
+  make_rarefaction_plots.py
+  --input_dir=$input_dir.extra_files_path
+  --map_fname=$map_fname
+  #if $colorby != None and $colorby.__str__ != 'None' and len($colorby.__str__) > 0:
+  --colorby=$colorby
+  #end if
+  #if $prefs_path != None and $prefs_path.__str__ != 'None':
+  --prefs_path=$prefs_path
+  #end if
+  #if $ymax != None and $ymax.__str__ != '':
+  --ymax=$ymax
+  #end if
+  --background_color=$background_color
+  --imagetype=$imagetype
+  --resolution=$resolution
+  --output_dir=$plot.extra_files_path
+ </command>
+ <inputs>
+  <param name="input_dir" type="data" format="txt" label="input_dir" help="Rarefaction file (I.E. log output from collate_alpha). [REQUIRED]"/>
+  <param name="map_fname" type="data" format="tabular" label="map_fname" help="Name of mapping file [REQUIRED]"/>
+  <param name="colorby" type="text"  label="colorby" help="Name of columns to make rarefaction graphs of, comma delimited, no spaces. [OPTIONAL]"/>
+  <param name="prefs_path" type="data" format="txt" optional="true" label="prefs_path" help="Preferences file for coloring of columns. [OPTIONAL]"/>
+  <param name="background_color" type="select" value="white" label="background_color" help="Background color for graphs. [default: white]">
+   <option value="white" selected="true">White</option>
+   <option value="black">Black</option>
+  </param>
+  <param name="imagetype" type="select" label="Image Type"
+   help="Type of image to produce (i.e. pdf,svg,png). [default: png]">
+    <option value="pdf">pdf</option>
+    <option value="svg">svg</option>
+    <option value="png" selected="true">png</option>
+  </param>
+  <param name="resolution" type="integer" value="75" label="resolution"
+   help="output image resolution, [default: 75]"/>
+  <param name="ymax" type="text" label="ymax"
+   help="this is the ymax value to be used for the plots, so you can compare rarefaction plots between two different analyses [default: none]"/>
+ </inputs>
+ <outputs>
+  <data format="html" name="plot" label="${tool.name} on ${on_string}"/>
+ </outputs>
+ <tests>
+ </tests>
+ <help>This tool takes the log file output from collate_alpha to create an html file of rarefaction plots wherein you can plot by sample and/or by category.
+ 
+For more information, see make_rarefaction_plots_ in the Qiime documentation.
+ 
+Updated and validated 01/16/12 by Amanda Zuzolo, Microbiome Analysis Center, George Mason University, Fairfax, VA
+
+Qiime integration courtesy Jim Johnson, Minnesota Supercomputing Institute, University of Minnesota, Minneapolis, MN
+
+.. _make_rarefaction_plots: http://qiime.org/scripts/make_rarefaction_plots.html</help>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/multiple_rarefactions.xml	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,51 @@
+<tool id="multiple_rarefactions" name="multiple_rarefactions" version="1.2.0">
+ <description>Perform multiple subsamplings/rarefactions on an otu table</description>
+ <requirements>
+  <requirement type="binary">multiple_rarefactions.py</requirement>
+ </requirements>
+ <command interpreter="python">
+  qiime_wrapper.py
+  --galaxy_logfile=$output1
+  --galaxy_outputdir=$output1.extra_files_path
+  multiple_rarefactions.py
+  --input_path=$input_path
+  --output_path=$output1.extra_files_path
+  --min=$min
+  --max=$max
+  --step=$step
+  --num-reps=$num_reps
+  $lineages_included
+  $keep_empty_otus
+ </command>
+ <inputs>
+  <param name="input_path" type="data"  label="input_path"
+   help="Input otu table filepath [REQUIRED]"/>
+  <param name="min" type="integer" value="100" label="min"
+   help="Min seqs/sample [REQUIRED]"/>
+  <param name="max" type="integer" value="400" label="max"
+   help="Max seqs/sample (inclusive) [REQUIRED]"/>
+  <param name="step" type="integer" value="100" label="step"
+   help="Size of each steps between the min/max of seqs/sample (e.g. min, min+step... for every level less than or equal to max). [REQUIRED]"/>
+  <param name="num_reps" type="integer" value="10" label="num-reps"
+   help="Number of iterations at each seqs/sample level [default: 10]"/>
+  <param name="lineages_included" type="boolean" truevalue="--lineages_included" falsevalue="" checked="false" label="lineages_included"
+   help="Output rarefied otu tables will include taxonomic (lineage) information for each otu, if present in input otu table [default: False]"/>
+  <param name="keep_empty_otus" type="boolean" truevalue="--keep_empty_otus" falsevalue="" checked="false" label="keep_empty_otus"
+   help="otus (rows) of all zeros are usually omitted from the output otu tables, with -k they will not be removed from the output files [default: False]"/>
+ </inputs>
+ <outputs>
+  <data format="txt" name="output1" label="${tool.name} on ${on_string}: Rarefied tables from $min to $max, with a step of $step"/>
+ </outputs>
+ <tests>
+ </tests>
+ <help>This tool rarefies OTU tables for use in jackknife, bootstrap, and rarefaction analyses. Samples with fewer sequences than the rarefaction depth requested for a given output otu table are omitted from those otu tables. The input is an OTU table (e.g., the output from make_otu_table). The output file is a log file listing all the rarefied otu tables produced.
+ 
+For more information, see multiple_rarefactions_ in the Qiime documentation.
+ 
+Updated and validated 01/16/12 by Amanda Zuzolo, Microbiome Analysis Center, George Mason University, Fairfax, VA
+
+Qiime integration courtesy Jim Johnson, Minnesota Supercomputing Institute, University of Minnesota, Minneapolis, MN
+
+.. _multiple_rarefactions: http://qiime.org/scripts/multiple_rarefactions.html</help>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/per_library_stats.xml	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,35 @@
+<tool id="per_library_stats" name="per_library_stats" version="2.0.0">
+ <description>Calculate per library statistics</description>
+ <requirements>
+  <requirement type="binary">per_library_stats.py</requirement>
+ </requirements>
+ <command interpreter="python">
+  qiime_wrapper.py
+  per_library_stats.py
+  --otu_table_fp=$otu_table_fp
+  #if $mapfile != None and $mapfile.__str__ != 'None' and $mapfile.__str__ != '':
+  --mapfile=$mapfile
+  #end if
+  --outputfile=$outputfile
+ </command>
+ <inputs>
+  <param name="otu_table_fp" type="data" format="txt" label="otu_table_fp"
+   help="path to the input OTU table (i.e., the output from make_otu_table.py) [REQUIRED]"/>
+  <param name="mapfile" type="data" optional="true" format="txt" label="mapfile" help="A mapping file. If included, this script will modify the mapping file to include sequences per sample (library) information, and write the modified mapping file to the output file. [OPTIONAL]"/>
+ </inputs>
+ <outputs>
+  <data format="txt" name="outputfile" label="${tool.name} on ${on_string}"/>
+ </outputs>
+ <tests>
+ </tests>
+ <help>.. class:: warningmark Warning: log data from standard output currently not available.
+ 
+For more information, see per_library_stats_ in the Qiime documentation.
+ 
+Updated and validated 01/18/12 by Amanda Zuzolo, Microbiome Analysis Center, George Mason University, Fairfax, VA
+
+Qiime integration courtesy Jim Johnson, Minnesota Supercomputing Institute, University of Minnesota, Minneapolis, MN 
+
+ .. _per_library_stats: http://qiime.org/scripts/per_library_stats.html</help>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/pick_otus.xml	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,171 @@
+<tool id="pick_otus" name="pick_otus" version="2.0.0">
+ <description>OTU picking</description>
+ <requirements>
+  <requirement type="binary">pick_otus.py</requirement>
+ </requirements>
+ <command interpreter="python">
+  qiime_wrapper.py
+  --galaxy_outputdir='$log.extra_files_path'
+  #if $pick.otu_picking_method == 'uclust' and $pick.refseqs_fp.__str__ != 'None':
+    --galaxy_datasets='^\S+_otus\.txt$:'$otus,'^\S+_otus\.log$:'$log,'^\S+_failures\.txt$:'$failures
+  #else:
+    --galaxy_datasets='^\S+_otus\.txt$:'$otus,'^\S+_otus\.log$:'$log
+  #end if
+  pick_otus.py
+  --input_seqs_filepath=$input_seqs_filepath
+  #if $pick.otu_picking_method.__str__ == 'uclust':
+    #if $pick.refseqs_fp.__str__ != 'None':
+      --refseqs_fp=$pick.refseqs_fp
+      --otu_picking_method='uclust_ref'
+      $pick.suppress_new_clusters
+    #else:
+      --otu_picking_method=$pick.otu_picking_method
+    #end if
+    --similarity=$pick.similarity
+    $pick.enable_rev_strand_match
+    $pick.optimal_uclust
+    $pick.exact_uclust
+    $pick.user_sort
+    $pick.suppress_presort_by_abundance_uclust
+    --max_accepts=$pick.max_accepts
+    --max_rejects=$pick.max_rejects
+    #if $pick.uclust_otu_id_prefix != None and $pick.uclust_otu_id_prefix.__str__ != 'None' and $pick.uclust_otu_id_prefix.__str__ != '':
+    --uclust_otu_id_prefix=$pick.uclust_otu_id_prefix
+    #end if
+    $pick.uclust_stable_sort
+    $pick.save_uc_files
+  #elif $pick.otu_picking_method.__str__ == 'mothur':
+    --otu_picking_method=$pick.otu_picking_method
+    --clustering_algorithm=$pick.clustering_algorithm
+    --similarity=$pick.similarity
+  #elif $pick.otu_picking_method.__str__ == 'trie':
+    --otu_picking_method=$pick.otu_picking_method
+    $pick.trie_reverse_seqs
+  #elif $pick.otu_picking_method.__str__ == 'prefix_suffix':
+    --otu_picking_method=$pick.otu_picking_method
+    --prefix_length=$pick.prefix_length
+    --suffix_length=$pick.suffix_length
+  #elif pick.otu_picking_method.__str__ == 'blast':
+    --otu_picking_method=$pick.otu_picking_method
+    #if $refseqs_fp.__str__ != 'None':
+      --refseqs_fp=$pick.refseqs_fp
+    #end if
+    #if $pick.blast_db != None and $pick.blast_db.__str__ != 'None' and $pick.blast_db.__str__ != '':
+    --blast_db=$pick.blast_db
+    #end if
+    --similarity=$pick.similarity
+    --max_e_value=$pick.max_e_value
+    --min_aligned_percent=$pick.min_aligned_percent
+  #elif $pick.otu_picking_method == 'cdhit':
+    --otu_picking_method=$pick.otu_picking_method
+    --similarity=$pick.similarity
+    --max_cdhit_memory=$pick.max_cdhit_memory
+    #if $pick.prefix_prefilter_length != 0:
+    --prefix_prefilter_length=$pick.prefix_prefilter_length
+    #end if
+    $pick.trie_prefilter
+  #end if
+  --output_dir='$log.extra_files_path'
+ </command>
+ <inputs>
+  <param name="input_seqs_filepath" type="data"  format="fasta" label="input_seqs_filepath"
+   help="Input sequences [REQUIRED]"/>
+  <conditional name="pick">
+  <param name="otu_picking_method" type="select" label="otu_picking_method"
+   help="Method for picking OTUs.  Valid choices are: mothur, trie, uclust_ref, prefix_suffix, blast, cdhit, uclust. The mothur method requires an input file of aligned sequences [default: uclust]">
+    <option value="uclust" selected="true">uclust</option>
+    <option value="mothur">mothur</option>
+    <option value="trie">trie</option>
+    <option value="prefix_suffix">prefix_suffix</option>
+    <option value="blast">blast</option>
+    <option value="cdhit">cdhit</option>
+  </param>
+  <when value="mothur">
+    <param name="clustering_algorithm" type="select" label="clustering_algorithm"
+     help="Clustering algorithm for mothur otu picking method. [default: furthest]">
+      <option value="furthest" selected="true">furthest</option>
+      <option value="nearest">nearest</option>
+      <option value="average">average</option>
+    </param>
+    <param name="similarity" type="float" value="0.97" label="similarity"
+     help="Sequence similarity threshold (for cdhit, uclust, or uclust_ref) [default: 0.97]"/>
+  </when> <!-- mothur -->
+  <when value="trie">
+    <param name="trie_reverse_seqs" type="boolean" truevalue="--trie_reverse_seqs" falsevalue="" checked="false" label="trie_reverse_seqs"
+     help="Reverse seqs before picking OTUs with the Trie OTU picker for suffix (rather than prefix) collapsing [default: False]"/>
+  </when> <!-- trie -->
+  <when value="uclust">
+    <param name="refseqs_fp" type="data" format="fasta" label="refseqs_fp" optional="true"
+     help="Reference sequences to search against when using blast, uclust_ref, or usearch_ref [OPTIONAL]"/>
+    <param name="suppress_new_clusters" type="boolean" truevalue="--suppress_new_clusters" falsevalue="" checked="false" label="suppress_new_clusters"
+     help="Suppress creation of new clusters using seqs that don't match reference when using -m uclust_ref [default: False]"/>
+    <param name="suppress_presort_by_abundance_uclust" type="boolean" truevalue="--suppress_presort_by_abundance_uclust" falsevalue="" checked="false" label="suppress_presort_by_abundance_uclust"
+     help="Suppress presorting of sequences by abundance when picking OTUs with uclust or uclust_ref [default: False]"/>
+    <param name="similarity" type="float" value="0.97" label="similarity"
+     help="Sequence similarity threshold (for cdhit, uclust, or uclust_ref) [default: 0.97]"/>
+    <param name="enable_rev_strand_match" type="boolean" truevalue="--enable_rev_strand_match" falsevalue="" checked="false" label="enable_rev_strand_match"
+     help="Enable reverse strand matching for uclust otu picking, will double the amount of memory used. [default: False]"/>
+    <param name="optimal_uclust" type="boolean" truevalue="--optimal_uclust" falsevalue="" checked="false" label="optimal_uclust"
+     help="Pass the --optimal flag to uclust for uclust otu picking. [default: False]"/>
+    <param name="exact_uclust" type="boolean" truevalue="--exact_uclust" falsevalue="" checked="false" label="exact_uclust"
+     help="Pass the --exact flag to uclust for uclust otu picking. [default: False]"/>
+    <param name="user_sort" type="boolean" truevalue="--user_sort" falsevalue="" checked="false" label="user_sort"
+     help="Pass the --user_sort flag to uclust for uclust otu picking. [default: False]"/>
+    <param name="max_accepts" type="integer" value="20" label="max_accepts"
+     help="max_accepts value to uclust and uclust_ref [default: 20]"/>
+    <param name="max_rejects" type="integer" value="500" label="max_rejects"
+     help="max_rejects value to uclust and uclust_ref [default: 500]"/>
+    <param name="uclust_otu_id_prefix" type="text"  label="uclust_otu_id_prefix"
+     help="OTU identifier prefix (string) for the de novo uclust OTU picker [default: None, OTU ids are ascending integers]"/>
+    <param name="uclust_stable_sort" type="boolean" truevalue="--uclust_stable_sort" falsevalue="" checked="false" label="uclust_stable_sort"
+     help="pass --stable_sort to uclust (uclust versions uclustq1.2.15 and later only) [default: False]"/>
+    <param name="save_uc_files" type="boolean" truevalue="" falsevalue="--save_uc_files" checked="false" label="save_uc_files"
+     help="Enable preservation of intermediate uclust (.uc) files that are used to generate clusters via uclust. [default: True]"/>
+  </when> <!-- uclust -->
+  <when value="prefix_suffix">
+    <param name="prefix_length" type="integer" value="50" label="prefix_length"
+     help="Prefix length when using the prefix_suffix otu picker; WARNING: CURRENTLY DIFFERENT FROM prefix_prefilter_length (-n)! [default: 50]"/>
+    <param name="suffix_length" type="integer" value="50" label="suffix_length"
+     help="Suffix length when using the prefix_suffix otu picker [default: 50]"/>
+
+  </when> <!-- prefix_suffix -->
+  <when value="blast">
+    <param name="refseqs_fp" type="data" format="fasta" label="refseqs_fp" optional="true"
+     help="Reference sequences to search against"/>
+    <param name="blast_db" type="data" format="txt" optional="True" label="blast_db"
+     help="Pre-existing database to blast against when using -m blast [OPTIONAL]"/>
+    <param name="min_aligned_percent" type="float" value="0.5" label="min_aligned_percent"
+     help="Minimum percent of query sequence that can be aligned to consider a hit  (BLAST OTU picker only) [default: 0.5]"/>
+    <param name="max_e_value" type="float" value="1e-10" label="max_e_value"
+     help="Max E-value when clustering with BLAST [default: 1e-10]"/>
+  </when> <!-- blast -->
+  <when value="cdhit">
+    <param name="max_cdhit_memory" type="integer" value="400" label="max_cdhit_memory"
+     help="Maximum available memory to cd-hit-est (via the program's -M option) for cdhit OTU picking method (units of Mbyte) [default: 400]"/>
+    <param name="similarity" type="float" value="0.97" label="similarity"
+     help="Sequence similarity threshold (for cdhit, uclust, or uclust_ref) [default: 0.97]"/>
+    <param name="prefix_prefilter_length" type="integer" value="0" label="prefix_prefilter_length"
+     help="Prefilter data so seqs with identical first prefix_prefilter_length are automatically grouped into a single OTU.  This is useful for large sequence collections where OTU picking doesn't scale well [default: None; 100 is a good value]"/>
+    <param name="trie_prefilter" type="boolean" truevalue="--trie_prefilter" falsevalue="" checked="false" label="trie_prefilter"
+     help="prefilter data so seqs which are identical prefixes of a longer seq are automatically grouped into a single OTU; useful for large sequence collections where OTU picking doesn't scale well [default: False]"/>
+  </when> <!-- cdhit -->
+  </conditional> <!-- pick -->
+ </inputs>
+ <outputs>
+   <data format="txt" name="log" label="${tool.name} on ${on_string}: log" />
+   <data format="qiimeotu" name="otus" label="${tool.name} on ${on_string}: otus" />
+   <data format="txt" name="failures" label="${tool.name} on ${on_string}: failures.txt" >
+     <filter>(pick['otu_picking_method'] == 'uclust' and pick['refseqs_fp'])</filter>
+   </data>
+ </outputs>
+ <tests>
+ </tests>
+ <help>For more information, see pick_otus_ in the Qiime documentation.
+  
+Updated and validated 01/16/12 by Amanda Zuzolo, Microbiome Analysis Center, George Mason University, Fairfax, VA
+
+Qiime integration courtesy Jim Johnson, Minnesota Supercomputing Institute, University of Minnesota, Minneapolis, MN
+
+.. _pick_otus: http://qiime.org/scripts/pick_otus.html</help>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/pick_rep_set.xml	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,53 @@
+<tool id="pick_rep_set" name="pick_rep_set" version="2.0.0">
+ <description>Pick representative set of sequences</description>
+ <requirements>
+  <requirement type="binary">pick_rep_set.py</requirement>
+ </requirements>
+ <command interpreter="python">
+  qiime_wrapper.py
+  pick_rep_set.py
+  --input_file=$input_file
+  #if $reference_seqs_fp.__str__ != 'None' or $reference_seqs_fp != None and $reference_seqs_fp.__str__ == '':
+  --reference_seqs_fp=$reference_seqs_fp
+  #else:
+  --fasta_file=$fasta_file
+  #end if
+  --rep_set_picking_method=$rep_set_picking_method
+  --sort_by=$sort_by
+  --log_fp=$log_fp
+  --result_fp=$result_fp
+ </command>
+ <inputs>
+  <param name="input_file" type="data" format="qiimeotu" label="input_file"
+   help="Path to input otu mapping file (usually output from pick_otus) [REQUIRED]"/>
+  <param name="fasta_file" type="data" format="fasta" optional="true" label="fasta_file"
+   help="Path to input fasta file [REQUIRED if not picking against a reference set; default: None]"/>
+  <param name="rep_set_picking_method" type="select" label="rep_set_picking_method"
+   help="Method for picking representative sets. [default: first]">
+    <option value="random">random</option>
+    <option value="longest">longest</option>
+    <option value="most_abundant">most_abundant</option>
+    <option value="first" selected="true">first</option>
+  </param>
+  <param name="sort_by" type="select" value="otu" label="sort_by" >
+    <option value="otu" selected="true">otu</option>
+    <option value="seq_id">seq_id</option>
+  </param>
+  <param name="reference_seqs_fp" type="data" format="fasta" optional="true" label="reference_seqs_fp"
+   help="collection of preferred representative sequences"/>
+ </inputs>
+ <outputs>
+   <data format="txt" name="log_fp" label="${tool.name} on ${on_string}: log" />
+   <data format="fasta" name="result_fp" label="${tool.name} on ${on_string}: rep_set.fasta" />
+ </outputs>
+ <tests>
+ </tests>
+ <help>For more information, see pick_rep_set_ in the Qiime documentation.
+   
+Updated and validated 01/16/12 by Amanda Zuzolo, Microbiome Analysis Center, George Mason University, Fairfax, VA
+
+Qiime integration courtesy Jim Johnson, Minnesota Supercomputing Institute, University of Minnesota, Minneapolis, MN
+
+.. _pick_rep_set: http://qiime.org/scripts/pick_rep_set.html</help>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/plot_taxa_summary.xml	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,99 @@
+<tool id="plot_taxa_summary" name="plot_taxa_summary" version="2.0.0">
+ <description>Make taxaonomy summary charts based on taxonomy assignment</description>
+ <requirements>
+  <requirement type="binary">plot_taxa_summary.py</requirement>
+ </requirements>
+ <command interpreter="python">
+  qiime_wrapper.py
+  --galaxy_outputdir='$taxonomy_summary_chart.extra_files_path'
+  --galaxy_datasets='^\S+_charts\.html$:'$taxonomy_summary_chart
+  plot_taxa_summary.py
+  #set $counts = []
+  #for i in $inputs:
+    #set $counts = $counts + [$i.counts_fname.__str__]
+  #end for
+  --counts_fname=#echo ','.join($counts)
+  #if $labels != None and $labels.__str__ != 'None' and $labels.__str__ != '':
+  --labels=$labels
+  #end if
+  --num_categories=$num_categories
+  #if $colorby != None and $colorby.__str__ != 'None' and $colorby.__str__ != '':
+  --colorby=$colorby
+  #end if
+  #if $prefs_path != None and $prefs_path.__str__ != 'None':
+  --prefs_path=$prefs_path
+  #end if
+  --background_color=$background_color
+  --dpi=$dpi
+  --x_width=$x_width
+  --y_height=$y_height
+  --bar_width=$bar_width
+  --type_of_file=$type_of_file
+  --chart_type=$chart_type
+  --resize_nth_label=$resize_nth_label
+  $include_html_legend
+  $include_html_counts
+  --label_type=$label_type
+  --dir_path='$taxonomy_summary_chart.extra_files_path'
+ </command>
+ <inputs>
+  <repeat name="inputs" title="Taxa Summary">
+    <param name="counts_fname" type="data" format="txt" label="counts_fname"
+     help="Summarized taxa file [REQUIRED]"/>
+  </repeat>
+  <param name="labels" type="text"  label="labels"
+   help="list of labels (i.e. Phylum, Class) [REQUIRED]"/>
+  <param name="num_categories" type="text" value="20" label="num_categories"
+   help="Maximum number of individual categories in each pie chart. All additional categories are grouped into an 'other' category. NOTE: this is only used for the pie charts. [default: 20]"/>
+  <param name="colorby" type="text"  label="colorby"
+   help="This is the samples to make charts for in the counts files from summarize_taxa.py. The sample name must match the name of a sample id in the header of the counts file exactly and multiple categories can be list by comma separating them without spaces.  [default: None]"/>
+  <param name="prefs_path" type="data" format="txt" optional="true" label="prefs_path"
+   help="This is the user-generated preferences file. NOTE: This is a file with a dictionary containing preferences for the analysis. The label taxonomy_coloring is used for the coloring, see example prefs file preferences_file. [default: None]"/>
+  <param name="background_color" type="select" label="background_color"
+   help="This is the background color to use in the plots. [default: white]">
+    <option value="white" selected="true">White</option>
+    <option value="black">Black</option>
+  </param>
+  <param name="dpi" type="text" value="80" label="dpi"
+   help="This is the dpi to use in the plots. [default: 80]"/>
+  <param name="x_width" type="text" value="12" label="x_width"
+   help="This is the width to use in the plots. [default: 12]"/>
+  <param name="y_height" type="text" value="6" label="y_height"
+   help="This is the height to use in the plots. [default: 6]"/>
+  <param name="bar_width" type="text" value="0.75" label="bar_width"
+   help="This the width of the bars in the bar graph and should be a number between 0 and 1. NOTE: this is only used for bar charts. [default: 0.75]"/>
+  <param name="type_of_file" type="select" label="type_of_file"
+   help="This is the filename suffix to use for each high-res plot. (i.e. pdf,svg,png) [default: png]">
+    <option value="pdf">pdf</option>
+    <option value="svg">svg</option>
+    <option value="png" selected="true">png</option>
+  </param>
+  <param name="chart_type" type="select" label="chart_type"
+   help="type of chart to plot (i.e. pie, bar or area). [default: area]">
+   <option value="area" selected="true">Area</option>
+   <option value="bar">Bar</option>
+   <option value="pie">Pie</option>
+   </param>
+  <param name="resize_nth_label" type="text" value="0" label="resize_nth_label"
+   help="this is for large area and bar charts where the font on the x-axis is small. This allows you to set every nth label to be larger on the x-axis.This requires an integer value greater than 0.[default: 0]"/>
+  <param name="include_html_legend" type="boolean" truevalue="--include_html_legend" falsevalue="" checked="false" label="include_html_legend" help="Include HTML legend. If present, the writing of the legend in the html page is included. [default: False]"/>
+  <param name="include_html_counts" type="boolean" truevalue="--include_html_counts" falsevalue="" checked="false" label="include_html_counts" help="Include HTML counts. If present, the writing of the counts in the html table is included [default: False]"/>
+  <param name="label_type" type="select" label="label_type" help="Label type. If the label type is numeric, the x-axis will be scaled accordingly. Otherwise, the values will be evenly-spaced and treated categorically. [Default: categorical]">
+   <option value="categorical" selected="true">Categorical</option>
+   <option value="numerical">Numerical</option>
+   </param>
+ </inputs>
+ <outputs>
+  <data name="taxonomy_summary_chart" format="html" label="${tool.name} on ${on_string}: taxonomy_summary_chart: $chart_type"/>
+ </outputs>
+ <tests>
+ </tests>
+ <help>For more information, see plot_taxa_summary_ in the Qiime documentation.
+ 
+Updated and validated 01/20/12 by Amanda Zuzolo, Microbiome Analysis Center, George Mason University, Fairfax, VA
+
+Qiime integration courtesy Jim Johnson, Minnesota Supercomputing Institute, University of Minnesota, Minneapolis, MN
+ 
+ .. _plot_taxa_summary: http://qiime.org/scripts/plot_taxa_summary.html</help>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/principal_coordinates.xml	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,40 @@
+<tool id="principal_coordinates" name="principal_coordinates" version="1.2.0">
+ <description>Principal Coordinates Analysis (PCoA)</description>
+ <requirements>
+  <requirement type="binary">principal_coordinates.py</requirement>
+ </requirements>
+ <command interpreter="python">
+  qiime_wrapper.py
+  principal_coordinates.py
+  --input_path=$input_path
+  --output_path=$output_path
+ </command>
+ <inputs>
+ <conditional name="run_type">
+  <param name="input_type" type="select" label="Input Type" help="Select the type/number of input file(s). If you want to process multiple diversity metrics, select 'multiple files.'">
+   <option value="single">Single File</option>
+   <option value="multi">Multiple Files</option>
+  </param>
+  <when value="single">
+   <param name="input_path" type="data" format="qiimedistmat"  label="input_path"
+   help="path to the input distance matrix file (i.e., the output from beta_diversity.py). [REQUIRED]"/>
+  </when>
+  <when value="multi">
+    <param name="input_path" type="data" format="qiimedistmat"  label="input_path"
+   help="Path to the first distance matrix file of the metrics run. Example: if you ran beta diversity for both 1: unweighted and 2: weighted unifrac, choose the unweighted file. [REQUIRED]"/>
+  </when>
+  </conditional>
+ </inputs>
+ <outputs>
+  <data format="qiimepca" name="output_path" label="${tool.name} on ${on_string}: coordinates"/>
+ </outputs>
+ <tests>
+ </tests>
+ <help>For more information, see principle_coordinates_ in the Qiime documentation.
+ 
+Updated and validated 01/18/12 by Amanda Zuzolo, Microbiome Analysis Center, George Mason University, Fairfax, VA
+Qiime integration courtesy Jim Johnson, Minnesota Supercomputing Institute, University of Minnesota, Minneapolis, MN
+ 
+ .. _principle_coordinates: http://qiime.org/scripts/principal_coordinates.html</help>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/qiime_wrapper.py	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,312 @@
+#!/usr/bin/env python
+import logging, os, string, sys, tempfile, glob, shutil, types, urllib, optparse, re
+import shlex, subprocess
+
+"""
+sys.argv
+this  --galaxy_datasets=   --quime_script 
+
+alpha_rarefaction 
+  output html 
+    wf_arare/alpha_rarefaction_plots/rarefaction_plots.html
+    wf_arare/alpha_rarefaction_plots/html_plots/
+    wf_arare/alpha_div
+    wf_arare/alpha_div/alpha_rarefaction_101_0.txt
+
+    --galaxy_summary_html=$output_html
+    --galaxy_summary_template=$output_template
+    --galaxy_summary_links='label:link,label:link'
+    --galaxy_outputdir=$output_html.extra_files_path
+    
+    
+"""
+
+def stop_err( msg ):
+	sys.stderr.write( "%s\n" % msg )
+	sys.exit()
+
+def __main__():
+	debug = False
+	tmp_dir = None
+	inputdir = None
+	outputdir = None
+	dataset_patterns = None
+	datasetid = None
+	new_dataset_patterns = None
+	new_files_path = None
+	summary_html=None
+	summary_template=None
+	summary_links=None
+    ## adds "log file" printing capabilities for primary output in dynamic file output 
+	logfile = None
+    ## added support for correcting file extensions
+    	newext = None
+	extchange = None	
+    ## check if there are files to generate
+	cmd_args = []
+	for arg in sys.argv[1:]:
+		if arg.startswith('--galaxy_'):
+			(opt,val) = arg.split('=') if arg.find('=') > 0 else (arg,None)
+			'''
+			if opt == '--galaxy_tmpdir':
+				try:
+					if not os.path.exists(val):
+						os.makedirs(val)
+					tmp_dir = val
+				except Exception, ex:
+					stop_err(ex)
+			'''
+			if opt == '--galaxy_outputdir':
+				try:
+					if not os.path.exists(val):
+						os.makedirs(val)
+					outputdir = val
+				except Exception, ex:
+					stop_err(ex)
+			if opt == '--galaxy_datasets':
+				dataset_patterns = val.split(',')
+			if opt == '--galaxy_datasetid':
+				datasetid = val
+			if opt == '--galaxy_new_datasets':
+				new_dataset_patterns = val.split(',')
+			if opt == '--galaxy_new_files_path':
+				if not os.path.exists(val):
+					os.makedirs(val)
+				new_files_path = val
+			if opt == '--galaxy_summary_html':
+				summary_html=val
+			if opt == '--galaxy_summary_template':
+				summary_template=val
+			if opt == '--galaxy_summary_links':
+				summary_links=val
+			if opt == '--galaxy_debug':
+				debug = True
+			if opt == '--galaxy_logfile':
+				logfile = val
+			if opt == '--galaxy_ext_change':
+				extchange = val
+			if opt == '--galaxy_new_ext':
+				newext = val
+			if opt == '--galaxy_inputdir':
+				inputdir = val
+		else:
+			cmd_args.append(arg)
+	if debug: print >> sys.stdout, '\n : '.join(cmd_args) 
+	try:	
+		stderr = ''
+		# allow for changing of file extension for files which require it
+		if extchange != None and inputdir != None and newext != None:
+			#newfile = os.path.join(inputdir,"temporary."+newext)
+			try:
+				os.link(extchange,inputdir+"/temporary."+newext)
+			except:
+				shutil.copy2(extchange,inputdir+"/temporary."+newext)
+		cmdline = ' '.join(cmd_args)
+		if debug: print >> sys.stdout, cmdline
+		'''
+		if tmp_dir == None or not os.path.isdir(tmp_dir):
+			tmp_dir = tempfile.mkdtemp()
+		if outputdir == None or not os.path.isdir(outputdir):
+			outputdir = tmp_dir
+		'''
+		tmp_stderr_name = tempfile.NamedTemporaryFile( dir=tmp_dir,suffix='.err' ).name
+		tmp_stderr = open( tmp_stderr_name, 'wb' )
+		tmp_stdout_name = tempfile.NamedTemporaryFile( dir=tmp_dir,suffix='.out' ).name
+		tmp_stdout = open( tmp_stdout_name, 'wb' )
+		proc = subprocess.Popen( args=cmdline, shell=True, cwd=tmp_dir, stderr=tmp_stderr.fileno(), stdout=tmp_stdout.fileno() )
+		returncode = proc.wait()
+		tmp_stderr.close()
+        # get stderr, allowing for case where it's very large
+		tmp_stderr = open( tmp_stderr_name, 'rb' )
+		buffsize = 1048576
+		try:
+			while True:
+				stderr += tmp_stderr.read( buffsize )
+				if not stderr or len( stderr ) % buffsize != 0:
+					break
+			if debug: print >> sys.stderr, stderr
+		except OverflowError:
+			pass
+		tmp_stderr.close()
+		if returncode != 0:
+			if debug: print >> sys.stderr, "returncode = %d" % returncode 
+			raise Exception, stderr
+			#raise Exception, sys.stderr
+        # collect results
+		if dataset_patterns != None:
+			for root, dirs, files in os.walk(outputdir):
+				for fname in files:
+					fpath = os.path.join(root,fname)
+					if dataset_patterns != None:
+						for output in dataset_patterns:
+							(pattern,path) = output.split(':')
+							if debug: print >> sys.stdout, '%s -> %s' % (pattern,path)
+							if path == None or path == 'None':
+								continue
+							if debug: print >> sys.stdout, 'outdir %s match: %s' % (fname,re.match(pattern,fname))
+							if re.match(pattern,fname):
+								found = True
+								# flist.remove(fname)
+								try:
+									shutil.copy2(fpath, path)
+									if new_files_path != None:
+										os.link(fpath, os.path.join(new_files_path,fname))
+								except Exception, ex:
+									stop_err('%s' % ex)
+		# move result to outdir 
+		# Need to flatten the dir hierachy in order for galaxy to serve the href links
+		if summary_html != None:
+			"""
+			for root, dirs, files in os.walk(outputdir):
+				if root != outputdir:
+					for fname in files:
+						fpath = os.path.join(root,fname)
+			"""
+			## move everything up one level
+			dlist = os.listdir(outputdir)
+			for dname in dlist:
+				dpath = os.path.join(outputdir,dname)
+				if os.path.isdir(dpath):
+					flist = os.listdir(dpath)
+					for fname in flist:
+						fpath = os.path.join(dpath,fname)
+						shutil.move(fpath,outputdir)
+			if summary_template != None:
+				shutil.copy(summary_template,summary_html)
+		"""
+		flist = os.listdir(outputdir)
+		if debug: print >> sys.stdout, 'outputdir: %s' % outputdir
+		if debug: print >> sys.stdout, 'files: %s' % ','.join(flist)
+		if dataset_patterns != None:
+			for output in dataset_patterns:
+				(pattern,path) = output.split(':')
+				if debug: print >> sys.stdout, '%s -> %s' % (pattern,path)
+				if path == None or path == 'None':
+					continue
+				for fname in flist:
+					if debug: print >> sys.stdout, 'outdir %s match: %s' % (fname,re.match(pattern,fname))
+					if re.match(pattern,fname):
+						found = True
+						flist.remove(fname)
+						fpath = os.path.join(outputdir,fname)
+						try:
+							shutil.copy2(fpath, path)
+						except Exception, ex:
+							stop_err('%s' % ex)
+		"""
+    	# Handle the dynamically generated galaxy datasets
+    	# http://bitbucket.org/galaxy/galaxy-central/wiki/ToolsMultipleOutput
+    	# --new_datasets = specifies files to be found in the new_file_path
+    	# The list items are separated by commas
+    	# Each item conatins: a regex pattern for matching filenames and  a galaxy datatype (separated by :)
+    	# The regex match.groups()[0] is used as the id name of the dataset, and must result in  unique name for each output
+		# The --galaxy_output flag is used for instances where data needs to be copied to the extra_files_path for later
+		# directory use
+		if new_dataset_patterns != None and new_files_path != None and datasetid != None:
+			for output in new_dataset_patterns:
+				if ':' in output: pattern,ext = output.split(':',1)
+				flist = os.listdir(new_files_path)
+				for fname in flist:
+					m = re.match(pattern,fname)
+					if m:
+						fpath = os.path.join(new_files_path,fname)
+						if len(m.groups()) > 0:
+							root = m.groups()[0]
+						else:
+                       	# remove  the ext from the name if it exists, galaxy will add back later
+                   	   	# remove underscores since galaxy uses that as a field separator for dynamic datasets
+							root = re.sub('\.?'+ext+'$','',fname).replace('_','').replace('.','')
+	                   	# filename pattern required by galaxy 
+						fn = "%s_%s_%s_%s_%s" % ( 'primary', datasetid, root, 'visible', ext )
+						if debug:  print >> sys.stdout, '> %s' % fpath
+						if debug:  print >> sys.stdout, '< %s' % os.path.join(new_files_path,fn)
+						try:
+							os.link(fpath, os.path.join(new_files_path,fn))
+							# needed for files with variable output and a directory structure
+							if outputdir != None:
+								os.link(fpath, os.path.join(outputdir,fname))
+							# clean out files from tmp directory, may be unnecessary
+							#os.remove(fpath)
+						except:
+							shutil.copy2(fpath, os.path.join(new_files_path,fn))
+							# needed for files with variable output and a directory structure
+							if outputdir != None:
+								os.link(fpath, os.path.join(outputdir,fname))
+						
+		print "bob" + logfile
+		'''
+		if logfile != None:
+			print "bleep"
+			if outputdir != None:
+				print "beep"
+				logwrite = open(logfile, 'w+')
+				logwrite.write('Tool started. Files created by tool: \n')
+				flist = os.listdir(outputdir)
+				for fname in flist:
+					if 'DS_Store' not in fname:
+						logwrite.write(fname+'\n')
+				logwrite.write('Tool Finished.')
+				logwrite.close()
+			if new_files_path != None:
+				print "boop"
+				logwrite = open(logfile, 'w+')
+				if len(logfile.readline() > 0):
+					logwrite.write('Tool started. Files created by tool: \n')
+					flist = os.listdir(new_files_path)
+					for fname in flist:
+						if 'DS_Store' not in fname:
+							logwrite.write(fname+'\n')
+					logwrite.write('Tool Finished.')
+					logwrite.close()
+		'''
+	except Exception, e:
+		msg = str(e) + stderr
+		#msg = str(e) + str(sys.stderr)
+		#stop_err( 'Error running  ' + msg)
+	finally:
+        # Only remove temporary directories and files from temporary directory
+        # Enclose in try block, so we don't report error on stale nfs handles
+		try:
+			if logfile != None:
+				if outputdir != None:
+					logwrite = open(logfile, 'r+')
+					logwrite.write('Tool started. Files created by tool: \n')
+					flist = os.listdir(outputdir)
+					for fname in flist:
+						if 'DS_Store' not in fname and 'primary' not in fname:
+							logwrite.write(fname+'\n')
+					logwrite.write('Tool Finished.')
+					logwrite.close()
+				if new_files_path != None:
+					logwrite = open(logfile, 'r+')
+					logwrite.write('Tool started. Files created by tool: \n')
+					flist = os.listdir(new_files_path)
+					for fname in flist:
+						if 'DS_Store' not in fname and 'primary' not in fname:
+							logwrite.write(fname+'\n')
+					logwrite.write('Tool Finished.')
+					logwrite.close()
+			if tmp_dir != None and os.path.exists(tmp_dir) and os.path.isfile(tmp_dir):
+				#shutil.rmtree(tmp_dir)
+				pass
+			if outputdir != None and 'files' not in outputdir:
+				flist = os.listdir(outputdir)
+				for fname in flist:
+					if 'DS_Store' not in fname and 'primary' not in fname:
+						os.remove(os.path.join(outputdir,fname))
+			if inputdir != None and 'files' not in inputdir:
+				flist = os.listdir(inputdir)
+				for fname in flist:
+					if 'DS_Store' not in fname and 'primary' not in fname:
+						os.remove(os.path.join(inputdir,fname))
+			if new_files_path != None and 'files' not in new_files_path:
+				flist = os.listdir(new_files_path)
+				for fname in flist:
+					if 'DS_Store' not in fname and 'primary' not in fname:
+						os.remove(os.path.join(new_files_path,fname))
+
+		except:
+			pass
+		
+if __name__ == "__main__": __main__()
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/single_rarefaction.xml	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,36 @@
+<tool id="single_rarefaction" name="single_rarefaction" version="1.5.0">
+ <description>Perform rarefaction on an otu table</description>
+ <requirements>
+  <requirement type="binary">single_rarefaction.py</requirement>
+ </requirements>
+ <command interpreter="python">
+  qiime_wrapper.py
+  single_rarefaction.py
+  --input_path=$input_path
+  --output_path=$output_path
+  --depth=$depth
+  $suppress_lineages_included
+  $keep_empty_otus
+ </command>
+ <inputs>
+  <param name="input_path" type="data" format="qiimeotutable"  label="input_path"
+   help="input otu table filepath [REQUIRED]"/>
+  <param name="depth" type="integer" value="1" label="depth"
+   help="sequences per sample to subsample [REQUIRED]"/>
+  <param name="suppress_lineages_included" type="boolean" truevalue="--suppress_lineages_included" falsevalue="" checked="false" label="suppress_lineages_included"
+   help="Exclude taxonomic (lineage) information for each OTU. Note: this will only work if lineage information is in the input OTU table. [default: False]"/>
+  <param name="keep_empty_otus" type="boolean" truevalue="--keep_empty_otus" falsevalue="" checked="false" label="keep_empty_otus"
+   help="otus (rows) of all zeros are usually omitted from the output otu table, with -k they will not be removed from the output file [default: False]"/>
+ </inputs>
+ <outputs>
+  <data format_source="input_path" name="output_path" label="${tool.name} on ${on_string}: rarefaction"/>
+ </outputs>
+ <tests>
+ </tests>
+ <help>For more information, see single_rarefaction_ in the Qiime documentation.
+ 
+Qiime integration courtesy Jim Johnson, Minnesota Supercomputing Institute, University of Minnesota, Minneapolis, MN
+ 
+ .. _single_rarefaction: http://qiime.org/scripts/single_rarefaction.html</help>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/split_libraries.xml	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,148 @@
+<tool id="split_libraries" name="split_libraries" version="2.0.0">
+ <description>Split libraries according to barcodes specified in mapping file</description>
+ <requirements>
+  <requirement type="binary">split_libraries.py</requirement>
+ </requirements>
+ <command interpreter="python">
+  qiime_wrapper.py
+  --galaxy_datasets='^seqs\.fna$:'$sequences,'histograms\.txt:'$histograms,'split_library_log\.txt:'$log
+  --galaxy_outputdir='$log.extra_files_path'
+  split_libraries.py
+  --dir-prefix='$log.extra_files_path'
+  --map=$map
+  #set fnas = []
+  #for i in $inputs:
+    #set fnas = $fnas + [$i.fasta.__str__]
+  #end for
+  --fasta=#echo ','.join($fnas)
+  #set quals = []
+  #for i in $inputs:
+    #if $i.qual != None and $i.qual.__str__ != 'None':
+      #set quals = $quals + [$i.qual.__str__]
+    #end if
+  #end for
+  #if len($quals) > 0:
+    --qual=#echo ','.join($quals)
+  #end if
+  #if len($min_seq_length.__str__) > 0 and $min_seq_length > 0:
+    --min-seq-length=$min_seq_length
+  #end if
+  #if len($max_seq_length.__str__) > 0:
+    --max-seq-length=$max_seq_length
+  #end if
+  $trim_seq_length
+  #if len($min_qual_score.__str__) > 0:
+    --min-qual-score=$min_qual_score
+  #end if
+  $keep_primer
+  $keep_barcode
+  #if len($max_ambig.__str__) > 0:
+    --max-ambig=$max_ambig
+  #end if
+  #if len($max_homopolymer.__str__) > 0:
+  --max-homopolymer=$max_homopolymer
+  #end if
+  #if len($max_primer_mismatch.__str__) > 0:
+  --max-primer-mismatch=$max_primer_mismatch
+  #end if
+  --barcode-type=$barcode_type
+  #if $max_barcode_errors >= 0.:
+  --max-barcode-errors=$max_barcode_errors
+  #end if
+  #if len($start_numbering_at.__str__) > 0:
+  --start-numbering-at=$start_numbering_at
+  #end if
+  $retain_unassigned_reads
+  $disable_bc_correction
+  #if len($qual_score_window.__str__) > 0:
+  --qual_score_window=$qual_score_window
+  #end if
+  $disable_primers
+  --reverse_primers=$reverse_primers
+  #if $reverse_primer_mismatches != None and $reverse_primer_mismatches.__str__ != "" and $reverse_primers.__str__!='disable':
+  --reverse_primer_mismatches=$reverse_primer_mismatches
+  #end if
+  $record_qual_scores
+  $discard_bad_windows
+  #if $median_length_filtering != None and $median_length_filtering.__str__ != "":
+  --median_length_filtering=$median_length_filtering
+  #end if
+  #if $added_demultiplex_field != None and $added_demultiplex_field.__str__ != "":
+  --added_demultiplex_field=$added_demultiplex_field
+  #end if
+ </command>
+ <inputs>
+  <param name="map" type="data" format="tabular" label="map"
+   help="name of mapping file. NOTE: Must contain a header line indicating SampleID in the first column and BarcodeSequence in the second, LinkerPrimerSequence in the third. [REQUIRED]"/>
+  <repeat name="inputs" title="Input Sequences">
+    <param name="fasta" type="data" format="fasta" label="fasta"
+     help="names of fasta file [REQUIRED]"/>
+    <param name="qual" type="data" format="qual"  optional="true" label="qual"
+     help="names of qual file [OPTIONAL]"/>
+  </repeat>
+  <param name="min_seq_length" type="integer" value="200" label="min-seq-length"
+   help="minimum sequence length, in nucleotides [default: 200]"/>
+  <param name="max_seq_length" type="integer" value="1000" label="max-seq-length"
+   help="maximum sequence length, in nucleotides [default: 1000]"/>
+  <param name="trim_seq_length" type="boolean" truevalue="--trim-seq-length" falsevalue="" checked="false" label="trim-seq-length"
+   help="calculate sequence lengths after trimming primers and barcodes [default: False]"/>
+  <param name="min_qual_score" type="integer" value="25" label="min-qual-score"
+   help="min average qual score allowed in read [default: 25]"/>
+  <param name="keep_primer" type="boolean" truevalue="--keep-primer" falsevalue="" checked="false" label="keep-primer"
+   help="do not remove primer from sequences"/>
+  <param name="keep_barcode" type="boolean" truevalue="--keep-barcode" falsevalue="" checked="false" label="keep-barcode"
+   help="do not remove barcode from sequences"/>
+  <param name="max_ambig" type="integer" value="0" label="max-ambig"
+   help="maximum number of ambiguous bases [default: 0]"/>
+  <param name="max_homopolymer" type="integer" value="6" label="max-homopolymer"
+   help="maximum length of homopolymer run [default: 6]"/>
+  <param name="max_primer_mismatch" type="integer" value="0" label="max-primer-mismatch"
+   help="maximum number of primer mismatches [default: 0]"/>
+  <param name="barcode_type" type="text" value="golay_12" label="barcode-type"
+   help="barcode type, hamming_8, golay_12, variable_length (will disable any barcode correction if variable_length set), or a number representing the length of the barcode, such as -b 4.  [default: golay_12]"/>
+  <param name="max_barcode_errors" type="float" value="1.5" label="max-barcode-errors"
+   help="maximum number of errors in barcode [default: 1.5]"/>
+  <param name="start_numbering_at" type="integer" min="1" value="1" label="start-numbering-at"
+   help="seq id to use for the first sequence [default: 1]"/>
+  <param name="retain_unassigned_reads" type="boolean" truevalue="--retain_unassigned_reads" falsevalue="" checked="false" label="retain_unassigned_reads"
+   help="Retain sequences which are unassigned in the output sequence file [default: False]"/>
+  <param name="disable_bc_correction" type="boolean" truevalue="--disable_bc_correction" falsevalue="" checked="false" label="disable_bc_correction"
+   help="Disable attempts to find nearest corrected barcode. Can improve performance. [default: False]"/>
+  <param name="qual_score_window" type="integer" value="0" label="qual_score_window"
+   help="Enable sliding window test of quality scores.  If the average score of a continuous set of w nucleotides falls below the threshold (see -s for default), the sequence is discarded. A good value would be 50. 0 (zero) means no filtering. Must pass a .qual file (see -q parameter) if this functionality is enabled. [default: 0]"/>
+  <param name="discard_bad_windows" type="boolean" truevalue="--discard_bad_windows" falsevalue="" checked="false" label="discard_bad_windows"
+   help="If the qual_score_window option (-w) is enabled, this will override the default truncation behavior and discard any sequences where a bad window is found.  [default: False]"/>
+  <param name="disable_primers" type="boolean" truevalue="--disable_primers" falsevalue="" checked="false" label="disable_primers"
+   help="Disable primer usage when demultiplexing.  Should be enabled for unusual circumstances, such as analyzing Sanger sequence data generated with different primers.  [default: False]"/>
+  <param name="reverse_primers" type="select" label="reverse_primers"
+   help="Enable removal of the reverse primer and any subsequence sequence from the end of each read.  To enable this, there has to be a 'ReversePrimer' column in the mapping file. Primers a required to be in IUPAC format and written in the 5' to  3' direction.  Valid options are 'disable', 'truncate_only', and 'truncate_remove'.  'truncate_only' will remove the primer and subsequence sequence data from the output read and will not alter output of sequences where the primer cannot be found. 'truncate_remove' will flag sequences where the primer cannot be found to not be written and will record the quantity of such failed sequences in the log file. [default: disable]">
+    <option value="disable" selected="true">disable</option>
+    <option value="truncate_only">truncate_only</option>
+    <option value="truncate_remove">truncate_remove</option>
+  </param>
+  <param name="reverse_primer_mismatches" type="integer" value="0" label="reverse_primer_mismatches"
+  help="Set number of allowed mismatches for reverse primers. [default: 0]"/>
+  <param name="record_qual_scores" type="boolean" truevalue="--record_qual_scores" falsevalue="" checked="false" label="record_qual_scores"
+   help="Enables recording of quality scores for all sequences that are recorded.  If this option is enabled, a file named seqs_filtered.qual will be created in the output directory, and will contain the same sequence IDs in the seqs.fna file and sequence quality scores matching the bases present in the seqs.fna file. [default: False]"/>
+  <param name="median_length_filtering" type="text" value="" label="median_length_filtering"
+   help="Disables minimum and maximum sequence length filtering, and instead calculates the median sequence length and filters the sequences based upon the number of median absolute deviations specified by this parameter. Any sequences with lengths outside the number of deviations will be removed. [default: None]"/>
+  <param name="added_demultiplex_field" type="text" value="" label="added_demultiplex_field"
+   help="Use this option to add a field to use in the mapping file as an additional demultiplexing option to the barcode. All combinations of barcodes and the values in these fields must be unique. The fields must contain values that can be parsed from the fasta labels such as 'plate==R_2008_12_09'. In this case, 'plate' would be the column header and 'R_2008_12_09' would be the field data (minus quotes) in the mapping file. To use the run prefix from the fasta label, such as '>FLP3FBN01ELBSX', where 'FLP3FBN01' is generated from the run ID, enter 'run_prefix' in the field and set the run prefix to be used as the data under the column header 'run_prefix'. [default: None]"/>
+ </inputs>
+ <outputs>
+   <data format="txt" name="log" label="${tool.name} on ${on_string}: log" />
+   <data format="txt" name="histograms" label="${tool.name} on ${on_string}: histograms"/>
+   <data format="fasta" name="sequences" label="${tool.name} on ${on_string}: fasta"/>
+ </outputs>
+ <tests>
+ </tests>
+ <help>For more information, see split_libraries_ in the Qiime documentation.
+ 
+Updated and validated 01/19/12 by Amanda Zuzolo, Microbiome Analysis Center, George Mason University, Fairfax, VA
+
+Qiime integration courtesy Jim Johnson, Minnesota Supercomputing Institute, University of Minnesota, Minneapolis, MN
+ 
+ .. _split_libraries: http://qiime.org/scripts/split_libraries.html 
+ </help>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/summarize_otu_by_cat.xml	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,38 @@
+<tool id="summarize_otu_by_cat" name="summarize_otu_by_cat" version="2.0.0">
+ <description>Create a summarized OTU table for a specific metadata category</description>
+ <requirements>
+  <requirement type="binary">summarize_otu_by_cat.py</requirement>
+ </requirements>
+ <command interpreter="python">
+  qiime_wrapper.py
+  summarize_otu_by_cat.py
+  --mapping_fp=$mapping_fp
+  --otu_table_fp=$otu_table_fp
+  --mapping_category=$mapping_category
+  --output_fp=$output_fp
+  $normalize_flag
+ </command>
+ <inputs>
+  <param name="mapping_fp" type="data" format="tabular" label="input_map"
+   help="name of input map file [REQUIRED]"/>
+  <param name="otu_table_fp" type="data" format="txt" label="otu_file"
+   help="name of otu table file [REQUIRED]"/>
+  <param name="mapping_category" type="text"  label="mapping_category"
+   help="name of category for OTU table [REQUIRED]"/>
+  <param name="normalize_flag" type="boolean" truevalue="--normalize_flag" falsevalue="" checked="false" label="normalize_flag"
+   help="if True will normalize counts [default: False]"/>
+ </inputs>
+ <outputs>
+  <data format="txt" name="output_fp" label="summarize_otu_by_cat"/>
+ </outputs>
+ <tests>
+ </tests>
+ <help>For more information, see summarize_otu_by_cat_ in the Qiime documentation.
+ 
+Updated and validated 01/18/12 by Amanda Zuzolo, Microbiome Analysis Center, George Mason University, Fairfax, VA
+
+Qiime integration courtesy Jim Johnson, Minnesota Supercomputing Institute, University of Minnesota, Minneapolis, MN
+ 
+ .. _summarize_otu_by_cat: http://qiime.org/scripts/summarize_otu_by_cat.html</help>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime/summarize_taxa.xml	Wed Jun 06 16:40:30 2012 -0400
@@ -0,0 +1,93 @@
+<tool id="summarize_taxa" name="summarize_taxa" version="2.0.0" force_history_refresh="True">
+<description>Summarize Taxa</description>
+ <requirements>
+  <requirement type="binary">summarize_taxa.py</requirement>
+ </requirements>
+ <command interpreter="python">
+  qiime_wrapper.py
+  #set $levelnums = str($level).split(",")
+  #set $filestr = ""
+  #if $len($level.__str__) > 1:
+  #for $i in $levelnums:
+  #set $filestr = $filestr + '^\\\\S+_L'+$i+'\\\\.txt$:txt,'
+  #end for
+  --galaxy_new_datasets=$filestr
+  --galaxy_datasetid=$output1.id
+  --galaxy_new_files_path='$__new_file_path__'
+  --galaxy_logfile=$output1.__str__
+  #else:
+  --galaxy_datasets='^\S+_L'$level'\.txt$:'$output1
+  --galaxy_outputdir='$output1.extra_files_path'
+  #end if
+  summarize_taxa.py
+  --otu_table_fp=$otu_table_fp
+  --level=$level
+  #if $mapping != None and $mapping.__str__ != 'None':
+  --mapping=$mapping
+  #end if
+  #if $len($level.__str__) > 1:
+  --output_dir=$__new_file_path__
+  #else:
+  --output_dir='$output1.extra_files_path'
+  #end if
+  $absolute_abundance
+  #if $lower_percentage > 0.0 and $lower_percentage.__str__ != '':
+  --lower_percentage=$lower_percentage
+  #end if
+  #if $upper_percentage > 0.0 and $upper_percentage.__str__ != '':
+  --upper_percentage=$upper_percentage
+  #end if
+  $transposed_output
+  #if $delimiter.__str__ != ';':
+  --delimiter=$delimiter
+  #end if
+ </command>
+ <!--
+ '^\S+_log\.txt$:'$log
+ \'$__collected_datasets_primary_output$i
+ galaxy_outputdir='$__new_file_path__'
+ -->
+ <inputs>
+  <param name="otu_table_fp" type="data" format="qiimeotutable" label="otu_table_fp"
+   help="Input OTU table [REQUIRED]"/>
+  <param name="level" type="text" value="2,3,4,5,6" label="level"
+   help="Level of taxonomy to use [default: 2,3,4,5,6]"/>
+  <param name="mapping" type="data" format="qiimemapping" optional="true" label="mapping"
+   help="if supplied - the taxon information will be added to the mapping file. This mapping file can be used to color PCoA plots by taxon abundance or to perform statistical tests of taxon/mapping associations. If you plan to plot your taxa summaries, do not upload a mapping file."/>
+  <param name="delimiter" type="text" value=";" label="delimiter"
+   help="Delimiter that separates taxonomy categories. [default: ;]">
+    <sanitizer sanitize="False">
+   <valid>
+     <add value=";"/>
+     <add value="|"/>
+    </valid>
+ </sanitizer>
+ </param>
+  <param name="absolute_abundance" type="boolean" truevalue="--absolute_abundance" falsevalue="" checked="false" label="absolute_abundance"
+   help="If present, reports the absolute abundance of the lineage in each sample. By default uses relative abundance [default: False]"/>
+   <param name="lower_percentage" type="float" optional="true" value="" label="lower_percentage"
+   help="If present, OTUs having higher absolute abundance are trimmed. To remove OTUs that make up more than 5% of the total dataset you would pass 0.05. [default: None]"/>
+  <param name="upper_percentage" type="float" optional="true" value="" label="upper_percentage"
+   help="If present, OTUs having lower absolute abundance are trimmed. To remove the OTUs that makes up less than 45% of the total dataset you would pass 0.45. [default: None]"/>
+  <param name="transposed_output" type="boolean" truevalue="--transposed_output" falsevalue="" checked="false" label="transposed_output"
+   help="If present, the output will be written transposed from the regular output. This is helpful in cases when you want to use Site Painter to visualize your data [default: False]"/>
+ </inputs>
+ <outputs>
+  <data format="txt" name="output1" label="${tool.name} on ${on_string}: taxa_summary for Level $level"/>
+ </outputs>
+ <tests>
+ </tests>
+ <help>
+.. class:: warningmark
+
+Please reload your browser to see all results in your history.
+ 
+For more information, see summarize_taxa_ in the Qiime documentation.
+ 
+Updated and validated 01/19/12 by Amanda Zuzolo, Microbiome Analysis Center, George Mason University, Fairfax, VA
+
+Qiime integration courtesy Jim Johnson, Minnesota Supercomputing Institute, University of Minnesota, Minneapolis, MN
+ 
+ .. _summarize_taxa: http://qiime.org/scripts/summarize_taxa.html</help>
+</tool>
+