Skip to content

Commit

Permalink
Merge commit '5bd9ea4' to apply the fix for inconsistent extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
chtsai0105 committed Oct 25, 2023
2 parents 7d68e4f + 5bd9ea4 commit cbc3013
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ phyling tree -I align
You can also use only part of the alignment results to build tree.

```
phyling tree -i align/100957at4751.faa align/174653at4751.faa align/255412at4751.faa
phyling tree -i align/100957at4751.aa.mfa align/174653at4751.aa.mfa align/255412at4751.aa.mfa
```

Use VeryFastTree instead of the default UPGMA method for tree building and running with 16 threads.
Expand Down
6 changes: 4 additions & 2 deletions src/phyling/libphyling.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,10 @@ def align(self, output: Path, method: str, non_trim: bool, concat: bool, threads

if hasattr(self, "_cds_seqs"):
alignmentList = cds_msa_List
ext = phyling.config.cds_aln_ext
else:
alignmentList = pep_msa_List
ext = phyling.config.prot_aln_ext

if concat:
concat_alignments = MultipleSeqAlignment([])
Expand All @@ -212,7 +214,7 @@ def align(self, output: Path, method: str, non_trim: bool, concat: bool, threads
logging.info("Filling missing taxon done")

for hmm, alignment in zip([hmm for hmm in self.orthologs.keys()], alignmentList):
output_aa = output / f"{hmm}.{phyling.config.protein_ext}"
output_aa = output / f"{hmm}.{ext}"
alignment.sort()
if concat:
concat_alignments += alignment
Expand All @@ -221,7 +223,7 @@ def align(self, output: Path, method: str, non_trim: bool, concat: bool, threads
SeqIO.write(alignment, f, format="fasta")

if concat:
output_concat = output / f"concat_alignments.{phyling.config.prot_aln_ext}"
output_concat = output / f"concat_alignments.{ext}"
with open(output_concat, "w") as f:
SeqIO.write(concat_alignments, f, format="fasta")
logging.info(f"Output concatenated fasta to {output_concat}")
Expand Down
2 changes: 1 addition & 1 deletion src/phyling/phylotree.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def phylotree(inputs, input_dir, output, method, figure, threads, **kwargs):
else:
inputs = [Path(sample) for sample in inputs]
logging.info(f"Found {len(inputs)} MSA fasta")
if inputs[0].name == f"concat_alignments.{phyling.config.prot_aln_ext}":
if inputs[0].name == f"concat_alignments.{phyling.config.aln_ext}":
logging.info("Generate phylogenetic tree the on concatenated fasta")
else:
logging.info("Generate phylogenetic tree on all MSA fasta and conclude an majority consensus tree")
Expand Down

0 comments on commit cbc3013

Please sign in to comment.