Operators

Crossover

class pym2sa.operator.crossover.HMSA(probability: float) → None

Bases: jmetal.core.operator.Crossover

Implements an horizontal recombination for MSA.

do_crossover(parents: typing.List[pym2sa.core.solution.MSASolution]) → typing.List[pym2sa.core.solution.MSASolution]
execute(parents: typing.List[pym2sa.core.solution.MSASolution]) → typing.List[pym2sa.core.solution.MSASolution]
get_name() → str
get_number_of_parents() → int
class pym2sa.operator.crossover.SPXMSA(probability: float, remove_gap_columns: bool = True) → None

Bases: jmetal.core.operator.Crossover

Implements a single point crossover for MSA.

cross_parents(cx_point: int, parents: typing.List[pym2sa.core.solution.MSASolution], cutting_points_in_first_parent: list, column_positions_in_second_parent: list) → typing.List[pym2sa.core.solution.MSASolution]
do_crossover(parents: typing.List[pym2sa.core.solution.MSASolution]) → typing.List[pym2sa.core.solution.MSASolution]
execute(parents: typing.List[pym2sa.core.solution.MSASolution]) → typing.List[pym2sa.core.solution.MSASolution]
fill_sequences_with_gaps_to_reach_the_max_sequence_length(solution: pym2sa.core.solution.MSASolution, max_length: int, cutting_points: list)
find_cutting_points_in_first_parent(solution: pym2sa.core.solution.MSASolution, position: int) → list

Find the real cutting points in a solution. If the column is a gap then the next non-gap symbol must be found

find_length_of_the_largest_sequence(solution: pym2sa.core.solution.MSASolution)
find_original_positions_in_original_sequences(solution: pym2sa.core.solution.MSASolution, column: int) → list

Given a solution, find for each sequence the original positions of the symbol in the column in the original unaligned sequences

get_name() → str
get_number_of_parents() → int

Mutation

class pym2sa.operator.mutation.MultipleMSAMutation(operator: typing.List[jmetal.core.operator.Mutation[S]], probability: float) → None

Bases: jmetal.core.operator.Mutation

do_mutation(solution: pym2sa.core.solution.MSASolution) → pym2sa.core.solution.MSASolution
execute(solution: pym2sa.core.solution.MSASolution) → pym2sa.core.solution.MSASolution
get_name() → str
class pym2sa.operator.mutation.OneRandomGapInsertion(probability: float, remove_gap_columns: bool = False) → None

Bases: jmetal.core.operator.Mutation

do_mutation(solution: pym2sa.core.solution.MSASolution) → pym2sa.core.solution.MSASolution
execute(solution: pym2sa.core.solution.MSASolution) → pym2sa.core.solution.MSASolution
get_name() → str
class pym2sa.operator.mutation.ShiftClosedGapGroups(probability: float, remove_gap_columns: bool = True) → None

Bases: jmetal.core.operator.Mutation

For every sequence, selects a random group and shift it with the closest gap group.

do_mutation(solution: pym2sa.core.solution.MSASolution) → pym2sa.core.solution.MSASolution
execute(solution: pym2sa.core.solution.MSASolution) → pym2sa.core.solution.MSASolution
get_name() → str
class pym2sa.operator.mutation.ShiftGapGroup(probability: float, remove_gap_columns: bool = True) → None

Bases: jmetal.core.operator.Mutation

Selects a gap group randomly in all the sequences of a solution and shifts it one position to the left or to the right.

do_mutation(solution: pym2sa.core.solution.MSASolution) → pym2sa.core.solution.MSASolution
execute(solution: pym2sa.core.solution.MSASolution) → pym2sa.core.solution.MSASolution
get_name() → str
class pym2sa.operator.mutation.TwoRandomAdjacentGapGroup(probability: float, remove_gap_columns: bool = True) → None

Bases: jmetal.core.operator.Mutation

Selects a random gap group and merges it with the adjacent gaps group.

do_mutation(solution: pym2sa.core.solution.MSASolution) → pym2sa.core.solution.MSASolution
execute(solution: pym2sa.core.solution.MSASolution) → pym2sa.core.solution.MSASolution
get_name() → str