{% macro show_depth(depth) %} {% for letter in depth %}
{% endfor %} {% endmacro %} {% macro layers(index, depth, parent, depth_alt="", current_layer=0, parent_index=0, primary=false) %} {% set local_id = parent ~ "@" ~ index %} {% if instructions[index].action.type == "Combine" %}
{% for source in instructions[index].values %}
Layer {{loop.index}}
{{ self::layers(index=source, depth = "", parent = local_id, current_layer = loop.index0,parent_index=index,primary=false) }}
Comparison
{{ self::layers(index=instructions[index].values[0], depth = "", parent = local_id, current_layer = loop.index0,parent_index=instructions[index].values[0],primary=true) }}
{% endfor %}
{% elif instructions[index].action.type == "Node" %}
{{ self::show_depth(depth=depth) }} {{instructions[index].action.value}} {% for amino_acid_layer in amino_acid_layers %} {% if amino_acid_layer == current_layer %} {% if primary %} {% set current_amino_acid = position_value_amino_acids_primary[loop.index0][index] %} {% set parent_amino_acid = position_value_amino_acids_primary[loop.index0][parent_index] %} {% else %} {% set current_amino_acid = position_value_amino_acids[loop.index0][index] %} {% set parent_amino_acid = position_value_amino_acids[loop.index0][parent_index] %} {% endif %} {% if current_amino_acid != parent_amino_acid %} {{parent_amino_acid}}{{loop.index}}{{current_amino_acid}} {% endif %} {% endif %} {% endfor %}
{% for source in instructions[index].values %} {% if loop.last %} {{ self::layers(index=source, depth = depth_alt ~ "L", depth_alt=depth_alt ~ " ", parent = local_id, current_layer=current_layer, parent_index=index,primary=primary) }} {% else %} {{ self::layers(index=source, depth = depth_alt ~ "t", depth_alt=depth_alt ~ "i", parent = local_id, current_layer=current_layer, parent_index=index,primary=primary) }} {%endif %} {% endfor %} {% elif instructions[index].action.type == "Sequence" %}
{{ self::show_depth(depth=depth) }} {{sequence_id_mapping[instructions[index].action.value]}} {% for amino_acid_layer in amino_acid_layers %} {% if amino_acid_layer == current_layer %} {% if primary %} {% set current_amino_acid = position_value_amino_acids_primary[loop.index0][index] %} {% set parent_amino_acid = position_value_amino_acids_primary[loop.index0][parent_index] %} {% else %} {% set current_amino_acid = position_value_amino_acids[loop.index0][index] %} {% set parent_amino_acid = position_value_amino_acids[loop.index0][parent_index] %} {% endif %} {% if current_amino_acid != parent_amino_acid %} {{parent_amino_acid}}{{loop.index}}{{current_amino_acid}} {% endif %} {% endif %} {% endfor %}
{% endif %} {% endmacro %} {% macro sequence(index, depth, parent, depth_alt="", current_layer=0, parent_index=0, position=0) %} {% set local_id = parent ~ "@" ~ index %} {% if instructions[index].action.type == "Combine" %}
{% for layer in position_layer_weights[position] %} {% set source = instructions[index].values[layer.index] %}
Layer {{layer.index}} {{layer.proportion|percentage}}
{{ self::sequence(index=source, depth = "", parent = local_id, current_layer = loop.index0,parent_index=index,position=position) }}
{% endfor %}
{% elif instructions[index].action.type == "Node" %}
{{ self::show_depth(depth=depth) }} {{instructions[index].action.value}} {% set current_amino_acid = position_value_amino_acids[position][index] %} {% set parent_amino_acid = position_value_amino_acids[position][parent_index] %} {{current_amino_acid}}
{% for source in instructions[index].values %} {% if loop.last %} {{ self::sequence(index=source, depth = depth_alt ~ "L", depth_alt=depth_alt ~ " ", parent = local_id, current_layer=current_layer, parent_index=index,position=position) }} {% else %} {{ self::sequence(index=source, depth = depth_alt ~ "t", depth_alt=depth_alt ~ "i", parent = local_id, current_layer=current_layer, parent_index=index,position=position) }} {%endif %} {% endfor %} {% elif instructions[index].action.type == "Sequence" %}
{{ self::show_depth(depth=depth) }} {{sequence_id_mapping[instructions[index].action.value]}} {% set current_amino_acid = position_value_amino_acids[position][index] %} {% set current_amino_acid = position_value_amino_acids[position][index] %} {% set parent_amino_acid = position_value_amino_acids[position][parent_index] %} {{current_amino_acid}}
{% endif %} {% endmacro %} {% macro changes(index, parent_index, current_layer, node) %} {% if instructions[index].action.type == "Combine" %}
{% for source in instructions[index].values %} {{ self::changes(index=source, current_layer=loop.index0, parent_index=index,node=node) }} {% endfor %}
{% elif instructions[index].action.type == "Node" %} {% if instructions[index].action.value == node %} {% for layer in amino_acid_layers %} {% if layer == current_layer %} {% set current_amino_acid = position_value_amino_acids[loop.index0][index] %} {% set parent_amino_acid = position_value_amino_acids[loop.index0][parent_index] %} {% if current_amino_acid != parent_amino_acid %} {{parent_amino_acid}}{{loop.index}}{{current_amino_acid}} {% endif %} {%endif%} {% endfor %} {% endif %} {% for source in instructions[index].values %} {{ self::changes(index=source, current_layer=current_layer, parent_index=index,node=node) }} {% endfor %} {% elif instructions[index].action.type == "Sequence" %} {% endif %} {% endmacro %}