comparison mira.py @ 54:2bd1f1175fb2 draft

planemo upload for repository https://github.com/peterjc/pico_galaxy/tree/master/datatypes/mira_datatypes commit 206259620376b322fc8ed99a6efdd3712f38764b
author peterjc
date Wed, 11 Jul 2018 12:34:20 -0400
parents 94e05a9e3957
children
comparison
equal deleted inserted replaced
53:7f01823efdd5 54:2bd1f1175fb2
1 """ 1 """MiraAssemblyFormat class for the 'mira' format within Galaxy."""
2 MiraAssemblyFormat class for the 'mira' format within Galaxy
3 """
4 2
5 from galaxy.datatypes.data import Text 3 from galaxy.datatypes.data import Text
6 4
7 5
8 class MiraAssemblyFormat(Text): 6 class MiraAssemblyFormat(Text):
9 """MIRA Assembly Format data""" 7 """MIRA Assembly Format data."""
8
10 file_ext = "mira" 9 file_ext = "mira"
11 10
12 def sniff(self, filename): 11 def sniff(self, filename):
13 """Determines whether the file is a MIRA Assembly Format file. 12 """Determine if the file is a MIRA Assembly Format file.
14 13
15 Note currently this only detects MIRA Assembly Format v2.0, 14 Note currently this only detects MIRA Assembly Format v2.0,
16 as used in MIRA v3.9 and v4.0. 15 as used in MIRA v3.9 and v4.0.
17 16
18 It does not detect MIRA Assembly Format v1 as used in both 17 It does not detect MIRA Assembly Format v1 as used in both
28 h.close() 27 h.close()
29 return False 28 return False
30 return True 29 return True
31 30
32 def merge(split_files, output_file): 31 def merge(split_files, output_file):
33 """Merging multiple MIRA files is non-trivial and may not be possible...""" 32 """Merge MIRA assembly files (not implemented).
33
34 Merging multiple MIRA files is non-trivial and may not be possible...
35 """
34 if len(split_files) == 1: 36 if len(split_files) == 1:
35 # For one file only, use base class method (move/copy) 37 # For one file only, use base class method (move/copy)
36 return Text.merge(split_files, output_file) 38 return Text.merge(split_files, output_file)
37 if not split_files: 39 if not split_files:
38 raise ValueError("Given no MIRA, %r, to merge into %s" 40 raise ValueError("Given no MIRA, %r, to merge into %s"