Skip to content

Commit dcc9efc

Browse files
committedAug 17, 2024
Further max sequence length improvements
1 parent 643d915 commit dcc9efc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎fastonex.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def nexus_matrix(seqdict):
6767
Takes a dictionary containing sequences and returns the NEXUS MATRIX block.
6868
"""
6969
nexus_matrix_block = "MATRIX\n\n"
70-
maxseqlen = max(len(seq) for seq in seqdict)
70+
maxseqlen = max(len(seqdict[seq]) for seq in seqdict)
7171

7272
for seq in seqdict:
7373
if len(seqdict[seq]) < maxseqlen:

‎test_fastonex.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def test_nexus_matrix():
4747
"""
4848
Unit test that determines if a Leave NEXUS MATRIX block can be determined from a sequence dictionary.
4949
"""
50-
known_input = {"Seq1" : "atgc", "Seq2" : "atg-"}
51-
expected_output = "MATRIX\n\nSeq1 atgc\nSeq2 atg-\n;\n\nEND;"
50+
known_input = {"Seq1" : "atgcatg", "Seq2" : "atg----"}
51+
expected_output = "MATRIX\n\nSeq1 atgcatg\nSeq2 atg----\n;\n\nEND;"
5252

5353
assert fastonex.nexus_matrix(known_input) == expected_output

0 commit comments

Comments
 (0)
Please sign in to comment.