rnalysis.filtering.FoldChangeFilter.symmetric_difference

FoldChangeFilter.symmetric_difference(other: Filter | set, return_type: Literal['set', 'str'] = 'set')

Returns a set/string of the WBGene indices that exist either in the first Filter object/set OR the second, but NOT in both (set symmetric difference).

Parameters:
  • other (Filter or set.) – a second Filter object/set to calculate symmetric difference with.

  • return_type ('set' or 'str' (default='set')) – If β€˜set’, returns a set of the features that exist in exactly one Filter object. If β€˜str’, returns a string of the features that exist in exactly one Filter object, delimited by a comma.

Return type:

set or str

Returns:

a set/string of the features that that exist t in exactly one Filter. (set symmetric difference).

Examples:
>>> from rnalysis import filtering
>>> d = filtering.DESeqFilter("tests/test_files/test_deseq.csv")
>>> counts = filtering.CountFilter('tests/test_files/counted.csv')
>>> # calculate difference and return a set
>>> d.symmetric_difference(counts)
{'WBGene00000017', 'WBGene00077504', 'WBGene00000024', 'WBGene00000010', 'WBGene00000020',
'WBGene00007069', 'WBGene00007063', 'WBGene00007067', 'WBGene00007078', 'WBGene00000029', 'WBGene00000006',
'WBGene00007064', 'WBGene00000019', 'WBGene00000004', 'WBGene00007066', 'WBGene00014997', 'WBGene00000023',
'WBGene00007074', 'WBGene00000025', 'WBGene00043989', 'WBGene00043988', 'WBGene00000014', 'WBGene00000027',
'WBGene00000021', 'WBGene00044022', 'WBGene00007079', 'WBGene00000012', 'WBGene00000005', 'WBGene00077503',
'WBGene00000026', 'WBGene00000003', 'WBGene00000002', 'WBGene00077502', 'WBGene00044951', 'WBGene00007077',
'WBGene00000007', 'WBGene00000008', 'WBGene00007076', 'WBGene00000013', 'WBGene00043990', 'WBGene00043987',
'WBGene00007071', 'WBGene00000011', 'WBGene00000015', 'WBGene00000018', 'WBGene00000016', 'WBGene00000028',
'WBGene00007075', 'WBGene00000022', 'WBGene00000009'}