Codebase list ariba / db1f8f0
New upstream version 2.9.3+ds Sascha Steinbiss 7 years ago
4 changed file(s) with 30 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
00 import tempfile
1 import re
12 import time
23 import os
34 import shutil
7879 def _rename_seqs_in_fasta(cls, infile, outfile):
7980 f = pyfastaq.utils.open_file_write(outfile)
8081 file_reader = pyfastaq.sequences.file_reader(infile)
82 nodot_regex = re.compile(r'^.*(?P<separator>[^.0-9])[0-9]+$')
8183
8284 for seq in file_reader:
83 seq.id = seq.id.replace('_', '.').replace('-', '.')
85 if seq.id.startswith('Oxf.'):
86 seq.id = 'Oxf_' + seq.id[4:]
87
88 regex_match = nodot_regex.match(seq.id)
89 if regex_match is not None:
90 seq.id = '.'.join(seq.id.rsplit(regex_match.groupdict()['separator'], maxsplit=1))
91
8492 print(seq, file=f)
8593
8694 pyfastaq.utils.close(f)
33 AAAA
44 >gene.3
55 CCCC
6 >foo_gene.4
7 TTTT
8 >Oxf_gltA.42
9 A
10 >Oxf_gltA.43
11 C
12 >Oxf_gltA.44
13 G
14 >Oxf_gltA.45
15 T
33 AAAA
44 >gene.3
55 CCCC
6 >foo_gene.4
7 TTTT
8 >Oxf.gltA.42
9 A
10 >Oxf.gltA-43
11 C
12 >Oxf.gltA_44
13 G
14 >Oxf.gltA?45
15 T
5454 setup(
5555 ext_modules=[minimap_mod, fermilite_mod, vcfcall_mod],
5656 name='ariba',
57 version='2.9.2',
57 version='2.9.3',
5858 description='ARIBA: Antibiotic Resistance Identification By Assembly',
5959 packages = find_packages(),
6060 package_data={'ariba': ['test_run_data/*']},