Skip to content

Commit c9a9670

Browse files
committed
Fix _recombine_symbols
1 parent 4a6b770 commit c9a9670

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/mutagenesis/recombination.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ function (m::Recombination)(parents::AbstractVector{Vector{Char}})
2323
@assert DESilico.same_length_sequences(parents)
2424
length(parents) == 0 && return Vector{Vector{Char}}([])
2525
alphabets = m.alphabet_extractor(parents)
26-
mutant_library = _recombine_symbols(alphabets, parents[1])
26+
_recombine_symbols(alphabets)
2727
end
2828

2929
function _recombine_symbols(
3030
alphabets::Vector{Set{Char}},
31-
first_parent::AbstractVector{Char},
3231
)
33-
mutant_library = Vector{Vector{Char}}([copy(first_parent)])
34-
for position in 1:length(first_parent)
32+
sequence = map(alphabet -> [symbol for symbol in alphabet][1], alphabets)
33+
mutant_library = Vector{Vector{Char}}([sequence])
34+
for position in 1:length(alphabets)
3535
new_mutants = Vector{Vector{Char}}([])
3636
for mutant in mutant_library
3737
for symbol in alphabets[position]

test/unit/mutagenesis/recombination.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@
55
Set(['A']),
66
Set(['B', 'D']),
77
]
8-
first_parent = ['A', 'A', 'B']
9-
mutants = DESilico._recombine_symbols(alphabets, first_parent)
8+
mutants = DESilico._recombine_symbols(alphabets)
109
@test length(mutants) == 4
1110
@test Set(mutants) == Set([
1211
['A', 'A', 'B'],
1312
['A', 'A', 'D'],
1413
['C', 'A', 'B'],
1514
['C', 'A', 'D'],
1615
])
17-
@test first_parent == ['A', 'A', 'B']
1816
end
1917

2018
@testset "Constructors" begin

0 commit comments

Comments
 (0)