Skip to content

Commit a87e2cd

Browse files
author
Dominik R Laetsch
committed
Fix
- generate_kinfin_input.py now technically also can deal with multiline FASTAs
1 parent 081e94a commit a87e2cd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/generate_kinfin_input.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ def parse_fasta_dir(self):
7676

7777
def parse_fasta_f(self, fasta_f, species_idx):
7878
seq_count = 0
79-
for seq_idx, line in enumerate(read_file(fasta_f)):
79+
for line in read_file(fasta_f):
8080
if line and line[0] == '>':
81-
seq_count += 1
8281
header = line[1:].split()[0]
8382
if self.orthofinder_flag:
8483
header = header.replace(":", "_").replace(",", "_").replace("(", "_").replace(")", "_")
85-
self.sequence_id_lines.append("%s_%s: %s" % (species_idx, seq_idx, header))
84+
self.sequence_id_lines.append("%s_%s: %s" % (species_idx, seq_count, header))
85+
seq_count += 1
8686
print "[+] \t %s sequences parsed" % (seq_count)
8787

8888
def write_files(self):

0 commit comments

Comments
 (0)