Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
- generate_kinfin_input.py now technically also can deal with multiline
FASTAs
  • Loading branch information
Dominik R Laetsch committed Jul 26, 2017
1 parent 081e94a commit a87e2cd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/generate_kinfin_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ def parse_fasta_dir(self):

def parse_fasta_f(self, fasta_f, species_idx):
seq_count = 0
for seq_idx, line in enumerate(read_file(fasta_f)):
for line in read_file(fasta_f):
if line and line[0] == '>':
seq_count += 1
header = line[1:].split()[0]
if self.orthofinder_flag:
header = header.replace(":", "_").replace(",", "_").replace("(", "_").replace(")", "_")
self.sequence_id_lines.append("%s_%s: %s" % (species_idx, seq_idx, header))
self.sequence_id_lines.append("%s_%s: %s" % (species_idx, seq_count, header))
seq_count += 1
print "[+] \t %s sequences parsed" % (seq_count)

def write_files(self):
Expand Down

0 comments on commit a87e2cd

Please sign in to comment.