Multi-Dendrix Logo

This Page

multi_dendrix.white_and_blacklisting

multi_dendrix.white_and_blacklisting(patient_wlst=None, patient_blst=None, gene_wlst=None, gene_blst=None)[source]

Reconciles the different white- and blacklists provided as input into Multi-Dendrix.

Parameters:
  • patient_wlst (string) – File location of patients to be included in analyzed mutation data.
  • patient_blst (string) – File location of patients to be excluded in analyzed mutation data.
  • gene_wlst (string) – File location of patients to be included in analyzed mutation data.
  • gene_blst (string) – File location of patients to be excluded in analyzed mutation data.
Returns:
  • gene2include (dictionary): mapping of genes to whether they should be included in the analyzed mutation data.
  • patient2include (dictionary): mapping of patients to whether they should be included in the analyzed mutation data.
Examples:

(For brevity, examples are for patient white- and blacklists only)

Patient whitelisting only:
>>> patient_wlst = 'patient.wlst'
>>> open(patient_wlst).readlines()
["TCGA-01", "TCGA-02", "TCGA-03"]
>>> white_and_blacklisting(patient_wlst)
(defaultdict(<function <lambda>>, {}), {"TCGA-01", "TCGA-02", "TCGA-03"})
Conflicting patient white- and blacklists (whitelist has final word):
>>> patient_blst = 'patient.blst'
>>> open(patient_wlst).readlines()
["TCGA-02", "TCGA-04"]
>>> white_and_blacklisting(patient_wlst)
(defaultdict(<function <lambda>>, {}), {"TCGA-01", "TCGA-02", "TCGA-03"})

See also: load_mutation_data(), load_mutation_data_w_cutoff().