-- | Filter those entities greater than or equal to n occurrences
filterCommonEntities :: Int -> Int -> [FastaSequence] -> [FastaSequence]
filterCommonEntities ind n = concat
                           . filter ((>= n) . length)
                           . groupBy ((==) `on` getClone ind)
                           . sortBy (compare `on` getClone ind)
  where
    getClone x = (!! (x - 1)) . T.splitOn "|" . fastaHeader

-- | Filter those entities greater than or equal to n occurrences, where
-- n is now inside the header
filterCommonEntities :: Int -> Int -> [FastaSequence] -> [FastaSequence]
filterCommonEntities ind n = concat
                           . filter ((>= n) . length)
                           . groupBy ((==) `on` getClone ind)
                           . sortBy (compare `on` getClone ind)
  where
    getClone x = (!! (x - 1)) . T.splitOn "|" . fastaHeader

-- | Filter those entities greater than or equal to n occurrences, where
-- n is now inside the header
filterCommonEntities ind n = concat
                           . filter ((>= n) . length)
                           . groupBy ((==) `on` getClone ind)
                           . sortBy (compare `on` getClone ind)
  where
    getClone x = (!! (x - 1)) . T.splitOn "|" . fastaHeader

-- | Filter those entities greater than or equal to n occurrences, where
-- n is now inside the header