annotate check_interleaved.py @ 0:b7e4e1487fc6 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
author iuc
date Tue, 02 Dec 2025 09:26:16 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
1 """
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
2 Helper script to check if AMAS input files are interleaved.
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
3 """
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
4 import argparse
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
5 import re
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
6 import sys
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
7
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
8
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
9 def check_phylip_interleaved(filepath):
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
10 """Check if PHYLIP file is interleaved."""
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
11 with open(filepath, encoding='utf-8') as f:
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
12 # First line is header: ntax nchar
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
13 header = next(f).strip().split()
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
14 ntax = int(header[0])
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
15
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
16 for idx, line in enumerate(f, 1):
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
17 if line.strip():
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
18 if idx > ntax:
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
19 return True
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
20
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
21 return False
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
22
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
23
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
24 def check_nexus_interleaved(filepath):
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
25 """Check if NEXUS file is interleaved."""
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
26 in_data_block = False
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
27 in_matrix = False
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
28 ntax = None
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
29 seq_lines = 0
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
30
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
31 with open(filepath, encoding='utf-8') as f:
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
32 for line in f:
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
33 content = line.strip().lower()
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
34
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
35 if not content:
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
36 continue
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
37
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
38 if in_matrix:
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
39 if content == 'end;':
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
40 return seq_lines != ntax if ntax else False
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
41
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
42 if content != ';':
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
43 seq_lines += 1
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
44 if ntax and seq_lines > ntax:
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
45 return True
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
46 continue
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
47
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
48 if not in_data_block:
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
49 if content.startswith('begin'):
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
50 words = content.split()
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
51 if len(words) > 1 and (
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
52 words[1].startswith('data')
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
53 or words[1].startswith('characters')):
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
54 in_data_block = True
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
55 continue
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
56
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
57 if content.startswith('dimensions') and ntax is None:
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
58 match = re.search(r'ntax=(\d+)', content)
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
59 if match:
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
60 ntax = int(match.group(1))
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
61
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
62 elif content.startswith('format'):
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
63 if re.search(r'\binterleave(?:;|=yes;?)?\b', content):
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
64 return True
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
65
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
66 elif content.startswith('matrix'):
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
67 in_matrix = True
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
68
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
69 return False
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
70
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
71
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
72 def check_fasta_interleaved(filepath):
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
73 """FASTA files are not interleaved."""
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
74 return False
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
75
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
76
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
77 def main():
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
78 parser = argparse.ArgumentParser(
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
79 description='Check if AMAS input files are interleaved'
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
80 )
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
81 parser.add_argument('input_files', nargs='+', help='Input sequence files')
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
82 parser.add_argument('--format', required=True,
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
83 choices=['fasta', 'phylip', 'nexus'],
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
84 help='Input format')
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
85
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
86 args = parser.parse_args()
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
87
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
88 interleaved_status = []
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
89 for filepath in args.input_files:
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
90 if args.format == 'phylip':
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
91 is_interleaved = check_phylip_interleaved(filepath)
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
92 elif args.format == 'nexus':
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
93 is_interleaved = check_nexus_interleaved(filepath)
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
94 else:
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
95 is_interleaved = check_fasta_interleaved(filepath)
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
96
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
97 interleaved_status.append(is_interleaved)
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
98
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
99 interleaved_status = list(set(interleaved_status))
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
100 if len(interleaved_status) > 1:
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
101 raise Exception("Error: Input files are a mix of interleaved/sequential formats")
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
102
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
103 if interleaved_status[0]:
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
104 print(f"{args.format}-int")
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
105 else:
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
106 print(args.format)
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
107
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
108 return 0
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
109
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
110
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
111 if __name__ == '__main__':
b7e4e1487fc6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/amas commit 158ec0e635067d354c425baf14b95cb616fd93c4
iuc
parents:
diff changeset
112 sys.exit(main())