22
33import argparse
44import os
5+
56from flexynesis .utils import CBioPortalData
67
8+
79def main ():
810 parser = argparse .ArgumentParser (description = "Fetch and prepare cBioPortal data for Flexynesis." )
911 parser .add_argument ("--study_id" , required = True , help = "cBioPortal study ID (e.g., 'brca_tcga')" )
@@ -19,8 +21,8 @@ def main():
1921 raise ValueError ("Clinical data ('clin') is required for splitting the dataset." )
2022
2123 file_mapping = {
22- "clin" : "data_clinical_patient.txt" , # can be any with 'clinical' in file name
23- "mut" : "data_mutations.txt" , # any with 'mutations' in file name
24+ "clin" : "data_clinical_patient.txt" , # can be any with 'clinical' in file name
25+ "mut" : "data_mutations.txt" , # any with 'mutations' in file name
2426 "omics" : "data_cna.txt" ,
2527 "other" : None
2628 }
@@ -49,12 +51,11 @@ def main():
4951 for data_type in data_types :
5052 if data_type in dataset ['train' ]:
5153 train_file = os .path .join (args .output_dir , f"{ data_type } _train.csv" )
52- dataset ['train' ][data_type ].to_csv (train_file , index = True )
53- print (f"Wrote training data to { train_file } " )
54+ dataset ['train' ][data_type ].to_csv (train_file , index = True )
5455 if data_type in dataset ['test' ]:
5556 test_file = os .path .join (args .output_dir , f"{ data_type } _test.csv" )
56- dataset ['test' ][data_type ].to_csv (test_file , index = True )
57- print ( f"Wrote test data to { test_file } " )
57+ dataset ['test' ][data_type ].to_csv (test_file , index = True )
58+
5859
5960if __name__ == "__main__" :
60- main ()
61+ main ()
0 commit comments