Transform — repytah 0.1.0dev documentation

# Transform

The module `transform.py` contains functions that transform matrix inputs into different forms that are of use in bigger functions where they are called. These functions focus mainly on overlapping repeated structures and annotation markers.

This module contains the following functions:

remove_overlaps(input_mat, song_length)

  Removes any pairs of repeat length and specific annotation marker where there exists at least one pair of repeats that overlap in time.

  Parameters
    input_matnp.ndarray[int]

      List of pairs of repeats with annotations marked. The first two columns refer to the first repeat or the pair, the second two refer to the second repeat of the pair, the fifth column refers to the length of the repeats, and the sixth column contains the annotation markers.

    song_lengthint

      Number of audio shingles.

  Returns

    lst_no_overlapsnp.ndarray[int]

      List of pairs of repeats with annotations marked. All the repeats of a given length and with a specific annotation marker do not overlap in time.

    matrix_no_overlapsnp.ndarray[int]

      Matrix representation of lst_no_overlaps with one row for each group of repeats.

    key_no_overlapsnp.ndarray[int]

      Vector containing the lengths of the repeats encoded in each row of matrix_no_overlaps.

    annotations_no_overlapsnp.ndarray[int]

      Vector containing the annotation markers of the repeats encoded in each row of matrix_no_overlaps.

    all_overlap_lstnp.ndarray[int]

      List of pairs of repeats with annotations marked removed from input_mat. For each pair of repeat length and specific annotation marker, there exist at least one pair of repeats that do overlap in time.