From eac0ff9d7f867b4bea10ed5772f8f1c789124b31 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 7 Feb 2020 09:49:26 +0100 Subject: [PATCH 01/10] Fix vcf_to_maf_customtrack --- lib/galaxy/tools/__init__.py | 2 +- tools/maf/vcf_to_maf_customtrack.py | 2 +- tools/maf/vcf_to_maf_customtrack.xml | 14 +++++++++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index fdb9b1209d3..f3d65ba6e67 100755 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -127,7 +127,6 @@ GALAXY_LIB_TOOLS_UNVERSIONED = [ "send_to_cloud", "__DATA_FETCH__", # Legacy tools bundled with Galaxy. - "vcf_to_maf_customtrack1", "laj_1", "secure_hash_message_digest", "join1", @@ -191,6 +190,7 @@ GALAXY_LIB_TOOLS_VERSIONED = { "PEsortedSAM2readprofile": packaging.version.parse("1.1.1"), "sam_to_bam": packaging.version.parse("1.1.3"), "sam_pileup": packaging.version.parse("1.1.3"), + "vcf_to_maf_customtrack1": packaging.version.parse("1.0.1"), } diff --git a/tools/maf/vcf_to_maf_customtrack.py b/tools/maf/vcf_to_maf_customtrack.py index 5c7a2bce376..73b7e2387b9 100644 --- a/tools/maf/vcf_to_maf_customtrack.py +++ b/tools/maf/vcf_to_maf_customtrack.py @@ -77,7 +77,7 @@ def main(): if not (options.population ^ options.sample): parser.error('You must specify either a per population conversion or a per sample conversion, but not both') - out = open(args.pop(0), 'wb') + out = open(args.pop(0), 'w') out.write('track name="%s" visibility=pack\n' % options.name.replace("\"", "'")) maf_writer = bx.align.maf.Writer(out) diff --git a/tools/maf/vcf_to_maf_customtrack.xml b/tools/maf/vcf_to_maf_customtrack.xml index c10618ac41e..69f535755e0 100644 --- a/tools/maf/vcf_to_maf_customtrack.xml +++ b/tools/maf/vcf_to_maf_customtrack.xml @@ -1,5 +1,9 @@ - + for display at UCSC + + galaxy_sequence_utils + bx-python + macros.xml @@ -43,21 +47,21 @@ ${vcf_source_type.vcf_source} -n '$track_name' - + **What it does** From af4fdf7e1f77a0e73ee81b67517b44db5c747e59 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 7 Feb 2020 18:06:42 +0100 Subject: [PATCH 02/10] Drop __next__ --- tools/maf/vcf_to_maf_customtrack.py | 60 +++++++++++++---------------- 1 file changed, 26 insertions(+), 34 deletions(-) diff --git a/tools/maf/vcf_to_maf_customtrack.py b/tools/maf/vcf_to_maf_customtrack.py index 73b7e2387b9..5b89907c5e1 100644 --- a/tools/maf/vcf_to_maf_customtrack.py +++ b/tools/maf/vcf_to_maf_customtrack.py @@ -13,51 +13,43 @@ UNKNOWN_NUCLEOTIDE = '*' class PopulationVCFParser(Iterator): def __init__(self, reader, name): - self.reader = reader + self.reader = iter(reader) self.name = name self.counter = 0 - def __next__(self): - rval = [] - vc = next(self.reader) - for i, allele in enumerate(vc.alt): - rval.append(('%s_%i.%i' % (self.name, i + 1, self.counter + 1), allele)) - self.counter += 1 - return (vc, rval) - def __iter__(self): - while True: - yield next(self) + for vc in self.reader: + rval = [] + for i, allele in enumerate(vc.alt): + rval.append(('%s_%i.%i' % (self.name, i + 1, self.counter + 1), allele)) + self.counter += 1 + yield (vc, rval) class SampleVCFParser(Iterator): def __init__(self, reader): - self.reader = reader + self.reader = iter(reader) self.counter = 0 - def __next__(self): - rval = [] - vc = next(self.reader) - alleles = [vc.ref] + vc.alt - - if 'GT' in vc.format: - gt_index = vc.format.index('GT') - for sample_name, sample_value in zip(vc.sample_names, vc.sample_values): - gt_indexes = [] - for i in sample_value[gt_index].replace('|', '/').replace('\\', '/').split('/'): # Do we need to consider phase here? - try: - gt_indexes.append(int(i)) - except Exception: - gt_indexes.append(None) - for i, allele_i in enumerate(gt_indexes): - if allele_i is not None: - rval.append(('%s_%i.%i' % (sample_name, i + 1, self.counter + 1), alleles[allele_i])) - self.counter += 1 - return (vc, rval) - def __iter__(self): - while True: - yield next(self) + for vc in self.reader: + rval = [] + alleles = [vc.ref] + vc.alt + + if 'GT' in vc.format: + gt_index = vc.format.index('GT') + for sample_name, sample_value in zip(vc.sample_names, vc.sample_values): + gt_indexes = [] + for i in sample_value[gt_index].replace('|', '/').replace('\\', '/').split('/'): # Do we need to consider phase here? + try: + gt_indexes.append(int(i)) + except Exception: + gt_indexes.append(None) + for i, allele_i in enumerate(gt_indexes): + if allele_i is not None: + rval.append(('%s_%i.%i' % (sample_name, i + 1, self.counter + 1), alleles[allele_i])) + self.counter += 1 + yield (vc, rval) def main(): From 7d166eb24d737fbce10747d3b7178e99c349cfee Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 7 Feb 2020 18:06:55 +0100 Subject: [PATCH 03/10] Bump version and add profile --- tools/maf/vcf_to_maf_customtrack.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/maf/vcf_to_maf_customtrack.xml b/tools/maf/vcf_to_maf_customtrack.xml index 69f535755e0..39b97ebe761 100644 --- a/tools/maf/vcf_to_maf_customtrack.xml +++ b/tools/maf/vcf_to_maf_customtrack.xml @@ -1,7 +1,7 @@ - + for display at UCSC - galaxy_sequence_utils + galaxy_sequence_utils bx-python From 1b7a36b2e4b19d8ff6af94a8d47852b8abff8fdd Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 7 Feb 2020 18:52:50 +0100 Subject: [PATCH 04/10] Move secure_hash_message_digest to GALAXY_LIB_TOOLS_VERSIONED And give it its own dependency. --- lib/galaxy/tools/__init__.py | 2 +- tools/filters/secure_hash_message_digest.xml | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index f3d65ba6e67..d9833cbcb59 100755 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -128,7 +128,6 @@ GALAXY_LIB_TOOLS_UNVERSIONED = [ "__DATA_FETCH__", # Legacy tools bundled with Galaxy. "laj_1", - "secure_hash_message_digest", "join1", "gff2bed1", "gff_filter_by_feature_count", @@ -191,6 +190,7 @@ GALAXY_LIB_TOOLS_VERSIONED = { "sam_to_bam": packaging.version.parse("1.1.3"), "sam_pileup": packaging.version.parse("1.1.3"), "vcf_to_maf_customtrack1": packaging.version.parse("1.0.1"), + "secure_hash_message_digest": packaging.version.parse("0.0.2"), } diff --git a/tools/filters/secure_hash_message_digest.xml b/tools/filters/secure_hash_message_digest.xml index e20ce80969a..50554c7181d 100644 --- a/tools/filters/secure_hash_message_digest.xml +++ b/tools/filters/secure_hash_message_digest.xml @@ -1,6 +1,10 @@ - + on a dataset - secure_hash_message_digest.py --input "${input1}" --output "${out_file1}" + + python + + + python '$__tool_directory__/secure_hash_message_digest.py' --input '${input1}' --output '${out_file1}' #if $algorithms.value: #for $algorithm in str( $algorithms ).split( "," ): --algorithm "${algorithm}" From 25497155631a9e177d16ed199fa964f368cb2dee Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 7 Feb 2020 19:48:50 +0100 Subject: [PATCH 05/10] Make join1 use proper requirements, move to GALAXY_LIB_TOOLS_VERSIONED --- lib/galaxy/tools/__init__.py | 2 +- tools/filters/joiner.xml | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index d9833cbcb59..b25397258d5 100755 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -128,7 +128,6 @@ GALAXY_LIB_TOOLS_UNVERSIONED = [ "__DATA_FETCH__", # Legacy tools bundled with Galaxy. "laj_1", - "join1", "gff2bed1", "gff_filter_by_feature_count", "aggregate_scores_in_intervals2", @@ -191,6 +190,7 @@ GALAXY_LIB_TOOLS_VERSIONED = { "sam_pileup": packaging.version.parse("1.1.3"), "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"), } diff --git a/tools/filters/joiner.xml b/tools/filters/joiner.xml index 642d1e8b429..a1fc30f18bf 100644 --- a/tools/filters/joiner.xml +++ b/tools/filters/joiner.xml @@ -1,15 +1,15 @@ - + side by side on a specified field - python + galaxy-util python '$__tool_directory__/join.py' '$input1' '$input2' $field1 $field2 '$out_file1' $unmatched $partial --index_depth=3 --buffer=50000000 --fill_options_file=$fill_options_file $header - <% + #set $__fill_options = {} #if $fill_empty_columns['fill_empty_columns_switch'] == 'fill_empty': #set $__fill_options['fill_unjoined_only'] = $fill_empty_columns['fill_columns_by'].value == 'fill_unjoined_only' @@ -30,7 +30,7 @@ import json #end if #end if ${json.dumps( __fill_options )} - + ]]> @@ -174,7 +174,7 @@ ${json.dumps( __fill_options )} - + Convert* ----- @@ -221,6 +221,6 @@ Joining the 4th column of Dataset1 with the 1st column of Dataset2, while keepin chr1 50 80 geneB geneB Foxp2 chr5 10 40 geneL - +]]> From c05a9af4c87b60f2eec2b98a88fa7348babffa2b Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Sun, 9 Feb 2020 11:49:46 +0100 Subject: [PATCH 06/10] Move wiggle_to_interval out of GALAXY_LIB_TOOLS_UNVERSIONED --- .../converters/wiggle_to_simple_converter.py | 34 ++++------------ .../converters/wiggle_to_simple_converter.xml | 6 ++- lib/galaxy/tools/__init__.py | 4 +- tools/filters/wiggle_to_simple.py | 40 +++++-------------- tools/filters/wiggle_to_simple.xml | 8 +++- 5 files changed, 31 insertions(+), 61 deletions(-) diff --git a/lib/galaxy/datatypes/converters/wiggle_to_simple_converter.py b/lib/galaxy/datatypes/converters/wiggle_to_simple_converter.py index ac965e105ae..b2c3229bc86 100644 --- a/lib/galaxy/datatypes/converters/wiggle_to_simple_converter.py +++ b/lib/galaxy/datatypes/converters/wiggle_to_simple_converter.py @@ -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__": diff --git a/lib/galaxy/datatypes/converters/wiggle_to_simple_converter.xml b/lib/galaxy/datatypes/converters/wiggle_to_simple_converter.xml index 29c494189ad..5befe7746dc 100644 --- a/lib/galaxy/datatypes/converters/wiggle_to_simple_converter.xml +++ b/lib/galaxy/datatypes/converters/wiggle_to_simple_converter.xml @@ -1,6 +1,10 @@ - + + + galaxy-util + bx-python + python '$__tool_directory__/wiggle_to_simple_converter.py' '$input' '$out_file1' diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index b25397258d5..66a58102a1a 100755 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -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"), } diff --git a/tools/filters/wiggle_to_simple.py b/tools/filters/wiggle_to_simple.py index f1fcf045c8f..d619a8dc3f7 100755 --- a/tools/filters/wiggle_to_simple.py +++ b/tools/filters/wiggle_to_simple.py @@ -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__": diff --git a/tools/filters/wiggle_to_simple.xml b/tools/filters/wiggle_to_simple.xml index 991ce655148..b4362369cae 100644 --- a/tools/filters/wiggle_to_simple.xml +++ b/tools/filters/wiggle_to_simple.xml @@ -1,6 +1,10 @@ - + converter - wiggle_to_simple.py $input $out_file1 + + galaxy-util + bx-python + + python '$__tool_directory__/wiggle_to_simple.py' '$input' '$out_file1' From 05e8117995801ee1ac201ffc33a76e59265f5f51 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Sun, 9 Feb 2020 11:59:30 +0100 Subject: [PATCH 07/10] Move aggregate_scores_in_intervals2 out of GALAXY_LIB_TOOLS_UNVERSIONED --- lib/galaxy/tools/__init__.py | 2 +- tools/maf/interval_maf_to_merged_fasta.py | 3 +-- tools/stats/aggregate_binned_scores_in_intervals.xml | 6 +++++- tools/stats/aggregate_scores_in_intervals.py | 3 +-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index 66a58102a1a..c65e80bef05 100755 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -130,7 +130,6 @@ GALAXY_LIB_TOOLS_UNVERSIONED = [ "laj_1", "gff2bed1", "gff_filter_by_feature_count", - "aggregate_scores_in_intervals2", "Interval_Maf_Merged_Fasta2", "GeneBed_Maf_Fasta2", "maf_stats1", @@ -191,6 +190,7 @@ GALAXY_LIB_TOOLS_VERSIONED = { "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"), + "aggregate_scores_in_intervals2": packaging.version.parse("1.1.4"), } diff --git a/tools/maf/interval_maf_to_merged_fasta.py b/tools/maf/interval_maf_to_merged_fasta.py index 54ad28a4156..6df4bc88cdf 100644 --- a/tools/maf/interval_maf_to_merged_fasta.py +++ b/tools/maf/interval_maf_to_merged_fasta.py @@ -35,8 +35,7 @@ from galaxy.tools.util import maf_utilities def stop_err(msg): - sys.stderr.write(msg) - sys.exit() + sys.exit(msg) def __main__(): diff --git a/tools/stats/aggregate_binned_scores_in_intervals.xml b/tools/stats/aggregate_binned_scores_in_intervals.xml index 7e204c8ef67..fa8e1d111d8 100644 --- a/tools/stats/aggregate_binned_scores_in_intervals.xml +++ b/tools/stats/aggregate_binned_scores_in_intervals.xml @@ -1,5 +1,9 @@ - + Appends the average, min, max of datapoints per interval + + galaxy-util + bx-python + python '$__tool_directory__/aggregate_scores_in_intervals.py' #if $score_source_type.score_source == "user" diff --git a/tools/stats/aggregate_scores_in_intervals.py b/tools/stats/aggregate_scores_in_intervals.py index 9c0cceba15b..2c5e8d7ad45 100755 --- a/tools/stats/aggregate_scores_in_intervals.py +++ b/tools/stats/aggregate_scores_in_intervals.py @@ -99,8 +99,7 @@ class FileBinnedArrayDir(Mapping): def stop_err(msg): - sys.stderr.write(msg) - sys.exit() + sys.exit(msg) def load_scores_wiggle(fname, chrom_buffer_size=3): From 418ca3d6cc6afef4b27e4f0fd8d34eff2311cd4d Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Sun, 9 Feb 2020 12:19:58 +0100 Subject: [PATCH 08/10] Use text mode in maf_utilites, set non-zero exit code I don't see any binary formats being handled here, but strings are being written to file handles in binary mode, so this should be correct. Would be great to move maf_utilities out so that tools can depend on this explicitly. --- lib/galaxy/datatypes/util/maf_utilities.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/galaxy/datatypes/util/maf_utilities.py b/lib/galaxy/datatypes/util/maf_utilities.py index 3a5aa531bb2..c013dc215da 100644 --- a/lib/galaxy/datatypes/util/maf_utilities.py +++ b/lib/galaxy/datatypes/util/maf_utilities.py @@ -58,8 +58,7 @@ def get_species_in_block(block): def tool_fail(msg="Unknown Error"): - print("Fatal Error: %s" % msg, file=sys.stderr) - sys.exit() + sys.exit("Fatal Error: %s" % msg) class TempFileHandler(object): @@ -103,11 +102,11 @@ class TempFileHandler(object): else: raise e tmp_file.close() - self.files.append(open(filename, 'w+b')) + self.files.append(open(filename, 'w')) else: while True: try: - self.files[index] = open(self.files[index].name, 'r+b') + self.files[index] = open(self.files[index].name, 'r') break except OSError as e: if self.open_file_indexes and e.errno == EMFILE: From 2297b6ffdfa2b0a0adad0e0ddce5cab622ddc1be Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Sun, 9 Feb 2020 12:35:25 +0100 Subject: [PATCH 09/10] Move CONVERTER_fastq_to_fqtoc0 out of GALAXY_LIB_TOOLS_UNVERSIONED --- .../datatypes/converters/fastq_to_fqtoc.py | 28 ++++++++----------- .../datatypes/converters/fastq_to_fqtoc.xml | 5 +++- lib/galaxy/tools/__init__.py | 2 +- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/lib/galaxy/datatypes/converters/fastq_to_fqtoc.py b/lib/galaxy/datatypes/converters/fastq_to_fqtoc.py index 5a90201de8f..f6cab4c12fe 100644 --- a/lib/galaxy/datatypes/converters/fastq_to_fqtoc.py +++ b/lib/galaxy/datatypes/converters/fastq_to_fqtoc.py @@ -20,30 +20,26 @@ def main(): """ input_fname = sys.argv[1] if is_gzip(input_fname): - print('Conversion is only possible for uncompressed files') - sys.exit(1) - - out_file = open(sys.argv[2], 'w') + sys.exit('Conversion is only possible for uncompressed files') current_line = 0 sequences = 1000000 lines_per_chunk = 4 * sequences chunk_begin = 0 - in_file = open(input_fname) + with open(input_fname) as in_file, open(sys.argv[2], 'w') as out_file: + out_file.write('{"sections" : [') - out_file.write('{"sections" : [') + for line in in_file: + current_line += 1 + if 0 == current_line % lines_per_chunk: + chunk_end = in_file.tell() + out_file.write('{"start":"%s","end":"%s","sequences":"%s"},' % (chunk_begin, chunk_end, sequences)) + chunk_begin = chunk_end - for line in in_file: - current_line += 1 - if 0 == current_line % lines_per_chunk: - chunk_end = in_file.tell() - out_file.write('{"start":"%s","end":"%s","sequences":"%s"},' % (chunk_begin, chunk_end, sequences)) - chunk_begin = chunk_end - - chunk_end = in_file.tell() - out_file.write('{"start":"%s","end":"%s","sequences":"%s"}' % (chunk_begin, chunk_end, (current_line % lines_per_chunk) / 4)) - out_file.write(']}\n') + chunk_end = in_file.tell() + out_file.write('{"start":"%s","end":"%s","sequences":"%s"}' % (chunk_begin, chunk_end, (current_line % lines_per_chunk) / 4)) + out_file.write(']}\n') if __name__ == "__main__": diff --git a/lib/galaxy/datatypes/converters/fastq_to_fqtoc.xml b/lib/galaxy/datatypes/converters/fastq_to_fqtoc.xml index d8bb8ad377f..7b039aa94b0 100644 --- a/lib/galaxy/datatypes/converters/fastq_to_fqtoc.xml +++ b/lib/galaxy/datatypes/converters/fastq_to_fqtoc.xml @@ -1,4 +1,7 @@ -