filtSizeUniq: Filter for unique elements

View source: R/filtSizeUniq.R

filtSizeUniqR Documentation

Filter for unique elements

Description

This function aims to identify and remove duplicated elements in a list and maintain the list-structure in the output. filtSizeUniq filters 'lst' (list of character-vectors or character-vector) for elements being unique (to 'ref' or if NULL to all 'lst') and of character length. In addition, the min- and max- character length may be filtered, too. Eg, in proteomics this helps removing peptide sequences which would not be measured/detected any way.

Usage

filtSizeUniq(
  lst,
  ref = NULL,
  minSize = 6,
  maxSize = 36,
  filtUnique = TRUE,
  byProt = TRUE,
  inclEmpty = TRUE,
  silent = FALSE,
  debug = FALSE,
  callFrom = NULL
)

Arguments

lst

list of character-vectors or character-vector

ref

(character) optional alternative 'reference', if not NULL used in addition to 'lst' for considering elements of 'lst' as unique

minSize

(integer) minimum number of characters, if NULL set to 0

maxSize

(integer) maximum number of characters

filtUnique

(logical) if TRUE return unique-only character-strings

byProt

(logical) if TRUE organize output as list (by names of input, eg protein-names) - if 'lst' was named list

inclEmpty

(logical) optional including empty list-elements when all elements have been filtered away - if 'lst' was named list

silent

(logical) suppress messages

debug

(logical) additional messages for debugging

callFrom

(character) allow easier tracking of messages produced

Value

list of filtered input

See Also

correctToUnique, unique, duplicated

Examples

filtSizeUniq(list(A="a",B=c("b","bb","c"),D=c("dd","d","ddd","c")),filtUn=TRUE,minSi=NULL)
# input: c and dd are repeated
filtSizeUniq(list(A="a",B=c("b","bb","c"),D=c("dd","d","ddd","c")),ref=c(letters[c(1:26,1:3)],
  "dd","dd","bb","ddd"),filtUn=TRUE,minSi=NULL)  # a,b,c,dd repeated 

wrMisc documentation built on Nov. 17, 2023, 5:09 p.m.