Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
deduplicate fields names of blast outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Donaim committed Sep 15, 2023
1 parent ac8abf9 commit f3fc9c3
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions util/wrappers.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import dataclasses
import subprocess
import tempfile

from Bio import SeqIO, AlignIO

from util.blastrow import BlastRow

def mafft(sequences):
'''
Call mafft on a set of sequences and return the resulting alignment.
Expand All @@ -22,12 +25,7 @@ def mafft(sequences):

def blast(alignment_file, input_file, output_file):
fileformat = "10" # .csv format
fields = ["qseqid", "sseqid", "sgi", "qlen", "slen", "length",
"qstart", "qend", "sstart", "send",
"evalue", "bitscore", "pident", "nident",
"sstrand", "stitle",
"btop",
]
fields = [field.name for field in dataclasses.fields(BlastRow)]
outfmt = fileformat + ' ' + ' '.join(fields)

with open(output_file, "w") as output, \
Expand Down

0 comments on commit f3fc9c3

Please sign in to comment.