def get_documentation(): doc = str(Coefficients.__doc__) valid_values = str([option.name for option in CoefficientPlottingSetting])[1:-1].replace("'", "`") mapping = { "For options see :py:obj:`~source.reports.ml_reports.CoefficientPlottingSetting.CoefficientPlottingSetting`.": f"Valid values are: {valid_values}." } doc = update_docs_per_mapping(doc, mapping) return doc
def get_documentation(): doc = str(SequenceCountEncoder.__doc__) valid_field_values = str(Repertoire.FIELDS)[1:-1].replace("'", "`") mapping = { "Valid comparison value can be any repertoire field name.": f"Valid values are {valid_field_values}." } doc = update_docs_per_mapping(doc, mapping) return doc
def get_documentation(): doc = str(Word2VecEncoder.__doc__) valid_values = str([model_type.name for model_type in ModelType])[1:-1].replace("'", "`") mapping = { "Valid values for this parameter are names of the ModelType enum.": f"Valid values are {valid_values}." } doc = update_docs_per_mapping(doc, mapping) return doc
def get_documentation(): doc = str(SVM.__doc__) mapping = { "For usage instructions, check :py:obj:`~immuneML.ml_methods.SklearnMethod.SklearnMethod`.": SklearnMethod.get_usage_documentation("SVM"), } doc = update_docs_per_mapping(doc, mapping) return doc
def get_documentation(): doc = str(LogisticRegression.__doc__) mapping = { "For usage instructions, check :py:obj:`~source.ml_methods.SklearnMethod.SklearnMethod`.": SklearnMethod.get_usage_documentation("LogisticRegression"), } doc = update_docs_per_mapping(doc, mapping) return doc
def get_documentation(): doc = str(SplitConfig.__doc__) mapping = { "split_strategy (SplitType)": "split_strategy", "reports (ReportConfig)": "reports", "manual_config (:py:obj:`~immuneML.hyperparameter_optimization.config.ManualSplitConfig.ManualSplitConfig`)": "manual_config", "leave_one_out_config (:py:obj:`~immuneML.hyperparameter_optimization.config.LeaveOneOutConfig.LeaveOneOutConfig`)": "leave_one_out_config" } doc = update_docs_per_mapping(doc, mapping) return doc
def get_documentation(): doc = str(MatchedRegexEncoder.__doc__) chain_values = str([region_type.value for region_type in Chain])[1:-1].replace("'", "`") mapping = { "The chains are specified by their three letter code, see :py:obj:`~immuneML.data_model.receptor.receptor_sequence.Chain.Chain`.": f"The chains are specified by their three letter code, valid values are: {chain_values}.", } doc = update_docs_per_mapping(doc, mapping) return doc
def get_documentation(): doc = str(RandomForestClassifier.__doc__) mapping = { "For usage instructions, check :py:obj:`~source.ml_methods.SklearnMethod.SklearnMethod`.": SklearnMethod.get_usage_documentation("RandomForestClassifier"), } doc = update_docs_per_mapping(doc, mapping) return doc
def get_documentation(): doc = str(AtchleyKmerEncoder.__doc__) valid_values = str([item.name for item in RelativeAbundanceType])[1:-1].replace("'", "`") mapping = { "how to compute abundance term for k-mers": f"how to compute abundance term for k-mers; valid values are {valid_values}." } doc = update_docs_per_mapping(doc, mapping) return doc
def get_documentation(): doc = str(ReportConfig.__doc__) mapping = { "data_splits (dict)": "data_splits", "models (dict)": "models", "data (dict)": "data", "encoding (dict)": "encoding" } doc = update_docs_per_mapping(doc, mapping) return doc
def get_documentation(): doc = str(DuplicateSequenceFilter.__doc__) mapping = { "Valid options are defined by the CountAggregationFunction enum.": f"Valid values are: {[e.name for e in CountAggregationFunction]}.", "Valid options are defined by the SequenceType enum.": f"Valid values are: {[e.name for e in SequenceType]}." } doc = update_docs_per_mapping(doc, mapping) return doc
def get_documentation(): doc = str(DatasetExportInstruction.__doc__) valid_strategy_values = ReflectionHandler.all_nonabstract_subclass_basic_names(DataExporter, "Exporter", "dataset_export/") valid_strategy_values = str(valid_strategy_values)[1:-1].replace("'", "`") mapping = { "Valid formats are class names of any non-abstract class inheriting " ":py:obj:`~immuneML.IO.dataset_export.DataExporter.DataExporter`.": f"Valid values are: {valid_strategy_values}." } doc = update_docs_per_mapping(doc, mapping) return doc
def get_documentation(): doc = str(IGoRImport.__doc__) region_type_values = str([region_type.name for region_type in RegionType])[1:-1].replace("'", "`") repertoire_fields = list(Repertoire.FIELDS) repertoire_fields.remove("region_types") mapping = { "Valid values for region_type are the names of the :py:obj:`~immuneML.data_model.receptor.RegionType.RegionType` enum.": f"Valid values are {region_type_values}.", "Valid immuneML fields that can be specified here are defined by Repertoire.FIELDS": f"Valid immuneML fields that can be specified here are {repertoire_fields}." } doc = update_docs_per_mapping(doc, mapping) return doc
def get_documentation(): doc = str(OLGAImport.__doc__) region_type_values = str([ region_type.name for region_type in RegionType ])[1:-1].replace("'", "`") mapping = { "Valid values for region_type are the names of the :py:obj:`~immuneML.data_model.receptor.RegionType.RegionType` enum.": f"Valid values are {region_type_values}.", } doc = update_docs_per_mapping(doc, mapping) return doc
def get_documentation(): doc = str(DistanceEncoder.__doc__) valid_values = [metric.name for metric in DistanceMetricType] valid_values = str(valid_values)[1:-1].replace("'", "`") valid_field_values = str(Repertoire.FIELDS)[1:-1].replace("'", "`") mapping = { "Names of different distance metric types are allowed values in the specification.": f"Valid values are: {valid_values}.", "Valid values include any repertoire attribute (sequence, amino acid sequence, V gene etc).": f"Valid values are {valid_field_values}." } doc = update_docs_per_mapping(doc, mapping) return doc
def get_documentation(): doc = str(FeatureValueBarplot.__doc__) error_bar = DocEnumHelper.get_enum_names(ErrorBarMeaning) panel_layout = DocEnumHelper.get_enum_names_and_values(PanelLayoutType) panel_axis_scales = DocEnumHelper.get_enum_names_and_values(PanelAxisScalesType) panel_label_switch_type = DocEnumHelper.get_enum_names_and_values(PanelLabelSwitchType) mapping = { "For options see :py:obj:`~source.visualization.ErrorBarMeaning.ErrorBarMeaning`.": f"Valid values are: {error_bar}.", "For options see :py:obj:`~source.visualization.PanelLayoutType.PanelLayoutType`.": f"Valid values are: {panel_layout}", "For options see :py:obj:`~source.visualization.PanelAxisScalesType.PanelAxisScalesType`.": f"Valid values are: {panel_axis_scales}", "For options see :py:obj:`~source.visualization.PanelLabelSwitchType.PanelLabelSwitchType`.": f"Valid values are: {panel_label_switch_type}" } doc = update_docs_per_mapping(doc, mapping) return doc
def get_documentation(): initial_doc = str(Signal.__doc__) valid_implanting_values = str( ReflectionHandler.all_nonabstract_subclass_basic_names( SignalImplantingStrategy, 'Implanting', 'signal_implanting_strategy/'))[1:-1].replace("'", "`") docs_mapping = { "Valid values for this argument are class names of different signal implanting strategies.": f"Valid values are: {valid_implanting_values}" } doc = update_docs_per_mapping(initial_doc, docs_mapping) return doc
def get_documentation(): doc = str(Motif.__doc__) valid_strategy_values = ReflectionHandler.all_nonabstract_subclass_basic_names( MotifInstantiationStrategy, "Instantiation", "motif_instantiation_strategy/") valid_strategy_values = str(valid_strategy_values)[1:-1].replace( "'", "`") chain_values = str([name for name in Chain])[1:-1].replace("'", "`") mapping = { "It should be one of the classes inheriting MotifInstantiationStrategy.": f"Valid values are: {valid_strategy_values}.", "The value should be an instance of :py:obj:`~source.data_model.receptor.receptor_sequence.Chain.Chain`.": f"Valid values are: {chain_values}." } doc = update_docs_per_mapping(doc, mapping) return doc
def get_documentation(): doc = str(SingleLineReceptorImport.__doc__) valid_chain_names = str([item.name for item in Chain])[1:-1].replace("'", "`") valid_chain_pair_names = str([item.name for item in ChainPair])[1:-1].replace("'", "`") region_type_values = str([region_type.name for region_type in RegionType])[1:-1].replace("'", "`") mapping = { "The possible names that can be filled in for <chain> are given in :py:obj:`~immuneML.data_model.receptor.receptor_sequence.Chain.Chain`": f"The possible names that can be filled in for <chain> are: {valid_chain_names}.", "Valid values for receptor_chains are the names of the :py:obj:`~immuneML.data_model.receptor.ChainPair.ChainPair` enum.": f"Valid values for receptor_chains are: {valid_chain_pair_names}.", "Valid values for region_type are the names of the :py:obj:`~immuneML.data_model.receptor.RegionType.RegionType` enum.": f"Valid values are {region_type_values}.", } doc = update_docs_per_mapping(doc, mapping) return doc
def get_documentation(): doc = str(MiXCRImport.__doc__) region_type_values = str([ region_type.name for region_type in MiXCRImport.SEQUENCE_NAME_MAP.keys() ])[1:-1].replace("'", "`") repertoire_fields = list(Repertoire.FIELDS) repertoire_fields.remove("region_types") mapping = { "Valid values for region_type are defined in MiXCRImport.SEQUENCE_NAME_MAP.": f"Valid values are {region_type_values}.", "Valid immuneML fields that can be specified here are defined by Repertoire.FIELDS": f"Valid immuneML fields that can be specified here are {repertoire_fields}." } doc = update_docs_per_mapping(doc, mapping) return doc
def get_documentation(): doc = str(TrainMLModelInstruction.__doc__) valid_values = str([metric.name.lower() for metric in Metric])[1:-1].replace("'", "`") valid_strategies = str(ReflectionHandler.all_nonabstract_subclass_basic_names(HPOptimizationStrategy, "", "hyperparameter_optimization/strategy/"))[1:-1]\ .replace("'", "`") mapping = { "dataset (Dataset)": "dataset", "hp_strategy (HPOptimizationStrategy)": "strategy", "hp_settings": "settings", "assessment (SplitConfig)": "assessment", "selection (SplitConfig)": "selection", "optimization_metric (Metric)": "optimization_metric", "label_configuration (LabelConfiguration)": "labels (list)", "data_reports": "reports", "a list of metrics": f"a list of metrics ({valid_values})", "a metric to use for optimization": f"a metric to use for optimization (one of {valid_values})", "Valid values are objects of any class inheriting :py:obj:`~immuneML.hyperparameter_optimization.strategy." "HPOptimizationStrategy.HPOptimizationStrategy`.": f"Valid values are: {valid_strategies}.", "the reports to be specified here have to be :py:obj:`~immuneML.reports.train_ml_model_reports.TrainMLModelReport.TrainMLModelReport` reports.": f"the reports that can be provided here are :ref:`{TrainMLModelReport.get_title()}`." } doc = update_docs_per_mapping(doc, mapping) return doc