forked from bgruening/galaxytools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflexynesis_cbioportal_import.xml
More file actions
206 lines (195 loc) · 10.7 KB
/
flexynesis_cbioportal_import.xml
File metadata and controls
206 lines (195 loc) · 10.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<tool id="flexynesis_cbioportal_import" name="Flexynesis cBioPortal import" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
<description>and prepare cBioPortal data for Flexynesis analysis</description>
<macros>
<import>macros.xml</import>
</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' &&
mv $str($study_id)/data* output/data/ &&
mv $str($study_id)/meta* output/meta/ &&
#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>
<configfiles>
<configfile name="cbio_config"><![CDATA[
from flexynesis.utils import CBioPortalData
from contextlib import redirect_stdout
cbioportal = CBioPortalData(study_id='$study_id')
cbioportal.get_cbioportal_data(study_id='$study_id')
]]></configfile>
</configfiles>
<inputs>
<expand macro="commercial_use_param"/>
<param name="study_id" label="cBioPortal study ID" type="select" help="contact the administrator of this Galaxy instance if you miss a study ID">
<options from_data_table="cbioportal">
<filter type="static_value" value="1" column="2"/>
</options>
</param>
</inputs>
<outputs>
<collection name="data" type="list" label="${tool.name} on ${study_id}: datasets">
<discover_datasets pattern="__name_and_ext__" format="tabular" directory="output/data"/>
</collection>
<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">
<!-- note about the filter here:
Not all studies in the cbioportal datahub have html reports.
The main repository can be find here: https://github.com/cBioPortal/datahub/
Two studies in https://github.com/cBioPortal/datahub/tree/master/public have html reports (as .htm files),
and studies in crdc here: https://github.com/cBioPortal/datahub/tree/master/crdc have html reports
So from 479 studies only 51 have this report. -->
<filter>study_id in ['lgg_tcga', 'cesc_tcga', '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']</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"/>
<output_collection name="data" type="list" count="17">
<element name="data_clinical_patient">
<assert_contents>
<has_text_matching expression="PATIENT_ID"/>
<has_n_lines n="520"/>
</assert_contents>
</element>
<element name="data_cna">
<assert_contents>
<has_text_matching expression="Hugo_Symbol"/>
<has_n_lines n="24777"/>
</assert_contents>
</element>
</output_collection>
<output_collection name="meta" type="list" count="18">
<element name="meta_clinical_patient">
<assert_contents>
<has_text_matching expression="cancer_study_identifier: lgg_tcga"/>
<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>
<output name="report">
<assert_contents>
<has_text_matching expression="cBioPortal validation report"/>
</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="Entrez_Gene_Id"/>
<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="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>
<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@
**Flexynesis cBioPortal import**
This tool fetches data from cBioPortal using the Flexynesis `CBioPortalData`.
**Inputs**
- **cBioPortal study ID**: The identifier of the study to fetch (e.g., `brca_tcga`, `lgg_tcga`). Find study IDs on the cBioPortal.
**Outputs**
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>
<expand macro="citations"/>
</tool>