# HG changeset patch # User greg # Date 1509371554 14400 # Node ID 3e10a2683769965bbaee0121daaa9075b93f6628 # Parent 8ec75782a05b5b14d993bdfc0b1fe02748491f7e Uploaded diff -r 8ec75782a05b -r 3e10a2683769 .shed.yml --- a/.shed.yml Thu Aug 24 13:26:35 2017 -0400 +++ b/.shed.yml Mon Oct 30 09:52:34 2017 -0400 @@ -9,7 +9,7 @@ utilize objective classifications of complete protein sequences from sequenced plant genomes to perform comparative evolutionary studies. This tool classifies gene sequences into precomputed orthologous gene family clusters using either blastp (faster), HMMScan (slower but more sensitive to remote homologs) or both (more exhaustive). -remote_repository_url: https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/plant_tribes/gene_family_classifier +remote_repository_url: https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/phylogenetics/plant_tribes/gene_family_classifier type: unrestricted categories: - Phylogenetics diff -r 8ec75782a05b -r 3e10a2683769 gene_family_classifier.py --- a/gene_family_classifier.py Thu Aug 24 13:26:35 2017 -0400 +++ b/gene_family_classifier.py Mon Oct 30 09:52:34 2017 -0400 @@ -24,12 +24,6 @@ parser.add_argument('--coding_sequences', dest='coding_sequences', default=None, help='Flag to create orthogroup coding sequences') parser.add_argument('--save_hmmscan_log', dest='save_hmmscan_log', default=None, help='Flag to save the hmmscan log') parser.add_argument('--hmmscan_log', dest='hmmscan_log', default=None, help='hmmscan log file') -parser.add_argument('--output_ptortho', dest='output_ptortho', default=None, help='Output for orthogroups') -parser.add_argument('--output_ptortho_dir', dest='output_ptortho_dir', default=None, help='output_ptortho.files_path') -parser.add_argument('--output_ptorthocs', dest='output_ptorthocs', default=None, help='Output for orthogroups with corresponding coding sequences') -parser.add_argument('--output_ptorthocs_dir', dest='output_ptorthocs_dir', default=None, help='output_ptorthocs.files_path') -parser.add_argument('--output_ptsco', dest='output_ptsco', default=None, help='Output for single copy orthogroups') -parser.add_argument('--output_ptsco_dir', dest='output_ptsco_dir', default=None, help='output_ptsco.files_path') args = parser.parse_args() @@ -74,22 +68,18 @@ # Handle orthogroups outputs. if create_ortho_sequences: - if create_corresponding_coding_sequences: - out_file = args.output_ptorthocs - orthogroups_fasta_dest_dir = args.output_ptorthocs_dir - title = 'Orthogroups and corresponding coding sequences files' - else: - out_file = args.output_ptortho - orthogroups_fasta_dest_dir = args.output_ptortho_dir - title = 'Orthogroups files' orthogroups_fasta_src_dir = os.path.join(OUTPUT_DIR, 'orthogroups_fasta') - utils.move_directory_files(orthogroups_fasta_src_dir, orthogroups_fasta_dest_dir) - utils.write_html_output(out_file, title, orthogroups_fasta_dest_dir) + orthogroups_fasta_dest_dir = 'output_orthogroups_fasta_dir' + if not os.path.isdir(orthogroups_fasta_dest_dir): + os.makedirs(orthogroups_fasta_dest_dir) + # Remove source direrctory so it won't break dataset collection handler. + utils.move_directory_files(orthogroups_fasta_src_dir, orthogroups_fasta_dest_dir, remove_source_dir=True) # Handle single copy orthogroup outputs. -if args.output_ptsco is not None: +if args.single_copy_custom is not None or args.single_copy_taxa != 0: single_copy_fasta_src_dir = os.path.join(OUTPUT_DIR, 'single_copy_fasta') - single_copy_fasta_dest_dir = args.output_ptsco_dir - title = 'Single copy orthogroups files' - utils.move_directory_files(single_copy_fasta_src_dir, single_copy_fasta_dest_dir) - utils.write_html_output(args.output_ptsco, title, single_copy_fasta_dest_dir) + single_copy_fasta_dest_dir = 'output_single_copy_fasta_dir' + if not os.path.isdir(single_copy_fasta_dest_dir): + os.makedirs(single_copy_fasta_dest_dir) + # Remove source direrctory so it won't break dataset collection handler. + utils.move_directory_files(single_copy_fasta_src_dir, single_copy_fasta_dest_dir, remove_source_dir=True) diff -r 8ec75782a05b -r 3e10a2683769 gene_family_classifier.xml --- a/gene_family_classifier.xml Thu Aug 24 13:26:35 2017 -0400 +++ b/gene_family_classifier.xml Mon Oct 30 09:52:34 2017 -0400 @@ -1,9 +1,11 @@ - + classifies gene sequences into pre-computed orthologous gene family clusters macros.xml - + + plant_tribes_gene_family_classifier + @@ -206,24 +193,19 @@ - + save_hmmscan_log_cond['classifier'] in ['hmmscan', 'both'] and save_hmmscan_log_cond['save_hmmscan_log'] == 'yes' - - options_type['options_type_selector'] == 'advanced' and options_type['create_orthogroup_cond']['create_orthogroup'] == 'yes' and options_type['create_orthogroup_cond']['create_corresponding_coding_sequences_cond']['create_corresponding_coding_sequences'] == 'no' - - - options_type['options_type_selector'] == 'advanced' and options_type['create_orthogroup_cond']['create_orthogroup'] == 'yes' and options_type['create_orthogroup_cond']['create_corresponding_coding_sequences_cond']['create_corresponding_coding_sequences'] == 'yes' - - + + + + + + options_type['options_type_selector'] == 'advanced' and options_type['create_orthogroup_cond']['create_orthogroup'] == 'yes' + + + options_type['options_type_selector'] == 'advanced' and options_type['create_orthogroup_cond']['create_orthogroup'] == 'yes' and options_type['specify_single_copy_cond']['specify_single_copy'] == 'yes' - - - - - - - @@ -235,8 +217,8 @@ - - + + @@ -244,6 +226,20 @@ + + + + + + + + + + + + + + diff -r 8ec75782a05b -r 3e10a2683769 macros.xml --- a/macros.xml Thu Aug 24 13:26:35 2017 -0400 +++ b/macros.xml Mon Oct 30 09:52:34 2017 -0400 @@ -1,47 +1,6 @@ 1.0 - - - plant_tribes_assembly_post_processor - - - - - plant_tribes_gene_family_aligner - - - - - plant_tribes_gene_family_classifier - - - - - plant_tribes_gene_family_integrator - - - - - plant_tribes_kaks_analysis - - - - - r-optparse - - - - - plant_tribes_gene_family_phylogeny_builder - - - - - - - - @@ -49,74 +8,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @misc{None, diff -r 8ec75782a05b -r 3e10a2683769 test-data/20.faa --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/20.faa Mon Oct 30 09:52:34 2017 -0400 @@ -0,0 +1,3 @@ +>contig_9 +XLRLKADEEAQCLNQMQRIIFDEIMEHVELEKGGFYFVYRPGGNGKTLWLAIISKLRSEGRIVLAVASSGIALLLVEGGR +TAHSRFKIPIDVNEYNNCEIKQNIYLAELICHTNLVIWDEAPMTQYFVFEAVX diff -r 8ec75782a05b -r 3e10a2683769 test-data/20.fna --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/20.fna Mon Oct 30 09:52:34 2017 -0400 @@ -0,0 +1,6 @@ +>contig_9 +NNACTTCGGTTAAAGGCAGATGAGGAGGCACAATGTTTGAATCAGATGCAGCGTATCATTTTTGATGAAATTATGGAGCA +TGTGGAGTTAGAAAAGGGGGGCTTCTATTTCGTATATCGCCCTGGGGGCAACGGAAAGACCTTGTGGTTGGCTATTATCT +CAAAACTGAGAAGCGAGGGTAGAATAGTTCTCGCAGTGGCTTCATCAGGTATAGCATTGCTTTTGGTTGAGGGTGGTAGA +ACAGCCCATTCTCGATTTAAAATACCCATAGATGTCAATGAATATAACAATTGTGAAATTAAACAGAACATCTACCTCGC +TGAACTTATATGTCACACCAATTTGGTCATTTGGGATGAGGCACCTATGACTCAATATTTTGTCTTTGAGGCGGTTGAN diff -r 8ec75782a05b -r 3e10a2683769 test-data/3494.faa --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/3494.faa Mon Oct 30 09:52:34 2017 -0400 @@ -0,0 +1,3 @@ +>contig_10 +MAEENTTTMNLDLNLGPINNSSDDSEPSSRPYTDVAMNLEDWLDSPVRVREVVRHRNHRWRSLWRQIPIPPDTRNLALEL +IGGNAP diff -r 8ec75782a05b -r 3e10a2683769 test-data/3494.fna --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/3494.fna Mon Oct 30 09:52:34 2017 -0400 @@ -0,0 +1,5 @@ +>contig_10 +ATGGCAGAAGAGAACACCACTACAATGAACCTCGATCTCAATTTGGGCCCCATCAATAACTCAAGCGACGATAGCGAACC +TTCATCACGCCCTTATACTGATGTCGCAATGAACTTGGAAGATTGGTTAGATAGTCCCGTCCGAGTTCGTGAAGTCGTCC +GCCACAGAAATCATAGGTGGCGCTCTTTGTGGCGCCAAATCCCAATTCCGCCTGATACGCGAAACCTCGCGCTCGAATTA +ATCGGCGGCAATGCCCCN diff -r 8ec75782a05b -r 3e10a2683769 test-data/3722.faa --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/3722.faa Mon Oct 30 09:52:34 2017 -0400 @@ -0,0 +1,3 @@ +>contig_7 +ENEWSGAEFLNEMAAMMTQNKSNENGTGTFEELQQLFDEMFQSDIESFNGCSSSSNETCSNSNKRNSIESSSANFRPENG +NESGEISGKKNTRKGKGDX diff -r 8ec75782a05b -r 3e10a2683769 test-data/3722.fna --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/3722.fna Mon Oct 30 09:52:34 2017 -0400 @@ -0,0 +1,5 @@ +>contig_7 +GAGAATGAGTGGTCTGGGGCTGAGTTTTTGAATGAAATGGCGGCAATGATGACTCAAAATAAATCCAATGAAAACGGAAC +CGGAACTTTTGAAGAACTGCAACAATTGTTCGATGAAATGTTTCAGAGCGACATCGAGTCCTTCAATGGTTGTTCTTCAT +CATCCAATGAAACATGTAGCAACTCGAACAAGAGGAATTCCATTGAGTCGAGCTCGGCTAATTTCAGACCCGAAAATGGA +AACGAAAGCGGCGAGATTAGCGGGAAGAAGAATACTAGGAAAGGTAAAGGTGACGNN diff -r 8ec75782a05b -r 3e10a2683769 test-data/38889.faa --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/38889.faa Mon Oct 30 09:52:34 2017 -0400 @@ -0,0 +1,4 @@ +>contig_2 +XLSKVPIPSNNIYAINDKKSPEDAADDYENRLKELVSEKIIPVSTISGFPKFDLMLLGMGPDGHVASLFPSHMQRYEKEK +WVTFITDSPKPPPSRITFTFPMINSASEIAMVVTGADLAGTTKIALGTTGNVKPGETPLPCTEVSAEGEVTWFLDKDAAS +QLLNYVRFDD diff -r 8ec75782a05b -r 3e10a2683769 test-data/38889.fna --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/38889.fna Mon Oct 30 09:52:34 2017 -0400 @@ -0,0 +1,8 @@ +>contig_2 +NNCCTTTCCAAGGTACCCATCCCATCCAACAACATATATGCTATAAATGATAAGAAGTCCCCGGAAGATGCAGCAGACGA +CTACGAAAACCGCCTCAAGGAACTCGTCTCCGAAAAAATCATACCCGTTTCAACCATTAGCGGGTTCCCGAAGTTCGACC +TCATGTTGCTTGGAATGGGGCCCGACGGCCATGTGGCCTCTCTTTTCCCTTCTCACATGCAACGCTATGAGAAGGAGAAA +TGGGTCACTTTCATAACTGACTCTCCCAAACCGCCTCCGTCGAGAATCACTTTTACGTTTCCGATGATCAACTCGGCTTC +GGAGATCGCTATGGTGGTTACCGGGGCTGATTTGGCTGGTACAACTAAGATAGCATTGGGTACTACGGGCAATGTTAAGC +CGGGTGAGACTCCTTTGCCTTGTACTGAAGTTTCGGCTGAGGGAGAGGTTACTTGGTTCTTGGACAAAGATGCTGCTTCA +CAACTGTTAAATTATGTGCGCTTTGATGAT diff -r 8ec75782a05b -r 3e10a2683769 test-data/39614.faa --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/39614.faa Mon Oct 30 09:52:34 2017 -0400 @@ -0,0 +1,3 @@ +>contig_3 +XVDEGVVVAGLSEQEKASVSEILTTARAHSETIENLKRDHSQQVSCIEQHTNDTFRQKYMDYEPTGSTPVRSEPDIPSKG +TIESLRAMPIDALEEEFRENHSYESAVTGKELMPSVTTRAPFSQIN diff -r 8ec75782a05b -r 3e10a2683769 test-data/39614.fna --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/39614.fna Mon Oct 30 09:52:34 2017 -0400 @@ -0,0 +1,6 @@ +>contig_3 +NNTGTGGATGAAGGAGTTGTTGTTGCTGGCTTGTCAGAGCAGGAGAAGGCATCTGTTTCTGAAATTCTGACAACTGCTAG +AGCTCATTCAGAAACAATTGAGAACCTTAAGAGAGATCATTCCCAGCAGGTATCCTGTATCGAACAGCACACGAATGATA +CTTTCAGGCAAAAATACATGGATTACGAGCCTACAGGGTCCACGCCAGTTAGGAGCGAGCCGGATATTCCCAGCAAAGGC +ACAATAGAGTCACTTCGTGCCATGCCTATAGATGCACTTGAAGAAGAATTTCGAGAAAACCATTCATACGAATCTGCTGT +TACAGGAAAGGAACTAATGCCGTCTGTTACGACTCGTGCACCATTTTCACAGATCAAC diff -r 8ec75782a05b -r 3e10a2683769 test-data/5235.faa --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/5235.faa Mon Oct 30 09:52:34 2017 -0400 @@ -0,0 +1,3 @@ +>contig_1 +XKKLYGDKEDILVPDIFWDYTSGKVLTMEWVEGVKLNEQDAVESQGLSVLDLVNTGIQCSLRQLLEYGYFHADPHPGNLL +ATPDGKLAFLDFGMMSETPEQARSAIIGHVVHMVNR diff -r 8ec75782a05b -r 3e10a2683769 test-data/5235.fna --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/5235.fna Mon Oct 30 09:52:34 2017 -0400 @@ -0,0 +1,6 @@ +>contig_1 +NTTAAAAAATTATATGGAGACAAGGAAGATATCCTTGTCCCAGATATTTTCTGGGATTACACGAGTGGAAAGGTGCTAAC +AATGGAGTGGGTTGAAGGTGTTAAATTAAATGAGCAAGATGCCGTTGAGAGTCAAGGGCTCAGTGTTCTGGATCTGGTGA +ATACCGGCATACAGTGCAGTCTTCGACAGCTGCTTGAGTACGGCTATTTTCATGCAGATCCTCACCCAGGGAATCTCTTA +GCTACACCTGACGGGAAGCTTGCTTTTCTTGATTTTGGAATGATGAGTGAGACTCCTGAACAAGCAAGATCGGCCATAAT +TGGTCATGTTGTACACATGGTTAATCGN diff -r 8ec75782a05b -r 3e10a2683769 test-data/output.ptorthocs --- a/test-data/output.ptorthocs Thu Aug 24 13:26:35 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -

Orthogroups and corresponding coding sequences files: 12 items

-

-Datasets - - - - - - - - - - - - -
20.faa -
20.fna -
3494.faa -
3494.fna -
3722.faa -
3722.fna -
38889.faa -
38889.fna -
39614.faa -
39614.fna -
5235.faa -
5235.fna -
diff -r 8ec75782a05b -r 3e10a2683769 utils.py --- a/utils.py Thu Aug 24 13:26:35 2017 -0400 +++ b/utils.py Mon Oct 30 09:52:34 2017 -0400 @@ -27,7 +27,7 @@ return fstderr, fherr, fstdout, fhout -def move_directory_files(source_dir, destination_dir, copy=False): +def move_directory_files(source_dir, destination_dir, copy=False, remove_source_dir=False): source_directory = os.path.abspath(source_dir) destination_directory = os.path.abspath(destination_dir) if not os.path.isdir(destination_directory): @@ -38,6 +38,8 @@ shutil.copy(source_entry, destination_directory) else: shutil.move(source_entry, destination_directory) + if remove_source_dir: + os.rmdir(source_directory) def run_command(cmd): @@ -52,29 +54,3 @@ def stop_err(msg): sys.exit(msg) - - -def write_html_output(output, title, dir): - with open(output, 'w') as fh: - dir_items = sorted(os.listdir(dir)) - # Directories can only contain either files or directories, - # but not both. - if len(dir_items) > 0: - item_path = os.path.join(dir, dir_items[0]) - if os.path.isdir(item_path): - header = 'Directories' - else: - header = 'Datasets' - else: - header = '' - fh.write('

%s: %d items

\n' % (title, len(dir_items))) - fh.write('

\n') - fh.write('%s\n' % header) - for index, fname in enumerate(dir_items): - if index % 2 == 0: - bgcolor = '#D8D8D8' - else: - bgcolor = '#FFFFFF' - link = '%s\n' % (fname, fname) - fh.write('\n' % (bgcolor, link)) - fh.write('
%s
\n')