rnalysis.enrichment.FeatureSet.symmetric_difference

FeatureSet.symmetric_difference(other: Union[set, FeatureSet]) FeatureSet

Calculates the set symmetric difference of the indices from two FeatureSet objects (the indices that appear in EXACTLY ONE of the FeatureSet objects, and not both/neither). A-symmetric difference-B is equivalent to (A-difference-B)-union-(B-difference-A).

Parameters

other (FeatureSet, RankedSet or set) – A second object against which the current object will be compared.

Returns

a new FeatureSet with elements in either this FeatureSet or the other object, but not both.

Return type

FeatureSet

Examples
>>> from rnalysis import enrichment
>>> en = enrichment.FeatureSet({'WBGene00000001','WBGene00000002','WBGene00000006'}, 'set name')
>>> en2 = enrichment.FeatureSet({'WBGene00000004','WBGene00000001'})
>>> en.symmetric_difference(en2)
>>> print(en)
FeatureSet: set name
{'WBGene00000002', 'WBGene00000006', 'WBGene00000004'}