# HG changeset patch
# User dfornika
# Date 1572493092 14400
# Node ID 17a60dd45b31d22958c916ab0cb8d9a705b7bea9
# Parent 7124bff199fab33c11bb42289e06ee4966ef1f3d
"planemo upload for repository https://github.com/phac-nml/mob-suite commit 608abbed8881523f97c0378e350f32243a754237-dirty"
diff -r 7124bff199fa -r 17a60dd45b31 README.md
--- a/README.md Wed Sep 25 13:56:15 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-# MOB-suite: Software tools for clustering, reconstruction and typing of plasmids from draft assemblies
-
-
-These are Galaxy wrappers for [MOB-Suite](https://github.com/phac-nml/mob-suite): a set of tools designed to be a modular set of tools for the typing and reconstruction of plasmid sequences from WGS assemblies. This wrapper allows to conveniently run all these tools on a Galaxy instance. Also coupling MOB-Suite tools with other AMR tools via workflows allows to obtain both mobilome and resistome valuable information.
-
-
-For more information please refer to https://github.com/phac-nml/mob-suite
diff -r 7124bff199fa -r 17a60dd45b31 distance_matrix_phylip.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/distance_matrix_phylip.py Wed Oct 30 23:38:12 2019 -0400
@@ -0,0 +1,69 @@
+#!/usr/bin/env python
+
+import argparse
+import sys
+import csv
+import numpy as np
+
+from Bio.Phylo.TreeConstruction import DistanceMatrix, DistanceTreeConstructor
+
+
+def process_input_matrix(input_matrix):
+ """ Converts an array-of-arrays containting sample IDs and distances
+ into a BioPython DistanceMatrix object
+ """
+ input_matrix.pop(0)
+ sample_names = [row[0] for row in input_matrix]
+ for row in input_matrix:
+ row.pop(0)
+ distance_matrix = []
+ for input_matrix_row in input_matrix:
+ distance_matrix.append([float(i) for i in input_matrix_row])
+ """ np.tril() converts a matrix like this: [[0 1 2]
+ [1 0 1]
+ [2 1 0]]
+ ...into this: [[0 0 0]
+ [1 0 0]
+ [2 1 0]]
+ ...but what we need to pass to DistanceMatrix() is this: [[0]
+ [1 0]
+ [2 1 0]]
+ ...so that's what the (somewhat cryptic) code below does.
+ """
+ distance_matrix = np.tril(np.array(distance_matrix))
+ num_rows = distance_matrix.shape[0]
+ """ masking the distance matrix with tril_indices gives a linearized
+ distance matrix [0 1 0 2 1 0] that we need to re-construct
+ into [[0], [1, 0], [2, 1, 0]]
+ """
+ lower_triangular_idx_mask = np.tril_indices(num_rows)
+ linear_distance_matrix = distance_matrix[lower_triangular_idx_mask]
+ distance_matrix = []
+ min = 0
+ max = 1
+ for i in range(num_rows):
+ distance_matrix.append(linear_distance_matrix[min:max].tolist())
+ min = max
+ max = max + (i + 2)
+
+ distance_matrix = DistanceMatrix(names=sample_names, matrix=distance_matrix)
+
+ return distance_matrix
+
+def main():
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--input", dest="input", help="")
+ args = parser.parse_args()
+
+ reader = csv.reader(open(args.input, "r"), delimiter="\t")
+ input_matrix = list(reader)
+ # Don't build a tree with fewer than 3 samples, just produce an empty file
+ if len(input_matrix) < 4:
+ print('();')
+ sys.exit(0)
+ distance_matrix = process_input_matrix(input_matrix)
+ distance_matrix.format_phylip(sys.stdout)
+
+
+if __name__ == '__main__':
+ main()
diff -r 7124bff199fa -r 17a60dd45b31 distance_matrix_phylip.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/distance_matrix_phylip.xml Wed Oct 30 23:38:12 2019 -0400
@@ -0,0 +1,29 @@
+
+
+
+ biopython
+
+
+ '${output}'
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 7124bff199fa -r 17a60dd45b31 mash_dist_from_mob_db.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mash_dist_from_mob_db.xml Wed Oct 30 23:38:12 2019 -0400
@@ -0,0 +1,59 @@
+
+ determines how well query sequences are contained within a pool of sequences.
+
+ macros.xml
+
+
+ mash
+
+ mash --version
+ '$output'
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+@article{ondov2016mash,
+ title={Mash: fast genome and metagenome distance estimation using MinHash},
+ author={Ondov, Brian D and Treangen, Todd J and Melsted, P{\'a}ll and Mallonee, Adam B and Bergman, Nicholas H and Koren, Sergey and Phillippy, Adam M},
+ journal={Genome biology},
+ volume={17},
+ number={1},
+ pages={132},
+ year={2016},
+ publisher={BioMed Central}
+ }
+
+
+
diff -r 7124bff199fa -r 17a60dd45b31 mob_recon.xml
--- a/mob_recon.xml Wed Sep 25 13:56:15 2019 -0400
+++ b/mob_recon.xml Wed Oct 30 23:38:12 2019 -0400
@@ -1,4 +1,4 @@
-
+
Type contigs and extract plasmid sequences
mob_suite
@@ -11,29 +11,30 @@
#set $named_input = re.sub(r'(\s|\(|\)|:|!)', '_', str($input.element_identifier)+".fasta")
ln -s "$input" $named_input &&
- mob_recon --num_threads \${GALAXY_SLOTS:-4} --infile "${named_input}"
+ mob_recon
+ --num_threads \${GALAXY_SLOTS:-4}
+ --infile "${named_input}"
#if str($adv_param.unicycler_contigs) == "True":
--unicycler_contigs
- #end if
+ #end if
#if str($adv_param.run_circlator) == "True":
--run_circlator
- #end if
- #if str($adv_param.run_typer) == "True":
- --run_typer
#end if
#if str($adv_param.min_length_condition.min_length_param) == "True":
--min_length ${adv_param.min_length_condition.min_length_value}
#end if
- --min_rep_evalue '${adv_param.min_rep_evalue}'
+ --run_typer --min_rep_evalue '${adv_param.min_rep_evalue}'
--min_rep_evalue '${adv_param.min_rep_evalue}'
--min_mob_evalue '${adv_param.min_mob_evalue}'
--min_con_evalue '${adv_param.min_con_evalue}'
--min_rep_ident '${adv_param.min_rep_ident}'
--min_mob_ident '${adv_param.min_mob_ident}'
- --min_con_ident '${adv_param.min_con_ident}'
- --min_rpp_ident '${adv_param.min_rpp_ident}'
- --outdir '.' &&
- mkdir ./plasmids && (cp plasmid*.fasta ./plasmids 2> /dev/null || true)
+ --min_con_ident '${adv_param.min_con_ident}'
+ --min_rpp_ident '${adv_param.min_rpp_ident}'
+ --outdir '.' &&
+ mkdir ./plasmids &&
+ (cp plasmid*.fasta ./plasmids 2> /dev/null || true) &&
+ tar -czf plasmids.tgz plasmids
]]>
@@ -47,10 +48,6 @@
-
-
-
-
@@ -73,12 +70,9 @@
-
-
-
-
-
-
+
+
+
@@ -87,7 +81,7 @@
-