changeset 0:814eed3d4f3e draft default tip

planemo upload for repository https://github.com/quadram-institute-bioscience/galaxy-tools/tree/master/tools/plasmidtron commit d2ae53b6ee23d56d26e9add8fe5ade2e20e75b87-dirty
author thanhlv
date Thu, 11 Apr 2019 04:51:28 -0400
parents
children
files macros.xml plasmidtron.xml test-data/S_typhi_CT18_chromosome.fa test-data/S_typhi_CT18_chromosome_1.fastq.gz test-data/S_typhi_CT18_chromosome_2.fastq.gz test-data/S_typhi_CT18_chromosome_pHCM2_1.fastq.gz test-data/S_typhi_CT18_chromosome_pHCM2_2.fastq.gz test-data/fasta_nontraits.csv test-data/nontraits.csv test-data/result.txt test-data/traits.csv tidy.py
diffstat 12 files changed, 260 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /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 @@
+<macros>
+    <token name="@VERSION@">0.4.1</token>
+    <xml name="requirements">
+        <requirements>
+            <requirement type="package" version="@VERSION@">plasmidtron</requirement>
+        </requirements>
+    </xml>
+
+    <xml name="version_command">
+        <version_command>plasmidtron --version</version_command>
+    </xml>
+
+    <xml name="citations">
+        <citations>
+            <citation type="doi">10.1099/mgen.0.000164</citation>
+        </citations>
+    </xml>
+</macros>
\ No newline at end of file
--- /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 @@
+<tool id="plasmidtron" name="plasmidtron" version="@VERSION@">
+    <description>A tool to assemble parts of a genome responsible for a trait</description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <expand macro="requirements" />
+    <expand macro="version_command" />
+
+    <command detect_errors="exit_code"><![CDATA[
+        #for $counter, $input in enumerate($fot_list):
+            #set $new_name = $input.element_identifier
+            ln -sf '$input' ./$new_name &&
+            echo  ./$new_name >> 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
+    ]]></command>
+
+    <inputs>
+    <param name="fot_list" type="data" format="fasta,fasta.gz,fastq,fastq.gz,fastqsanger.gz,fastqsanger" multiple="true" label="Files of trait (case) FASTQs"  help="Select multiple files including fasta file, PE files, single fastq file for creating a file of file name of case" />
+    <param name="font_list" type="data" format="fasta,fasta.gz,fastq,fastq.gz,fastqsanger.gz,fastqsanger" multiple="true" label="Files of nontrait (control) FASTQs" help="Select multiple files including fasta file, PE files, single fastq file for creating a file of file name of control" />
+    <section name="opt_args" title="Optional Arguments">
+        <param name="action" argument="--action" type="select" label="Action" help="There are two fundamental methods of operation. The default is 'union', where kmers which occur in ANY trait sample, but are absent from the nontrait samples, get used to filter the reads. So in effect you are assembling the whole accessory genome of the trait samples. This leads to larger end assemblies and more false positives, but will capture greater regions of the accessory genome. It is tolerant to situations where you have a plasmid which can vary substantially with different backbones or payloads. The next is 'intersection', where kmers must occur in ALL trait samples and not in the nontrait samples. This leads to smaller end assemblies and more fragmentation, with less false positives. It is less tolerant to variation.">
+            <option value="intersection">intersection</option>
+            <option value="union" selected="True">union</option>
+        </param>
+        <param name="keep_files" argument="--keep_files" type="boolean" truevalue="--keep_files" falsevalue="" checked="False" label="Keep intermediate files" help="(Default: NO)" />
+        <param name="kmer" argument="--kmer" type="integer" value="51" label="Kmer to use, depends on read length" help="Choosing a kmer is not an exact science, and have greatly influence the final results. This kmer size is used by KMC for counting and filtering, and by SPAdes for assembly. Ideally it should be between about 50-90% of the read length, should be an odd number and between 21 and 127 (SPAdes restriction). If choose a kmer which is too small, you will get a lot more false positives. If you choose a kmer too big, you will use a lot more RAM and potentially get too little data returned. Quite often with Illumina data the beginning and end of the reads have higher sequencing error rates. Ideally you want a kmer size which sits nicely inside the good cycles of the read. Trimming with Trimmomatic can help if the quality collapses quite badly at the end of the read. (Default: 51)" />
+        <param name="min_contig_len" argument="--min_contig_len" type="integer" value="300" label="Minimum contig length in final assembly" help="This needs to be larger than the mean fragment size (insert size) of your library to reduce the impact of false positives. For example if you have a single kmer which randomly occurs in the genome, using it will then allow for reads upstream and downstream, plus their mates, to be assembled. This variable can control this noise. Setting this too high will lead to valuable information being lost (e.g. small plasmids) and a more fragmented assembly. (Default: 300)" />
+        <param name="min_spades_contig_coverage" argument="--min_spades_contig_coverage" type="integer" value="5" label="Filter out contigs with low coverage" help="Filter out contigs with less than this kmer coverage in the SPAdes assemblies. This gets applied at the end of each SPAdes assembly, and filters out some of the noise. If your input data is lower coverage you may need to reduce this value but the defaults are sensible. The kmer coverage value produced by SPAdes is half the read coverage, so a contig with 10X kmer coverage from SPAdes actually has 20X read coverage. Set to 0 to keep
+                        all (Default: 5)" />
+        <param name="max_spades_contig_coverage" argument="--max_spades_contig_coverage" type="integer" value="500" label="Filter out contigs with high coverage" help="Set to 0 to keep
+                        all (Default: 5)" />
+        <param name="min_kmers_threshold" argument="--min_kmers_threshold" type="integer" value="10" label="Exclude k-mers occurring less than this" help="This value lets you set a minimum threshold for the occurance of a kmer. Ideally you need at least 20X depth of coverage to perform de novo assembly. This value defaults to 10, since kmers below this level wont produce a good assembly, thus reducing false positives. The maximum value is 254, but the results are poor unless you have insane coverage (like virus data). (Default: 10)" />
+        <param name="max_kmers_threshold" argument="--max_kmers_threshold" type="integer" value="254" label="Exclude k-mers occurring more than this" help="This value lets you set a maximum threshold for the occurance of a kmer. The occurance of kmers forms a Poisson distribution, with a very long tail. With KMC, there is a catchall bin for occurances of 255 and greater (so 255 is the maximum value). By default it is set to 254 which excludes this catchall bin for kmers, and thus the long tail of very common kmers. This reduces the false positives. You need to be careful when setting this lower because you could exclude all of the interesting kmers. (Default: 254)" />
+        <param name="min_kmers_per_read" argument="--min_kmers_per_read" type="float" value="0.1" label="Min percentage kmer coverage of read to keep it" help="When filtering reads for an assembly, controls how much of the read must be covered by kmers for the assembly. Set it to 1 to require 100% of the read to be covered by trait kmers to be used in an assembly. The formula is: kmers_needed = ((read - kmer_length) + 1)*min_kmers_per_read. (Default: 0.1)" />
+        <param name="match_both_pairs" argument="--match_both_pairs" type="boolean" truevalue="--match_both_pairs" falsevalue="" checked="False" label="Match both pairs to keep them in assembly" help="When filtering kmers, you can choose to require kmers are found on both forward and reverse, or just on one of the reads, to consider it for assembly. By default only one of the reads needs to match. Requiring both reads to match will reduce the noise, but also lead to a more fragmented, shorter, assembly. (Default: NO)" />
+        <param name="plot_filename" argument="--plot_filename" type="text" value="kmerplot.png" label="Kmer to use, depends on read length" help="(Default: kmerplot.png)" /> 
+        <param name="threads" argument="--threads" type="integer" value="1" label="Number of threads" help="(Default: 1)" />
+        <param name="verbose" argument="--verbose" type="boolean" truevalue="--verbose" falsevalue="" checked="False" label="Turn on debugging" help="(Default: NO)" />
+    </section>
+     </inputs>
+
+    <outputs>
+        <data name="result" format="txt"  label="${tool.name} on ${on_string}: Result" />
+        <data name="output_tar" format="tar.gz" label="Plasmidtron Output Compressed (tar.gz) file" from_work_dir="output.tar.gz" />
+    </outputs>
+
+    <tests>
+    <test>
+        <param name="fot_list" value="S_typhi_CT18_chromosome_pHCM2_1.fastq.gz,S_typhi_CT18_chromosome_pHCM2_2.fastq.gz" ftype="fastq.gz" />
+        <param name="font_list" value="S_typhi_CT18_chromosome_1.fastq.gz,S_typhi_CT18_chromosome_2.fastq.gz" ftype="fastq.gz" />
+        <output name="result" file="result.txt" ftype="txt" />
+    </test>
+    </tests>
+
+
+    <help><![CDATA[
+        usage: plasmidtron [options] output_directory file_of_traits file_of_nontraits
+
+        A tool to assemble parts of a genome responsible for a trait
+    ]]></help>
+     <expand macro="citations" />
+</tool>
--- /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
+TAACCTGGGGCGATTTGCCGATAAACTGCCGCCGGAGCCGCGTGAAAATATTGTTTATCA
+GTGCTGGGAACGTTTTTGCCAGGCATTGGGGAAAACCATCCCGGTGGCGATGACGCTGGA
+AAAAAATATGCCGATTGGTTCCGGGTTAGGGTCCAGCGCCTGTTCCGTCGTCGCCGCGCT
+GGTCGCGATGAATGAGCACTGCGGCAAACCGTTAAACGACACGCGTCTGTTGGCGCTGAT
+GGGCGAGCTGGAAGGCCGTATCTCCGGCAGCATCCATTACGATAACGTCGCGCCGTGCTT
+TCTTGGCGGTATGCAGTTGATGATTGAAGAAAACGGCATTATTAGTCAGCAGGTGCCGGG
+CTTTGATGAGTGGCTATGGGTACTGGCTTATCCGGGCATTAAAGTTTCCACCGCAGAAGC
+ACGGGCCATTTTGCCTGCGCAGTATCGCCGTCAGGATTGCATTGCGCATGGACGGCATCT
+GGCCGGTTTTATTCACGCCTGTTACTCGCGGCAGCCGCAGCTTGCCGCCGCGCTGATGAA
+AGATGTTATTGCCGAACCATACCGCGCGCGTTTACTGCCGGGCTTTAGCCAGGCGCGGCA
+GGCGGTGTCGGAGATCGGCGCGCTGGCGAGCGGGATTTCCGGATCGGGGCCGACGCTGTT
+TGCGCTATGCGATAAACCGGAGACGGCGCAGCGCGTCGCGGACTGGCTGAGCAAACATTA
+TCTGCAAAATCAGGAAGGCTTCGTTCATATTTGTCGGCTGGATACGGCGGGCGCACGAGT
+AGTGGGATAATCAATGAAACTCTATAATCTGAAAGACCATAATGAGCAGGTCAGCTTTGC
+GCAGGCCGTCACGCAAGGGCTGGGCAAACAGCAGGGACTTTTTTTTCCGCACGATCTGCC
+GGAGTTTAGCCTGACGGAAATTGATGAGATGCTCAACCAGGACTTTGTCAGCCGTAGCGC
+AAAGATCCTCTCGGCATTTATTGGCGATGAAATACCGCAGCAAATTCTGGAAGAGCGCGT
+CCGCGCGGCGTTTGCTTTCCCGGCGCCGGTAGCGCAGGTAGAAAGTGATGTCGGCTGCCT
+GGAGCTGTTCCATGGTCCGACGCTGGCCTTTAAAGACTTCGGCGGGCGTTTTATGGCGCA
+AATGCTGACGCATATCAGCGGCGATAAACCGGTGACGATTCTGACCGCAACGTCAGGCGA
+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
Binary file test-data/S_typhi_CT18_chromosome_1.fastq.gz has changed
Binary file test-data/S_typhi_CT18_chromosome_2.fastq.gz has changed
Binary file test-data/S_typhi_CT18_chromosome_pHCM2_1.fastq.gz has changed
Binary file test-data/S_typhi_CT18_chromosome_pHCM2_2.fastq.gz has changed
--- /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
--- /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
--- /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
--- /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
--- /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)