# HG changeset patch
# User earlhaminst
# Date 1497379387 14400
# Node ID 6c0373cc070f740874f6cebfd99623f512da58ea
# Parent 97c11d04cd4ca4074dd1aad1d4603b99b9c126bd
planemo upload for repository https://github.com/TGAC/earlham-galaxytools/tree/master/tools/replace_chromosome_names/ commit c8418d1d7657dacae7f81fe4aa0aba051873d4ad
diff -r 97c11d04cd4c -r 6c0373cc070f replace_chromosome_names.py
--- a/replace_chromosome_names.py Thu May 18 14:17:48 2017 -0400
+++ b/replace_chromosome_names.py Tue Jun 13 14:43:07 2017 -0400
@@ -32,9 +32,14 @@
line_cols = line.split('\t')
for col_to_map in cols_to_map:
old_value = line_cols[col_to_map]
- line_cols[col_to_map] = map_dict.get(old_value, old_value)
- mapped_line = '\t'.join(line_cols)
- print(mapped_line, file=args.output)
+ new_value = map_dict.get(old_value, '')
+ if not new_value:
+ print('%s has no valid mapping, skipping line: %s' % (old_value, line), file=sys.stderr)
+ break
+ line_cols[col_to_map] = new_value
+ else:
+ mapped_line = '\t'.join(line_cols)
+ print(mapped_line, file=args.output)
if __name__ == "__main__":
diff -r 97c11d04cd4c -r 6c0373cc070f replace_chromosome_names.xml
--- a/replace_chromosome_names.xml Thu May 18 14:17:48 2017 -0400
+++ b/replace_chromosome_names.xml Tue Jun 13 14:43:07 2017 -0400
@@ -28,6 +28,9 @@
+
+
+