uniqGenesetsByNamespace.Rd
Make names of gene-sets unique by namespace, and member genes of gene-sets unique
uniqGenesetsByNamespace(gmtList)
gmtList | A The function make sure that
Gene-sets with duplicated names and different |
---|
A GmtList
object, with unique gene-sets and unique gene lists. If not already present, a new item namespace
is appended to each list
element in the GmtList
object, recording the namespace used to make gene-sets unique. The order of the returned GmtList
object is given by the unique gene-set name of the input object.
myGmtList <- GmtList(list(list(name="GeneSet1", desc="Namespace1", genes=LETTERS[1:3]),
list(name="GeneSet2", desc="Namespace1", genes=rep(LETTERS[4:6],2)),
list(name="GeneSet1", desc="Namespace1", genes=LETTERS[4:6]),
list(name="GeneSet3", desc="Namespace2", genes=LETTERS[1:5])))
print(myGmtList)
#> A gene-set list in GMT format with 4 genesets
#> Gene-sets:
#> GeneSet1 (Namespace1,n=3): A,B,C
#> GeneSet2 (Namespace1,n=6): D,E,F,...
#> GeneSet1 (Namespace1,n=3): D,E,F
#> GeneSet3 (Namespace2,n=5): A,B,C,...
myGmtList <- setNamespace(myGmtList, namespace=function(x) x$desc)
myUniqGmtList <- uniqGenesetsByNamespace(myGmtList)
print(myUniqGmtList)
#> A gene-set list in GMT format with 3 genesets
#> Namespaces:
#> [1] Namespace1 (n=2)
#> [2] Namespace2 (n=1)
#> Gene-sets:
#> GeneSet1 (Namespace1,n=6): A,B,C,...
#> GeneSet2 (Namespace1,n=3): D,E,F
#> GeneSet3 (Namespace2,n=5): A,B,C,...