A row in the ma_alignment table contains an alignment_id and a target_template_flag so that we know for a given sequence which alignment it refers to and whether it is a template or a target. But in an MSA there can be multiple templates, so this does not uniquely identify which template the sequence refers to. Suggestion: add a template_segment_id to the table.