Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Planemo-generated test outputs
tool_test_output.html
tool_test_output.json

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[codz]
Expand Down
12 changes: 12 additions & 0 deletions tools/gdc-downloader/dependencies/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM ubuntu:20.04 AS builder

RUN apt-get update && \
apt-get install -y --no-install-recommends wget unzip ca-certificates && \
wget https://gdc.cancer.gov/system/files/public/file/gdc-client_2.3_Ubuntu_x64-py3.8-ubuntu-20.04.zip && \
unzip gdc-client_2.3_Ubuntu_x64-py3.8-ubuntu-20.04.zip && \
unzip gdc-client_2.3_Ubuntu_x64.zip && \
chmod 755 gdc-client

FROM ubuntu:20.04

COPY --from=builder /gdc-client /usr/local/bin/gdc-client
86 changes: 86 additions & 0 deletions tools/gdc-downloader/gdc-downloader.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0"?>
<tool
id="gdc_downloader"
name="GDC Data Downloader"
version="0.0.1"
hidden="false"
profile="25.1"
>
<description>Acquire data from the NCI Genomic Data Commons</description>
<command><![CDATA[
mkdir ./downloads &&
mkfifo -m 600 token.pipe &&
(printf '%s' "\$GDC_AUTH_TOKEN" > token.pipe &) &&
gdc-client download -m "$manifest_file" -t token.pipe -d ./downloads &&
rm -f token.pipe &&
rm -rf ./downloads/*/logs
]]></command>
<requirements>
<container type="docker">quay.io/goeckslab/gdc-client:2.3</container>
<credentials
name="gdc_auth"
version="1.0"
optional="true"
label="GDC credentials"
description="Used when acquiring protected datasets you are authorized to access"
>
<secret
name="gdc_token"
inject_as_env="GDC_AUTH_TOKEN"
label="Authorization token"
description="Acquired from the GDC portal"
/>
</credentials>
</requirements>
<inputs>
<param
name="manifest_file"
type="data"
format="txt"
label="Manifest file downloaded from GDC"
/>
</inputs>
<outputs>
<collection name="gdc_files" type="list" label="GDC files from manifest">
<discover_datasets pattern="__name_and_ext__" directory="downloads" recurse="true" />
</collection>
</outputs>
<tests>
<test expect_num_outputs="1">
<param name="manifest_file" value="test-manifest.txt" ftype="txt" />
<output_collection name="gdc_files" type="list" count="1">
<element name="TCGA-E2-A15K-11A-01-TS1.28656e31-f16f-431e-95d4-915892ecdff8">
<assert_contents>
<has_size value="43659635" />
</assert_contents>
</element>
</output_collection>
</test>
</tests>
<help><![CDATA[
**What it does**

Downloads data files from the `NCI Genomic Data Commons (GDC) <https://portal.gdc.cancer.gov/>`_ using
``gdc-client``, based on a GDC manifest file.

**Manifest**

The input is a manifest file listing the files to download, generated from the
`GDC Data Portal <https://portal.gdc.cancer.gov/>`_ (e.g. via the cart download option).

**Authorization token (optional)**

A GDC authorization token is only required to download **controlled-access** datasets; open-access
data can be downloaded without one. Tokens are also obtained from the
`GDC Data Portal <https://portal.gdc.cancer.gov/>`_, under your account profile.

To use your authorization token, store it using Galaxy's credentials
system, which keeps it encrypted and injects it securely at runtime. See
`Galaxy's credentials documentation <https://galaxyproject.org/news/2026-01-12-tool-credentials-system/#how-to-use-it-for-galaxy-users>`_
for instructions on adding your GDC token as a credential.

**Output**

A collection containing the files listed in the manifest, as downloaded from the GDC.
]]></help>
</tool>
2 changes: 2 additions & 0 deletions tools/gdc-downloader/test-data/test-manifest.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id filename md5 size state
360367d5-4aa4-4c32-aaf3-7d8528aec089 TCGA-E2-A15K-11A-01-TS1.28656e31-f16f-431e-95d4-915892ecdff8.svs 7c401ac82c290ff845f8262fa8e41798 43659635 released
Loading