Skip to content

Commit f3386f4

Browse files
committed
fix linting
1 parent f49dca7 commit f3386f4

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

tools/flexynesis/fetch_cbioportal_data.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
import argparse
44
import os
5+
56
from flexynesis.utils import CBioPortalData
67

8+
79
def 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

5960
if __name__ == "__main__":
60-
main()
61+
main()

tools/flexynesis/flexynesis_cbioportal_import.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,22 @@
4141
<param name="data_types" value="clin,mut" />
4242
<param name="split_ratio" value="0.7" />
4343
<output_collection name="datasets" type="list">
44-
<element name="clin_train">
44+
<element name="clin_test">
4545
<assert_contents>
4646
<has_text_matching expression="PATIENT_ID"/>
4747
</assert_contents>
4848
</element>
49-
<element name="mut_train">
49+
<element name="clin_train">
5050
<assert_contents>
51-
<has_text_matching expression="Hugo_Symbol"/>
51+
<has_text_matching expression="PATIENT_ID"/>
5252
</assert_contents>
5353
</element>
54-
<element name="clin_test">
54+
<element name="mut_test">
5555
<assert_contents>
56-
<has_text_matching expression="PATIENT_ID"/>
56+
<has_text_matching expression="Hugo_Symbol"/>
5757
</assert_contents>
5858
</element>
59-
<element name="mut_test">
59+
<element name="mut_train">
6060
<assert_contents>
6161
<has_text_matching expression="Hugo_Symbol"/>
6262
</assert_contents>

0 commit comments

Comments
 (0)