E402 Combining PWAs and MSAs · Issue #5075 · biopython/biopython · GitHub
[go: up one dir, main page]

Skip to content

Combining PWAs and MSAs #5075

@Cassiebastress

Description

@Cassiebastress

Hi @manulera,

I ran the following example:

    def test_mixed_input(self):
        """Test that the method works with input Alignments of mixed number of sequences"""
        aligner = PairwiseAligner()

        # Input sequences
        reference_str = "ACGT"
        seq1_str = "ACGGT"
        seq2_str = "AT"

        # Coordinates for an alignment of three sequences
        coords = np.array([
            [0, 1, 2, 3, 4, 4],
            [0, 1, 2, 3, 4, 5],
            [0, 1, 1, 1, 1, 2]])

        # Generate input alignments
        pwa = next(aligner.align(reference_str, seq1_str))
        not_pairwise_alignment = Alignment([reference_str, seq1_str, seq2_str], coords)

        # Use the method being tested
        msa = Alignment.from_alignments_with_same_reference([pwa, not_pairwise_alignment])

This produced the following error:

        # Concatenate all indices vertically
>       all_indices = np.concatenate(
            [all_indices[0], *[ind[1:] for ind in all_indices[1:]]], axis=0
        )
E       ValueError: all the input array dimensions except for the concatenation axis must match exactly, but along dimension 1, the array at index 0 has size 5 and the array at index 1 has size 4

Bio/Align/__init__.py:1231: ValueError

I added a print statement right before the line that produced the error

        print([ind.shape for ind in all_indices])

to see that the dimensions of the two coordinates arrays were [(3, 5), (3, 4)].

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0