Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 99 additions & 9 deletions tools/flexynesis/flexynesis_cbioportal_import.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,28 @@
</macros>
<expand macro="requirements"/>
<command detect_errors="exit_code"><![CDATA[
## list of studies with html report
#set $htm_studies = ['lgg_tcga', 'cesc_tcga']
#set $html_studies = ['acc_tcga_gdc', 'alal_target_gdc', 'aml_target_gdc', 'aml_tcga_gdc', 'blca_tcga_gdc',
'bll_target_gdc', 'brain_cptac_gdc', 'brca_tcga_gdc', 'breast_cptac_gdc', 'ccrcc_tcga_gdc',
'cesc_tcga_gdc', 'chol_tcga_gdc', 'chrcc_tcga_gdc', 'coad_cptac_gdc', 'coad_tcga_gdc',
'difg_tcga_gdc', 'dlbclnos_tcga_gdc', 'esca_tcga_gdc', 'gbm_tcga_gdc', 'hcc_tcga_gdc',
'hgsoc_tcga_gdc', 'hnsc_tcga_gdc', 'luad_cptac_gdc', 'luad_tcga_gdc', 'lusc_cptac_gdc',
'lusc_tcga_gdc', 'mnet_tcga_gdc', 'nbl_target_gdc', 'nsgct_tcga_gdc', 'ohnca_cptac_gdc',
'os_target_gdc', 'ovary_cptac_gdc', 'paad_tcga_gdc', 'pancreas_cptac_gdc', 'plmeso_tcga_gdc',
'prad_tcga_gdc', 'prcc_tcga_gdc', 'rcc_cptac_gdc', 'read_tcga_gdc', 'skcm_tcga_gdc',
'soft_tissue_tcga_gdc', 'stad_tcga_gdc', 'thpa_tcga_gdc', 'thym_tcga_gdc', 'ucec_tcga_gdc',
'ucs_tcga_gdc', 'uec_cptac_gdc', 'um_tcga_gdc', 'wt_target_gdc']
@CHECK_NON_COMMERCIAL_USE@
mkdir -p output/data output/meta &&
python '$cbio_config' &&
cat cbioportal_data.txt &&
mv $str($study_id)/data* output/data/ &&
mv $str($study_id)/meta* output/meta/ &&
mv $str($study_id)/*.htm output/cBioPortal_validation_report.html &&
#if $study_id in $htm_studies:
mv $str($study_id)/*.htm output/cBioPortal_validation_report.html &&
#else if $study_id in $html_studies:
mv $str($study_id)/validation_reports/*validation.html output/cBioPortal_validation_report.html &&
#end if
cd output/data &&
for file in *; do if [[ -f \$file ]]; then mv "\$file" "\${file%.txt}.tabular"; fi; done
]]></command>
Expand All @@ -22,11 +37,6 @@ from contextlib import redirect_stdout

cbioportal = CBioPortalData(study_id='$study_id')
cbioportal.get_cbioportal_data(study_id='$study_id')

output_path = f"cbioportal_data.txt"
with open(output_path, 'w') as f:
with redirect_stdout(f):
cbioportal.get_cbioportal_data('lgg_tcga')
]]></configfile>
</configfiles>
<inputs>
Expand All @@ -44,9 +54,12 @@ with open(output_path, 'w') as f:
<collection name="meta" type="list" label="${tool.name} on ${study_id}: metadata">
<discover_datasets pattern="__name_and_ext__" format="tabular" directory="output/meta"/>
</collection>
<data name="report" format="html" label="${tool.name} on ${study_id}: cBioPortal validation report" from_work_dir="output/cBioPortal_validation_report.html"/>
<data name="report" format="html" label="${tool.name} on ${study_id}: cBioPortal validation report" from_work_dir="output/cBioPortal_validation_report.html">
<filter>study_id in htm_studies or study_id in html_studies</filter>
</data>
</outputs>
<tests>
<!-- test 1: html report public-->
<test expect_num_outputs="3">
<param name="non_commercial_use" value="True"/>
<param name="study_id" value="lgg_tcga"/>
Expand Down Expand Up @@ -84,6 +97,77 @@ with open(output_path, 'w') as f:
</assert_contents>
</output>
</test>
<!-- test 2: html report crdc-->
<test expect_num_outputs="3">
<param name="non_commercial_use" value="True"/>
<param name="study_id" value="acc_tcga_gdc"/>
<output_collection name="data" type="list" count="14">
<element name="data_clinical_patient">
<assert_contents>
<has_text_matching expression="PATIENT_ID"/>
<has_n_lines n="97"/>
</assert_contents>
</element>
<element name="data_cna">
<assert_contents>
<has_text_matching expression="Hugo_Symbol"/>
<has_n_lines n="38322"/>
</assert_contents>
</element>
</output_collection>
<output_collection name="meta" type="list" count="15">
<element name="meta_clinical_patient">
<assert_contents>
<has_text_matching expression="cancer_study_identifier: acc_tcga_gdc"/>
<has_n_lines n="3"/>
</assert_contents>
</element>
<element name="meta_cna">
<assert_contents>
<has_text_matching expression="data_filename: data_cna.txt"/>
<has_n_lines n="7"/>
</assert_contents>
</element>
</output_collection>
<output name="report">
<assert_contents>
<has_text_matching expression="cBioPortal validation report"/>
</assert_contents>
</output>
</test>
<!-- test 3: no report -->
<test expect_num_outputs="2">
<param name="non_commercial_use" value="True"/>
<param name="study_id" value="acc_2019"/>
<output_collection name="data" type="list" count="8">
<element name="data_clinical_patient">
<assert_contents>
<has_text_matching expression="PATIENT_ID"/>
<has_n_lines n="1050"/>
</assert_contents>
</element>
<element name="data_cna">
<assert_contents>
<has_text_matching expression="Hugo_Symbol"/>
<has_n_lines n="21673"/>
</assert_contents>
</element>
</output_collection>
<output_collection name="meta" type="list" count="9">
<element name="meta_clinical_patient">
<assert_contents>
<has_text_matching expression="cancer_study_identifier: acc_2019"/>
<has_n_lines n="4"/>
</assert_contents>
</element>
<element name="meta_cna">
<assert_contents>
<has_text_matching expression="data_filename: data_cna.txt"/>
<has_n_lines n="8"/>
</assert_contents>
</element>
</output_collection>
</test>
</tests>
<help><![CDATA[
@COMMON_HELP@
Expand All @@ -98,10 +182,16 @@ This tool fetches data from cBioPortal using the Flexynesis `CBioPortalData`.

**Outputs**

Two collections of data and metadata datasets and an additional html report.
Two collections of data and metadata datasets and an additional html report (if available).


The available datasets can be checked from here_

If the study ID is not available, please contact the administrator of this Galaxy instance.

.. _Documentation: https://bimsbstatic.mdc-berlin.de/akalin/buyar/flexynesis/site/
.. _copyright holders: https://github.com/BIMSBbioinfo/flexynesis
.. _here: https://github.com/cBioPortal/datahub/
]]></help>
<expand macro="creator">
<person givenName="Polina" familyName="Polunina" email="polunina@informatik.uni-freiburg.de"/>
Expand Down
2 changes: 1 addition & 1 deletion tools/flexynesis/macros.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<macros>
<token name="@TOOL_VERSION@">0.2.20</token>
<token name="@VERSION_SUFFIX@">0</token>
<token name="@VERSION_SUFFIX@">1</token>
<token name="@PROFILE@">24.1</token>
<xml name="requirements">
<requirements>
Expand Down
2 changes: 2 additions & 0 deletions tools/flexynesis/test-data/loc.sample
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
lgg_tcga lgg_tcga 1
acc_tcga_gdc acc_tcga_gdc 1
acc_2019 acc_2019 1
Loading