immuneML.reports.clustering_method_reports package¶
Submodules¶
immuneML.reports.clustering_method_reports.ClusteringMethodReport module¶
- class immuneML.reports.clustering_method_reports.ClusteringMethodReport.ClusteringMethodReport(result_path: Path = None, name: str = None, clustering_item: ClusteringItem = None)[source]¶
Bases:
Report,ABCClustering method reports show some features or statistics about the clustering method.
- DOCS_TITLE = 'Clustering method reports'¶
immuneML.reports.clustering_method_reports.ClusteringVisualization module¶
- class immuneML.reports.clustering_method_reports.ClusteringVisualization.ClusteringVisualization(dim_red_method: DimRedMethod = None, name: str = None, result_path: Path = None, clustering_item: ClusteringItem = None)[source]¶
Bases:
ClusteringMethodReportA report that creates low-dimensional visualizations of clustering results using the specified dimensionality reduction method. For each dataset and clustering configuration, it creates a scatter plot where points are colored by their cluster assignments.
Specification arguments:
dim_red_method (dict): specification of which dimensionality reduction to perform; valid options are presented under Dimensionality reduction methods and should be specified with the name of the method and its parameters, see the example below; if not specified, the report will use any dimensionality reduced data present in the dataset’s encoded data; if the dataset does not contain dimensionality reduced data, and the encoded data has more than 2 dimensions, the report will be skipped.
YAML specification:
reports: my_report_with_pca: ClusteringVisualization: dim_red_method: PCA: n_components: 2 my_report_with_tsne: ClusteringVisualization: dim_red_method: TSNE: n_components: 2 init: pca my_report_existing_dim_red: ClusteringVisualization: dim_red_method: null
- 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_method_reports.Dendrogram module¶
- class immuneML.reports.clustering_method_reports.Dendrogram.Dendrogram(labels: list, result_path: Path = None, name: str = None, clustering_item: ClusteringItem = None)[source]¶
Bases:
ClusteringMethodReportThis report generates a dendrogram visualization from the AgglomerativeClustering method and shows the external labels as annotations.
Specification arguments:
labels (list): List of metadata labels to annotate on the dendrogram.
YAML specification:
reports: my_dendrogram_report: Dendrogram: labels: - disease_status - age_group
- 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() bool[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
Instructionfor more information on how the reports are executed.- Returns:
boolean value True if the prerequisites are o.k., and False otherwise.
immuneML.reports.clustering_method_reports.ExternalLabelClusterSummary module¶
- class immuneML.reports.clustering_method_reports.ExternalLabelClusterSummary.ExternalLabelClusterSummary(external_labels: List[str], name: str = None, item: ClusteringItem = None, result_path: Path = None)[source]¶
Bases:
ClusteringMethodReportThis 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
Instructionfor more information on how the reports are executed.- Returns:
boolean value True if the prerequisites are o.k., and False otherwise.