# HG changeset patch # User bgruening # Date 1744624576 0 # Node ID b353dad17ab7b0ee8d1c90219e8d328c79be3752 # Parent 98431bd19f18edad599a25ce50da36e39634ecbc planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/flexynesis commit 973836fb40ecb9c0ac26f675d12b20fc8e5f51f4 diff -r 98431bd19f18 -r b353dad17ab7 fetch_cbioportal_data.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fetch_cbioportal_data.py Mon Apr 14 09:56:16 2025 +0000 @@ -0,0 +1,61 @@ +#!/usr/bin/env python + +import argparse +import os + +from flexynesis.utils import CBioPortalData + + +def main(): + parser = argparse.ArgumentParser(description="Fetch and prepare cBioPortal data for Flexynesis.") + parser.add_argument("--study_id", required=True, help="cBioPortal study ID (e.g., 'brca_tcga')") + parser.add_argument("--data_types", required=True, help="Comma-separated list of data types (e.g., 'clin,mut,omics')") + parser.add_argument("--mapped_files", default=None, help="Comma-separated list of .txt files to map to data_types (optional)") + parser.add_argument("--split_ratio", type=float, default=0.7, help="Training/test split ratio (0.0 to 1.0)") + parser.add_argument("--output_dir", required=True, help="Output directory for datasets") + + args = parser.parse_args() + + data_types = args.data_types.split(",") + if "clin" not in data_types: + raise ValueError("Clinical data ('clin') is required for splitting the dataset.") + + file_mapping = { + "clin": "data_clinical_patient.txt", # can be any with 'clinical' in file name + "mut": "data_mutations.txt", # any with 'mutations' in file name + "omics": "data_cna.txt", + "other": None + } + + if args.mapped_files: + mapped_files = args.mapped_files.split(",") + if len(mapped_files) != len(data_types): + raise ValueError(f"Number of mapped files ({len(mapped_files)}) must match number of data types ({len(data_types)}).") + files_to_fetch = {dt: mf for dt, mf in zip(data_types, mapped_files)} + for mf in mapped_files: + if not mf.endswith(".txt"): + raise ValueError(f"Mapped file '{mf}' must end with '.txt'.") + else: + files_to_fetch = {dt: file_mapping[dt] for dt in data_types if dt in file_mapping} + + invalid_types = set(data_types) - set(file_mapping.keys()) + if invalid_types: + raise ValueError(f"Invalid data types: {invalid_types}. Supported types: {list(file_mapping.keys())}") + + cbioportal = CBioPortalData(study_id=args.study_id) + cbioportal.get_cbioportal_data(study_id=args.study_id, files=files_to_fetch) + dataset = cbioportal.split_data(ratio=args.split_ratio) + + os.makedirs(args.output_dir, exist_ok=True) + + for data_type in data_types: + if data_type in dataset['train']: + train_file = os.path.join(args.output_dir, f"{data_type}_train.csv") + dataset['train'][data_type].to_csv(train_file, index=True) + if data_type in dataset['test']: + test_file = os.path.join(args.output_dir, f"{data_type}_test.csv") + dataset['test'][data_type].to_csv(test_file, index=True) + + +if __name__ == "__main__": + main() diff -r 98431bd19f18 -r b353dad17ab7 flexynesis.xml --- a/flexynesis.xml Mon Aug 12 17:58:02 2024 +0000 +++ b/flexynesis.xml Mon Apr 14 09:56:16 2025 +0000 @@ -71,6 +71,7 @@ #end if --fusion_type $fusion_type --hpo_iter $hpo_iter + --val_size $val_size --finetuning_samples $finetuning_samples --variance_threshold $variance_threshold --correlation_threshold $correlation_threshold @@ -84,6 +85,7 @@ $use_loss_weighting $use_cv $evaluate_baseline_performance + --feature_importance_method $feature_importance_method $disable_marker_finding \${GALAXY_FLEXYNESIS_EXTRA_ARGUMENTS} ]]> @@ -110,6 +112,7 @@ + @@ -133,6 +136,7 @@ + @@ -189,22 +193,26 @@ - - - - - - - - - - - + + + + + + + + + + + + + +
+ +
- @@ -216,10 +224,18 @@ - + + + + + + + + + @@ -249,17 +265,21 @@
- - - - - - + + + + + + + + +
+ +
- @@ -271,10 +291,18 @@ - + + + + + + + + + @@ -299,22 +327,26 @@
- - - - - - - - - - - + + + + + + + + + + + + + +
+ +
- @@ -326,10 +358,18 @@ - + + + + + + + + + @@ -337,7 +377,7 @@ - + @@ -359,21 +399,23 @@
- - - - - - - - - - + + + + + + + + + + +
+ +
- @@ -399,23 +441,25 @@
- - - - - - - - - - - - + + + + + + + + + + + + +
+ +
- @@ -451,25 +495,29 @@
- - - - - - - - - - - - - - + + + + + + + + + + + + + + + + +
+ +
- @@ -481,7 +529,155 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + +
+
+ + + + + + + + + + + + @@ -512,46 +708,6 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
.. class:: warningmark diff -r 98431bd19f18 -r b353dad17ab7 macros.xml --- a/macros.xml Mon Aug 12 17:58:02 2024 +0000 +++ b/macros.xml Mon Apr 14 09:56:16 2025 +0000 @@ -1,6 +1,6 @@ - 0.2.10 - 0 + 0.2.17 + 1 24.1 @@ -65,10 +65,16 @@ + + + + + +