# HG changeset patch # User cpt # Date 1652465012 0 # Node ID b4134ad44443ea75f8319537e92599810e78da6a Uploaded diff -r 000000000000 -r b4134ad44443 cpt_trnascanse_to_gff/cpt-macros.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpt_trnascanse_to_gff/cpt-macros.xml Fri May 13 18:03:32 2022 +0000 @@ -0,0 +1,115 @@ + + + + + python + biopython + requests + + + + + + + + 10.1371/journal.pcbi.1008214 + @unpublished{galaxyTools, + author = {E. Mijalis, H. Rasche}, + title = {CPT Galaxy Tools}, + year = {2013-2017}, + note = {https://github.com/tamu-cpt/galaxy-tools/} + } + + + + + 10.1371/journal.pcbi.1008214 + + @unpublished{galaxyTools, + author = {E. Mijalis, H. Rasche}, + title = {CPT Galaxy Tools}, + year = {2013-2017}, + note = {https://github.com/tamu-cpt/galaxy-tools/} + } + + + + + + + 10.1371/journal.pcbi.1008214 + + @unpublished{galaxyTools, + author = {C. Ross}, + title = {CPT Galaxy Tools}, + year = {2020-}, + note = {https://github.com/tamu-cpt/galaxy-tools/} + } + + + + + + + 10.1371/journal.pcbi.1008214 + + @unpublished{galaxyTools, + author = {E. Mijalis, H. Rasche}, + title = {CPT Galaxy Tools}, + year = {2013-2017}, + note = {https://github.com/tamu-cpt/galaxy-tools/} + } + + + @unpublished{galaxyTools, + author = {A. Criscione}, + title = {CPT Galaxy Tools}, + year = {2019-2021}, + note = {https://github.com/tamu-cpt/galaxy-tools/} + } + + + + + + + 10.1371/journal.pcbi.1008214 + + @unpublished{galaxyTools, + author = {A. Criscione}, + title = {CPT Galaxy Tools}, + year = {2019-2021}, + note = {https://github.com/tamu-cpt/galaxy-tools/} + } + + + + + + + 10.1371/journal.pcbi.1008214 + + @unpublished{galaxyTools, + author = {C. Maughmer}, + title = {CPT Galaxy Tools}, + year = {2017-2020}, + note = {https://github.com/tamu-cpt/galaxy-tools/} + } + + + + + + + @unpublished{galaxyTools, + author = {C. Maughmer}, + title = {CPT Galaxy Tools}, + year = {2017-2020}, + note = {https://github.com/tamu-cpt/galaxy-tools/} + } + + + + diff -r 000000000000 -r b4134ad44443 cpt_trnascanse_to_gff/macros.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpt_trnascanse_to_gff/macros.xml Fri May 13 18:03:32 2022 +0000 @@ -0,0 +1,66 @@ + + + + + python + biopython + cpt_gffparser + + + + + + + + + + + + + + + + + + + + + + + + + + + + "$gff3_data" + + +#if str($reference_genome.reference_genome_source) == 'cached': + "${reference_genome.fasta_indexes.fields.path}" +#else if str($reference_genome.reference_genome_source) == 'history': + genomeref.fa +#end if + + +#if $reference_genome.reference_genome_source == 'history': + ln -s $reference_genome.genome_fasta genomeref.fa; +#end if + + +#if str($reference_genome.reference_genome_source) == 'cached': + "${reference_genome.fasta_indexes.fields.path}" +#else if str($reference_genome.reference_genome_source) == 'history': + genomeref.fa +#end if + + + + + + + "$sequences" + + + + + diff -r 000000000000 -r b4134ad44443 cpt_trnascanse_to_gff/tRNAscan_to_gff_SE_format.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpt_trnascanse_to_gff/tRNAscan_to_gff_SE_format.py Fri May 13 18:03:32 2022 +0000 @@ -0,0 +1,38 @@ +#!/usr/bin/env python +import fileinput + +print ("##gff-version-3") +# process each trna in tsv file +metaLines = 0 +for trna in fileinput.input(): + if metaLines < 3: + metaLines += 1 + continue + cols_tsv = trna.split("\t") + if int(cols_tsv[2]) < int(cols_tsv[3]): + cols_gff = [ + cols_tsv[0].strip(), + "tRNAscan", + "tRNA", + cols_tsv[2].strip(), + cols_tsv[3].strip(), + cols_tsv[8], + "+", + ".", + 'ID=trna.%s;Anticodon=%s;Codon=tRNA-%s' + % (cols_tsv[1], cols_tsv[5].lower(), cols_tsv[4]), + ] + else: + cols_gff = [ + cols_tsv[0].strip(), + "tRNAscan", + "tRNA", + cols_tsv[3].strip(), + cols_tsv[2].strip(), + cols_tsv[8], + "-", + ".", + 'ID=trna.%s;Anticodon=%s;Codon=tRNA-%s' + % (cols_tsv[1], cols_tsv[5].lower(), cols_tsv[4]), + ] + print ("\t".join(cols_gff)) diff -r 000000000000 -r b4134ad44443 cpt_trnascanse_to_gff/tRNAscan_to_gff_SE_format.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpt_trnascanse_to_gff/tRNAscan_to_gff_SE_format.xml Fri May 13 18:03:32 2022 +0000 @@ -0,0 +1,35 @@ + + + + + macros.xml + cpt-macros.xml + + + $output +]]> + + + + + + + + + + + + + + + + diff -r 000000000000 -r b4134ad44443 cpt_trnascanse_to_gff/test-data/ConvTrnaSe_In.tabular --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpt_trnascanse_to_gff/test-data/ConvTrnaSe_In.tabular Fri May 13 18:03:32 2022 +0000 @@ -0,0 +1,4 @@ +Sequence tRNA Bounds tRNA Anti Intron Bounds Inf +Name tRNA # Begin End Type Codon Begin End Score Note +-------- ------ ----- ------ ---- ----- ----- ---- ------ ------ +NC_028755.1 1 49264 49339 Gly TCC 0 0 77.4 diff -r 000000000000 -r b4134ad44443 cpt_trnascanse_to_gff/test-data/ConvTrnaSe_Out.gff3 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpt_trnascanse_to_gff/test-data/ConvTrnaSe_Out.gff3 Fri May 13 18:03:32 2022 +0000 @@ -0,0 +1,2 @@ +##gff-version-3 +NC_028755.1 tRNAscan tRNA 49264 49339 77.4 + . ID=trna.1;Anticodon=tcc;Codon=tRNA-Gly