This function identifies motif matrices which are duplicated in a universalmotif list or universalmotif_df and removes them. This operation ignores motif metadata and operates by removing all entries whose motif matrices are identical. The first instance of a duplicated motif in the input list is the one returned.

remove_duplicate_motifs(x)

Arguments

x

a universalmotif list or universalmotif_df

Value

A deduplicated list or universalmotif_df

Examples

motif <- universalmotif::create_motif()
duplicated <- c(motif, motif)
remove_duplicate_motifs(duplicated)
#> [[1]]
#> 
#>        Motif name:   motif
#>          Alphabet:   DNA
#>              Type:   PPM
#>           Strands:   +-
#>          Total IC:   10.02
#>       Pseudocount:   0
#>         Consensus:   TRMMMBACAS
#> 
#>      T    R    M    M    M    B    A    C    A    S
#> A 0.00 0.51 0.70 0.34 0.40 0.00 0.80 0.07 0.56 0.09
#> C 0.04 0.01 0.28 0.65 0.59 0.41 0.00 0.92 0.24 0.31
#> G 0.00 0.47 0.01 0.01 0.01 0.27 0.19 0.01 0.14 0.59
#> T 0.96 0.00 0.02 0.00 0.00 0.32 0.00 0.00 0.05 0.00
#>