Move wiggle_to_interval out of GALAXY_LIB_TOOLS_UNVERSIONED

This commit is contained in:
mvdbeek
2020-02-12 09:47:36 +01:00
parent 2549715563
commit c05a9af4c8
5 changed files with 31 additions and 61 deletions
@@ -11,40 +11,20 @@ import sys
import bx.wiggle
from galaxy.util import unicodify
from galaxy.util.ucsc import (
UCSCLimitException,
UCSCOutWrapper
)
def stop_err(msg):
sys.stderr.write(msg)
sys.exit(1)
def main():
if len(sys.argv) > 1:
in_file = open(sys.argv[1])
else:
in_file = open(sys.stdin)
if len(sys.argv) > 2:
out_file = open(sys.argv[2], "w")
else:
out_file = sys.stdout
try:
for fields in bx.wiggle.IntervalReader(UCSCOutWrapper(in_file)):
out_file.write("%s\n" % "\t".join(map(str, fields)))
except UCSCLimitException:
# Wiggle data was truncated, at the very least need to warn the user.
print('Encountered message from UCSC: "Reached output limit of 100000 data values", so be aware your data was truncated.')
except ValueError as e:
stop_err(unicodify(e))
finally:
in_file.close()
out_file.close()
with open(sys.argv[1]) as in_file, open(sys.argv[2], "w") as out_file:
try:
for fields in bx.wiggle.IntervalReader(UCSCOutWrapper(in_file)):
out_file.write("%s\n" % "\t".join(map(str, fields)))
except UCSCLimitException:
# Wiggle data was truncated, at the very least need to warn the user.
sys.stderr.write('Encountered message from UCSC: "Reached output limit of 100000 data values", so be aware your data was truncated.')
if __name__ == "__main__":
@@ -1,6 +1,10 @@
<tool id="CONVERTER_wiggle_to_interval_0" name="Wiggle to Interval" version="1.0.0">
<tool id="CONVERTER_wiggle_to_interval_0" name="Wiggle to Interval" version="1.0.1" profile="16.04">
<!-- <description>__NOT_USED_CURRENTLY_FOR_CONVERTERS__</description> -->
<!-- Used on the metadata edit page. -->
<requirements>
<requirement type="package" version="19.09">galaxy-util</requirement>
<requirement type="package" version="0.8.6">bx-python</requirement>
</requirements>
<command>python '$__tool_directory__/wiggle_to_simple_converter.py' '$input' '$out_file1'</command>
<inputs>
<param format="wig" name="input" type="data" label="Convert"/>
+2 -2
View File
@@ -143,7 +143,6 @@ GALAXY_LIB_TOOLS_UNVERSIONED = [
"MAF_split_blocks_by_species1",
"MAF_Limit_To_Species1",
"maf_by_block_number1",
"wiggle2simple1",
# Converters
"CONVERTER_bed_to_fli_0",
"CONVERTER_fastq_to_fqtoc0",
@@ -151,7 +150,6 @@ GALAXY_LIB_TOOLS_UNVERSIONED = [
"CONVERTER_gff_to_interval_index_0",
"CONVERTER_maf_to_fasta_0",
"CONVERTER_maf_to_interval_0",
"CONVERTER_wiggle_to_interval_0",
"CONVERTER_tar_to_directory",
# Tools improperly migrated to the tool shed (devteam)
"qualityFilter",
@@ -191,6 +189,8 @@ GALAXY_LIB_TOOLS_VERSIONED = {
"vcf_to_maf_customtrack1": packaging.version.parse("1.0.1"),
"secure_hash_message_digest": packaging.version.parse("0.0.2"),
"join1": packaging.version.parse("2.1.3"),
"wiggle2simple1": packaging.version.parse("1.0.1"),
"CONVERTER_wiggle_to_interval_0": packaging.version.parse("1.0.1"),
}
+11 -29
View File
@@ -10,38 +10,20 @@ import sys
import bx.wiggle
from galaxy.util.ucsc import UCSCLimitException, UCSCOutWrapper
def stop_err(msg):
sys.stderr.write(msg)
sys.exit()
from galaxy.util.ucsc import (
UCSCLimitException,
UCSCOutWrapper
)
def main():
if len(sys.argv) > 1:
in_file = open(sys.argv[1])
else:
in_file = open(sys.stdin)
if len(sys.argv) > 2:
out_file = open(sys.argv[2], "w")
else:
out_file = sys.stdout
try:
for fields in bx.wiggle.IntervalReader(UCSCOutWrapper(in_file)):
out_file.write("%s\n" % "\t".join(map(str, fields)))
except UCSCLimitException:
# Wiggle data was truncated, at the very least need to warn the user.
print('Encountered message from UCSC: "Reached output limit of 100000 data values", so be aware your data was truncated.')
except ValueError as e:
in_file.close()
out_file.close()
stop_err(str(e))
in_file.close()
out_file.close()
with open(sys.argv[1]) as in_file, open(sys.argv[2], "w") as out_file:
try:
for fields in bx.wiggle.IntervalReader(UCSCOutWrapper(in_file)):
out_file.write("%s\n" % "\t".join(map(str, fields)))
except UCSCLimitException:
# Wiggle data was truncated, at the very least need to warn the user.
sys.stderr.write('Encountered message from UCSC: "Reached output limit of 100000 data values", so be aware your data was truncated.')
if __name__ == "__main__":
+6 -2
View File
@@ -1,6 +1,10 @@
<tool id="wiggle2simple1" name="Wiggle-to-Interval" version="1.0.0">
<tool id="wiggle2simple1" name="Wiggle-to-Interval" version="1.0.1" profile="16.04">
<description>converter</description>
<command interpreter="python">wiggle_to_simple.py $input $out_file1 </command>
<requirements>
<requirement type="package" version="19.09">galaxy-util</requirement>
<requirement type="package" version="0.8.6">bx-python</requirement>
</requirements>
<command>python '$__tool_directory__/wiggle_to_simple.py' '$input' '$out_file1'</command>
<inputs>
<param format="wig" name="input" type="data" label="Convert"/>
</inputs>