# HG changeset patch
# User thanhlv
# Date 1554972688 14400
# Node ID 814eed3d4f3ea1350804ce2fdf0224c6ce404b43
planemo upload for repository https://github.com/quadram-institute-bioscience/galaxy-tools/tree/master/tools/plasmidtron commit d2ae53b6ee23d56d26e9add8fe5ade2e20e75b87-dirty
diff -r 000000000000 -r 814eed3d4f3e macros.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/macros.xml Thu Apr 11 04:51:28 2019 -0400
@@ -0,0 +1,18 @@
+
+ 0.4.1
+
+
+ plasmidtron
+
+
+
+
+ plasmidtron --version
+
+
+
+
+ 10.1099/mgen.0.000164
+
+
+
\ No newline at end of file
diff -r 000000000000 -r 814eed3d4f3e plasmidtron.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/plasmidtron.xml Thu Apr 11 04:51:28 2019 -0400
@@ -0,0 +1,98 @@
+
+ A tool to assemble parts of a genome responsible for a trait
+
+ macros.xml
+
+
+
+
+ > fot.tmp &&
+ #end for
+ python $__tool_directory__/tidy.py fot.tmp fot.list &&
+
+ #for $counter, $input in enumerate($font_list):
+ #set $new_name = $input.element_identifier
+ ln -sf '$input' ./$new_name &&
+ echo ./$new_name >> font.tmp &&
+ #end for
+ python $__tool_directory__/tidy.py font.tmp font.list &&
+
+ plasmidtron
+ --action $opt_args.action
+ #if $opt_args.keep_files
+ $opt_args.keep_files
+ #end if
+ --kmer $opt_args.kmer
+ --min_contig_len $opt_args.min_contig_len
+ --min_spades_contig_coverage $opt_args.min_spades_contig_coverage
+ --max_spades_contig_coverage $opt_args.max_spades_contig_coverage
+ --min_kmers_threshold $opt_args.min_kmers_threshold
+ --max_kmers_threshold $opt_args.max_kmers_threshold
+ --min_kmers_per_read $opt_args.min_kmers_per_read
+ #if $opt_args.match_both_pairs
+ $opt_args.match_both_pairs
+ #end if
+ --plot_filename $opt_args.plot_filename
+ --threads $opt_args.threads
+ #if $opt_args.verbose
+ $opt_args.verbose
+ #end if
+
+ output
+
+ fot.list
+ font.list
+ > $result &&
+ tar -cvzf output.tar.gz output
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 000000000000 -r 814eed3d4f3e test-data/S_typhi_CT18_chromosome.fa
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/S_typhi_CT18_chromosome.fa Thu Apr 11 04:51:28 2019 -0400
@@ -0,0 +1,101 @@
+>AL513382 Salmonella enterica subsp. enterica serovar Typhi str. CT18, complete chromosome first 100 lines
+AGAGATTACGTCTGGTTGCAAGAGATCATAACAGGGGAAATTGATTGAAAATAAATATAT
+CGCCAGCAGCACATGAACAAGTTTCGGAATGTGATCAATTTAAAAATTTATTGACTTAGG
+CGGGCAGATACTTTAACCAATATAGGAATACAAGACAGACAAATAAAAATGACAGAGTAC
+ACAACATCCATGAACCGCATCAGCACCACCACCATTACCACCATCACCATTACCACAGGT
+AACGGTGCGGGCTGACGCGTACAGGAAACACAGAAAAAAGCCCGCACCTGAACAGTGCGG
+GCTTTTTTTTCGACCAGAGATCACGAGGTAACAACCATGCGAGTGTTGAAGTTCGGCGGT
+ACATCAGTGGCAAATGCAGAACGTTTTCTGCGTGTTGCCGATATTCTGGAAAGCAATTCC
+AGGCAAGGGCAGGTAGCGACCGTACTTTCCGCCCCCGCGAAAATTACCAACCATCTGGTG
+GCGATGATTGAAAAAACTATCGGCGGCCAGGATGCTTTGCCGAATATCAGCGATGCCGAA
+CGTATTTTTTCTGACCTGCTCGCAGGACTTGCCAGCGCGCAGCCGGGATTCCCGCTTGCA
+CGGTTGAAAATGGTTGTCGAACAAGAATTCGCTCAGATCAAACATGTTTTGCATGGTATC
+AGCCTGCTGGGTCAGTGCCCGGATAGCATCAACGCCGCGCTGATTTGCCGTGGCGAAAAA
+ATGTCGATCGCGATTATGGCGGGACTCCTGGAGGCGCGTGGACATCGCGTCACGGTGATC
+GATCCGGTAGAAAAACTGCTGGCGGTGGGCCATTACCTTGAATCTACCGTCGATATCGCG
+GAATCGACTCGCCGTATCGCCGCCAGCCAGATCCCGGCCGATCACATGATCCTGATGGCG
+GGCTTTACTGCCGGTAATGAAAAGGGTGAACTGGTGGTGCTGGGCCGTAATGGTTCCGAC
+TATTCCGCCGCCGTGCTGGCCGCCTGTTTACGCGCTGACTGCTGTGAAATCTGGACTGAC
+GTCGATGGCGTGTATACCTGTGACCCGCGCCAGGTGCCGGACGCCAGGCTGTTGAAATCG
+ATGTCCTACCAGGAAGCGATGGAGCTCTCTTACTTCGGCGCTAAAGTCCTTCACCCTCGC
+ACCATAACGCCTATCGCCCAGTTCCAGATCCCCTGTCTGATTAAAAATACCGGCAATCCG
+CAGGCGCCAGGAACGCTGATCGGCGCGTCCAGCGACGATGATAATCTGCCGGTTAAAGGG
+ATCTCTAACCTTAACAACATGGCGATGTTTAGCGTCTCCGGCCCGGGAATGAAAGGGATG
+ATTGGGATGGCGGCGCGTGTTTTCGCCGCCATGTCTCGCGCCGGGATCTCGGTGGTGCTC
+ATTACCCAGTCCTCCTCTGAGTACAGCATCAGCTTCTGTGTGCCGCAGAGTGACTGCGCG
+CGTGCCCGCCGTGCGATGCAGGATGAGTTCTATCTGGAGCTGAAAGAGGGGCTGCTGGAG
+CCGCTGGCGGTTACGGAGCGGTTGGCGATTATCTCTGTTGTCGGCGACGGTATGCGCACG
+CTACGCGGCATTTCAGCGAAATTCTTCGCCGCGCTGGCGCGGGCTAATATCAATATCGTG
+GCGATCGCTCAGGGATCTTCTGAGCGTTCCATTTCTGTGGTGGTGAATAACGACGATGCC
+ACCACCGGCGTGCGGGTAACGCACCAGATGCTGTTCAATACCGATCAGGTGATTGAAGTG
+TTTGTCATTGGCGTCGGCGGCGTCGGCGGCGCGCTACTGGAACAGCTTAAACGTCAGCAA
+ACCTGGCTGAAGAACAAGCACATCGATCTACGCGTGTGCGGCGTGGCGAACTCAAAGGCG
+TTGCTAACCAATGTGCATGGCCTGAATCTGGACAACTGGCAGGCGGAACTGGCGCAAGCG
+AACGCGCCGTTCAATCTGGGACGTTTAATTCGCCTGGTGAAAGAATATCATCTACTCAAT
+CCGGTGATTGTTGATTGTACCTCCAGTCAGGCGGTGGCCGACCAGTATGCCGACTTCCTG
+CGCGAAGGGTTCCATGTGGTGACGCCGAACAAGAAAGCGAACACCTCGTCGATGGACTAC
+TACCATCAGCTACGTTTCGCCGCCGCGCAATCACGGCGCAAATTCTTGTATGACACCAAC
+GTCGGCGCCGGTTTGCCGGTAATCGAAAACCTGCAAAACCTGCTGAATGCGGGTGATGAA
+CTGCAAAAATTTTCCGGCATTCTTTCCGGGTCGCTCTCTTTTATTTTCGGTAAACTGGAA
+GAGGGGATGAGTCTCTCACAGGCGACCGCTCTGGCGCGCGAGATGGGCTATACCGAACCC
+GATCCGCGCGACGATCTTTCCGGTATGGATGTGGCGCGTAAACTGTTGATCCTCGCCCGC
+GAGACGGGCCGCGAGCTGGAGCTTTCCGATATCGTGATTGAACCGGTGTTGCCGGACGAG
+TTTGACGCCTCCGGCGATGTGACCGCCTTTATGGCGCATCTGCCGCAGCTTGACGACGCG
+TTTGCCGCCCGTGTGGCGAAAGCTCGTGATGAAGGTAAGGTATTGCGCTATGTGGGCAAT
+ATCGAAGAGGATGGCGTGTGCCGCGTGAAGATTGCCGAAGTTGATGGTAACGATCCGCTC
+TTCAAAGTGAAAAACGGTGAAAACGCGCTGGCGTTCTACAGCCATTATTATCAGCCCTTG
+CCGTTGGTGCTGCGCGGCTACGGCGCAGGCAATGATGTGACGGCGGCGGGCGTGTTTGCC
+GATCTGTTACGGACCCTCTCATGGAAGTTAGGAGTTTAACATGGTGAAAGTGTATGCCCC
+GGCTTCCAGCGCGAACATGAGCGTCGGTTTCGACGTGTTGGGCGCGGCCGTCACACCCGT
+TGACGGCACGTTGCTGGGCGATGTGGTATCCGTTGAAGCAGCGGATCATTTCCGTCTGCA
+TAACCTGGGGCGATTTGCCGATAAACTGCCGCCGGAGCCGCGTGAAAATATTGT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ATGCTGACGCATATCAGCGGCGATAAACCGGTGACGATTCTGACCGCAACGTCAGGCGA
+TACCGGCGCGGCGGTGGCTCACGCGTTCTATGGCCTGGAAAATGTGCGGGTCGTCATTCT
+CTACCCGCGCGGTAAAATCAGTCCGTTGCAGGAAAAACTGTTCTGTACGCTGGGCGGCAA
+CATTGAGACCGTGGCGATCGACGGCGATTTCGACGCTTGCCAGGCGCTGGTGAAACAGGC
+ATTTGATGACGAAGAACTGAAAACGGCGCTGGGGTTGAATTCGGCTAATTCGATTAATAT
+CAGCCGCCTGCTGGCGCAAATTTGCTACTACTTTGAAGCCGTGGCGCAACTGCCGCAGGG
+GGCGCGTAACCAACTGGTGATCTCCGTACCCAGCGGCAACTTTGGCGATTTGACGGCAGG
+ACTGCTGGCGAAGTCGTTAGGCCTACCGGTGAAACGCTTTATCGCCGCCACCAACATTAA
+CGATACGGTGCCGCGTTTTCTGCATGACGGGAAGTGGGCGCCAAAAGCGACGCAGGCGAC
+CCTGTCGAATGCGATGGATGTCAGCCAGCCGAATAACTGGCCGCGTGTGGAGGAGCTATT
+CCGCCGTAAAATCTGGCGTCTGACTGAGCTGGGCTATGCGGCGGTGGATGACACTACGAC
+ACAACAGACGATGCGCGAGCTGAAAGCGAAAGGTTATATCTCGGAACCTCATGCGGCGGT
+AGCGTATCGGGCATTACGCGACCAGTTAAACCCTGGCGAGTATGGCTTGTTTCTCGGAAC
+GGCGCATCCGGCGAAGTTTAAAGAAAGCGTGGAGTCCATTCTGGGAGAAACGCTGGCATT
+GCCTGAAGCGCTCGCCGAACGCGCCGATCTGCCGTTGCTTTCACATCATCTGCCTGCGGA
+TTTTGCCGCCCTGCGTAAGCTAATGATGACCCGCCAGTAACCATTGCGCCCGGTGGCGCT
+GTCGCTTACCGGGCCTATGGGGTGGTGCCGATTTGTAGGCCGGATAAGGCGTAACCGCCA
+TCCGGCGATGTCGTTACTGCTCGTAGCGTTTAAAGACCAGCTCGTCTTGTGTGGAGGTTT
+CTTCATCAAAGAAATACCCTTCACGGTCAAACGCGGTAAGCTGTTCCGGCTTCGTTAAGC
+GGTTTTCAATAATAAAACGACTCATCAGTCCGCGCGCTTTTTTGGCGTAGAAGCTTACCA
+CCTTAAACTTGCCGTTTTTCTCATCAAGGAATACGGGCTTAATCAGTTCGGCATCCAGTT
+TCTTCGGCTTCACCGATTTAAAATATTCCTCGGAGGCCAGATTCACCACCACCCGATCGC
+CCTGCGCCTCAAGCGCTTCGTTGAGCTTATCGGTAATGATATCGCCCCAGAATTGATAAA
+GATCTTTGCCGCGCGGATTCTCCAGGCGAATCCCCATCTCCAGACGATAAGGCTGCATTA
+AATCCAGCGGGCGCAATACGCCATACAAGCCAGAGAGCATACGCAGATGTTGTTGAGCAA
+AATCAAAATCCGCGTCGTTGAACGTTTCCGCCTGTAGGCCGGTATAAACATCGCCTTTGA
+ACGCCAGAATCGCCTGGCGTGCATTATCCGGCGTAAAATGAGGCTGCCAGTCATGAAAAC
+GCGTGGCGTTGAGATCCGCCAGTTTGTCGCTAATTCCCATTAGCCTGGAAATTTGCGGCG
+CCGAAAGCTGGCGGGCCTGTTGAATAAGCTGCTGGCTGTGATCCAACAGCTCCGGCTGGG
+TATAGCGGGTCGTGGCCAGCGGGCTTTGATAATCAAGCGTTTTTGCAGGTGAAATCAGAA
+TCAGCATATCCAGTCCTTGCAGGGAATTTTCTGCGACTTTAGCAAAAAAACGCCGCAGAG
+TTGACCGATGGTTGCGATTGTCGGCTTAATCGCGCGATGCCGCATCCCAGGTATCTGGCG
diff -r 000000000000 -r 814eed3d4f3e test-data/S_typhi_CT18_chromosome_1.fastq.gz
Binary file test-data/S_typhi_CT18_chromosome_1.fastq.gz has changed
diff -r 000000000000 -r 814eed3d4f3e test-data/S_typhi_CT18_chromosome_2.fastq.gz
Binary file test-data/S_typhi_CT18_chromosome_2.fastq.gz has changed
diff -r 000000000000 -r 814eed3d4f3e test-data/S_typhi_CT18_chromosome_pHCM2_1.fastq.gz
Binary file test-data/S_typhi_CT18_chromosome_pHCM2_1.fastq.gz has changed
diff -r 000000000000 -r 814eed3d4f3e test-data/S_typhi_CT18_chromosome_pHCM2_2.fastq.gz
Binary file test-data/S_typhi_CT18_chromosome_pHCM2_2.fastq.gz has changed
diff -r 000000000000 -r 814eed3d4f3e test-data/fasta_nontraits.csv
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/fasta_nontraits.csv Thu Apr 11 04:51:28 2019 -0400
@@ -0,0 +1,1 @@
+S_typhi_CT18_chromosome.fa
diff -r 000000000000 -r 814eed3d4f3e test-data/nontraits.csv
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/nontraits.csv Thu Apr 11 04:51:28 2019 -0400
@@ -0,0 +1,1 @@
+S_typhi_CT18_chromosome_1.fastq.gz,S_typhi_CT18_chromosome_2.fastq.gz
diff -r 000000000000 -r 814eed3d4f3e test-data/result.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/result.txt Thu Apr 11 04:51:28 2019 -0400
@@ -0,0 +1,1 @@
+output/spades_S_typhi_CT18_chromosome_pHCM2/filtered_scaffolds.fasta
diff -r 000000000000 -r 814eed3d4f3e test-data/traits.csv
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/traits.csv Thu Apr 11 04:51:28 2019 -0400
@@ -0,0 +1,1 @@
+S_typhi_CT18_chromosome_pHCM2_1.fastq.gz,S_typhi_CT18_chromosome_pHCM2_2.fastq.gz
diff -r 000000000000 -r 814eed3d4f3e tidy.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tidy.py Thu Apr 11 04:51:28 2019 -0400
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+
+import sys
+import os
+# from pathlib import Path
+
+
+def make_list(tmp_file, lst_file):
+ dividers = ["_1", "_F", "_R1", "_2", "_R", "_R2"]
+ with open(tmp_file, "r") as fh:
+ lines = fh.readlines()
+ _lines = []
+ processed_list = []
+ for i in range(0,len(lines)):
+ if (os.path.splitext(lines[i].strip())[-1] == ".fasta") or (os.path.splitext(lines[i].strip())[-1] == ".fa"):
+ _lines.append(lines[i].strip())
+ else:
+ file_name = os.path.basename(lines[i])
+ if file_name not in processed_list:
+ detected_devider = [div for div in dividers if div in file_name]
+ if len(detected_devider) > 0:
+ detected_devider = detected_devider[0]
+ new_file_name = file_name.split(detected_devider)[0]
+ for j in range(i+1, len(lines)):
+ if new_file_name in lines[j]:
+ paired = "{},{}".format(lines[i].strip(), lines[j].strip())
+ _lines.append(paired)
+ processed_list.append(file_name)
+ # else:
+ # _lines.append(lines[i].strip())
+
+ with open(lst_file,"w") as fh:
+ for _line in _lines:
+ fh.writelines("{}\n".format(_line))
+
+if __name__ == "__main__":
+ tmp_file = sys.argv[1]
+ lst_file = sys.argv[2]
+ make_list(tmp_file, lst_file)