Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed stand-alone version of multiple-seq-alignment #218

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions deblur/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ def op(x): return x in aligned_seq_ids
return output_fp, okseqs, [blast_output_filename]


def multiple_sequence_alignment(seqs_fp, threads=1):
def multiple_sequence_alignment(seqs_fp, threads=1, output_fp=None):
"""Perform multiple sequence alignment on FASTA file using MAFFT.

Parameters
Expand All @@ -517,7 +517,10 @@ def multiple_sequence_alignment(seqs_fp, threads=1):
if stat(seqs_fp).st_size == 0:
logger.warning('msa failed. file %s has no reads' % seqs_fp)
return None
msa_fp = seqs_fp + '.msa'
if output_fp is None:
msa_fp = seqs_fp + '.msa'
else:
msa_fp = output_fp
params = ['mafft', '--quiet', '--preservecase', '--parttree', '--auto',
'--thread', str(threads), seqs_fp]
sout, serr, res = _system_call(params, stdoutfilename=msa_fp)
Expand Down
6 changes: 2 additions & 4 deletions scripts/deblur
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,8 @@ def multiple_seq_alignment(seqs_fp, output_fp, threads_per_sample,
"""Multiple sequence alignment"""
start_log(level=log_level * 10, filename=log_file)
alignment = multiple_sequence_alignment(seqs_fp,
threads=threads_per_sample)

with open(output_fp, 'w') as f:
f.write(alignment.to_fasta())
threads=threads_per_sample,
output_fp=output_fp)


# DE NOVO CHIMERA REMOVAL COMMAND
Expand Down