Commit message:
planemo upload for repository https://github.com/quadram-institute-bioscience/galaxy-tools/tree/master/tools/plasmidtron commit d2ae53b6ee23d56d26e9add8fe5ade2e20e75b87-dirty |
added:
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 |
b |
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 |
b |
@@ -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 |
b |
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 |
[ |
b'@@ -0,0 +1,98 @@\n+<tool id="plasmidtron" name="plasmidtron" version="@VERSION@">\n+ <description>A tool to assemble parts of a genome responsible for a trait</description>\n+ <macros>\n+ <import>macros.xml</import>\n+ </macros>\n+ <expand macro="requirements" />\n+ <expand macro="version_command" />\n+\n+ <command detect_errors="exit_code"><![CDATA[\n+ #for $counter, $input in enumerate($fot_list):\n+ #set $new_name = $input.element_identifier\n+ ln -sf \'$input\' ./$new_name &&\n+ echo ./$new_name >> fot.tmp &&\n+ #end for\n+ python $__tool_directory__/tidy.py fot.tmp fot.list &&\n+\n+ #for $counter, $input in enumerate($font_list):\n+ #set $new_name = $input.element_identifier\n+ ln -sf \'$input\' ./$new_name &&\n+ echo ./$new_name >> font.tmp &&\n+ #end for \n+ python $__tool_directory__/tidy.py font.tmp font.list &&\n+\n+ plasmidtron \n+ --action $opt_args.action\n+ #if $opt_args.keep_files\n+ $opt_args.keep_files\n+ #end if\n+ --kmer $opt_args.kmer\n+ --min_contig_len $opt_args.min_contig_len\n+ --min_spades_contig_coverage $opt_args.min_spades_contig_coverage\n+ --max_spades_contig_coverage $opt_args.max_spades_contig_coverage\n+ --min_kmers_threshold $opt_args.min_kmers_threshold\n+ --max_kmers_threshold $opt_args.max_kmers_threshold\n+ --min_kmers_per_read $opt_args.min_kmers_per_read\n+ #if $opt_args.match_both_pairs\n+ $opt_args.match_both_pairs\n+ #end if\n+ --plot_filename $opt_args.plot_filename\n+ --threads $opt_args.threads\n+ #if $opt_args.verbose\n+ $opt_args.verbose\n+ #end if\n+\n+ output\n+\n+ fot.list\n+ font.list \n+ > $result &&\n+ tar -cvzf output.tar.gz output\n+ ]]></command>\n+\n+ <inputs>\n+ <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" />\n+ <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" />\n+ <section name="opt_args" title="Optional Arguments">\n+ <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.">\n+ <option value="intersection">intersection</option>\n+ <option value="union" selected="True">union</option>\n+ </param>\n+ <param name="keep_files" argument="--keep_files" type="boolean" truevalue="--keep_files" falsevalue="" checked="False" label="Keep intermediate files" help="(Default: NO)" />\n+ <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'..b'ead coverage, so a contig with 10X kmer coverage from SPAdes actually has 20X read coverage. Set to 0 to keep\n+ all (Default: 5)" />\n+ <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\n+ all (Default: 5)" />\n+ <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)" />\n+ <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)" />\n+ <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)" />\n+ <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)" />\n+ <param name="plot_filename" argument="--plot_filename" type="text" value="kmerplot.png" label="Kmer to use, depends on read length" help="(Default: kmerplot.png)" /> \n+ <param name="threads" argument="--threads" type="integer" value="1" label="Number of threads" help="(Default: 1)" />\n+ <param name="verbose" argument="--verbose" type="boolean" truevalue="--verbose" falsevalue="" checked="False" label="Turn on debugging" help="(Default: NO)" />\n+ </section>\n+ </inputs>\n+\n+ <outputs>\n+ <data name="result" format="txt" label="${tool.name} on ${on_string}: Result" />\n+ <data name="output_tar" format="tar.gz" label="Plasmidtron Output Compressed (tar.gz) file" from_work_dir="output.tar.gz" />\n+ </outputs>\n+\n+ <tests>\n+ <test>\n+ <param name="fot_list" value="S_typhi_CT18_chromosome_pHCM2_1.fastq.gz,S_typhi_CT18_chromosome_pHCM2_2.fastq.gz" ftype="fastq.gz" />\n+ <param name="font_list" value="S_typhi_CT18_chromosome_1.fastq.gz,S_typhi_CT18_chromosome_2.fastq.gz" ftype="fastq.gz" />\n+ <output name="result" file="result.txt" ftype="txt" />\n+ </test>\n+ </tests>\n+\n+\n+ <help><![CDATA[\n+ usage: plasmidtron [options] output_directory file_of_traits file_of_nontraits\n+\n+ A tool to assemble parts of a genome responsible for a trait\n+ ]]></help>\n+ <expand macro="citations" />\n+</tool>\n' |
b |
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 |
b |
@@ -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 |
b |
diff -r 000000000000 -r 814eed3d4f3e test-data/S_typhi_CT18_chromosome_1.fastq.gz |
b |
Binary file test-data/S_typhi_CT18_chromosome_1.fastq.gz has changed |
b |
diff -r 000000000000 -r 814eed3d4f3e test-data/S_typhi_CT18_chromosome_2.fastq.gz |
b |
Binary file test-data/S_typhi_CT18_chromosome_2.fastq.gz has changed |
b |
diff -r 000000000000 -r 814eed3d4f3e test-data/S_typhi_CT18_chromosome_pHCM2_1.fastq.gz |
b |
Binary file test-data/S_typhi_CT18_chromosome_pHCM2_1.fastq.gz has changed |
b |
diff -r 000000000000 -r 814eed3d4f3e test-data/S_typhi_CT18_chromosome_pHCM2_2.fastq.gz |
b |
Binary file test-data/S_typhi_CT18_chromosome_pHCM2_2.fastq.gz has changed |
b |
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 |
b |
@@ -0,0 +1,1 @@ +S_typhi_CT18_chromosome.fa |
b |
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 |
b |
@@ -0,0 +1,1 @@ +S_typhi_CT18_chromosome_1.fastq.gz,S_typhi_CT18_chromosome_2.fastq.gz |
b |
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 |
b |
@@ -0,0 +1,1 @@ +output/spades_S_typhi_CT18_chromosome_pHCM2/filtered_scaffolds.fasta |
b |
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 |
b |
@@ -0,0 +1,1 @@ +S_typhi_CT18_chromosome_pHCM2_1.fastq.gz,S_typhi_CT18_chromosome_pHCM2_2.fastq.gz |
b |
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) |