immuneML.reports.clustering_reports package¶
Submodules¶
immuneML.reports.clustering_reports.ClusteringReport module¶
- class immuneML.reports.clustering_reports.ClusteringReport.ClusteringReport(name: str = None, result_path: Path = None, number_of_processes: int = 1, state: ClusteringState = None)[source]¶
Bases:
Report
- DOCS_TITLE = 'Clustering Instruction Reports'¶
- classmethod build_object(**kwargs)[source]¶
Creates the object of the subclass of the Report class from the parameters so that it can be used in the analysis. Depending on the type of the report, the parameters provided here will be provided in parsing time, while the other necessary parameters (e.g., subset of the data from which the report should be created) will be provided at runtime. For more details, see specific direct subclasses of this class, describing different types of reports.
- Parameters:
**kwargs – keyword arguments that will be provided by users in the specification (if immuneML is used as a command line tool) or in the dictionary when calling the method from the code, and which should be used to create the report object
- Returns:
the object of the appropriate report class
immuneML.reports.clustering_reports.ClusteringStabilityReport module¶
immuneML.reports.clustering_reports.ClusteringVisualization module¶
immuneML.reports.clustering_reports.ExternalLabelClusterSummary module¶
- class immuneML.reports.clustering_reports.ExternalLabelClusterSummary.ExternalLabelClusterSummary(external_labels: List[str], name: str = None, state: ClusteringState = None, result_path: Path = None, number_of_processes: int = 1)[source]¶
Bases:
ClusteringReport
This report summarizes the number of examples in a cluster with different values of external labels. For each external label, it creates: 1. A contingency table showing the count of examples for each combination of cluster and label value 2. A heatmap visualization of these counts
It can be used in combination with Clustering instruction.
Specification arguments:
external_labels (list): the list of metadata columns in the dataset that should be compared against cluster assignment
YAML specification:
reports: my_external_label_cluster_summary: ExternalLabelClusterSummary: external_labels: [disease, HLA]
- classmethod build_object(**kwargs)[source]¶
Creates the object of the subclass of the Report class from the parameters so that it can be used in the analysis. Depending on the type of the report, the parameters provided here will be provided in parsing time, while the other necessary parameters (e.g., subset of the data from which the report should be created) will be provided at runtime. For more details, see specific direct subclasses of this class, describing different types of reports.
- Parameters:
**kwargs – keyword arguments that will be provided by users in the specification (if immuneML is used as a command line tool) or in the dictionary when calling the method from the code, and which should be used to create the report object
- Returns:
the object of the appropriate report class
- check_prerequisites()[source]¶
Checks prerequisites for the generation of the report of specific class (e.g., if the class of the MLMethod instance is the one required by the report, if the data has been encoded to make a report of encoded dataset). In the instructions in immuneML, this function is used to determine whether to call generate_report() in the specific situation. Each report subclass has its own set of prerequisites. If the report cannot be run, the information on this will be logged and the report skipped in the specific situation. No error will be raised. See subclasses of the class
Instruction
for more information on how the reports are executed.- Returns:
boolean value True if the prerequisites are o.k., and False otherwise.
immuneML.reports.clustering_reports.ExternalLabelMetricHeatmap module¶
- class immuneML.reports.clustering_reports.ExternalLabelMetricHeatmap.ExternalLabelMetricHeatmap(name: str = None, state: ClusteringState = None, result_path: Path = None, number_of_processes: int = 1)[source]¶
Bases:
ClusteringReport
This report creates heatmaps comparing clustering methods against external labels for each metric. For each external label and metric combination, it creates:
A table showing the metric values for each combination of clustering method and external label
A heatmap visualization of these values
The external labels and metrics are automatically determined from the clustering instruction specification.
YAML specification:
reports: my_external_label_metric_heatmap: ExternalLabelMetricHeatmap
- classmethod build_object(**kwargs)[source]¶
Creates the object of the subclass of the Report class from the parameters so that it can be used in the analysis. Depending on the type of the report, the parameters provided here will be provided in parsing time, while the other necessary parameters (e.g., subset of the data from which the report should be created) will be provided at runtime. For more details, see specific direct subclasses of this class, describing different types of reports.
- Parameters:
**kwargs – keyword arguments that will be provided by users in the specification (if immuneML is used as a command line tool) or in the dictionary when calling the method from the code, and which should be used to create the report object
- Returns:
the object of the appropriate report class
- check_prerequisites()[source]¶
Checks prerequisites for the generation of the report of specific class (e.g., if the class of the MLMethod instance is the one required by the report, if the data has been encoded to make a report of encoded dataset). In the instructions in immuneML, this function is used to determine whether to call generate_report() in the specific situation. Each report subclass has its own set of prerequisites. If the report cannot be run, the information on this will be logged and the report skipped in the specific situation. No error will be raised. See subclasses of the class
Instruction
for more information on how the reports are executed.- Returns:
boolean value True if the prerequisites are o.k., and False otherwise.