Discover tools and input names
FASTQC_TOOL=$(galaxy-cli tool search fastqc | jq -r '.[0].id')
MULTIQC_TOOL=$(galaxy-cli tool search multiqc | jq -r '.[0].id')
galaxy-cli tool show "$FASTQC_TOOL"
galaxy-cli --human tool show "$MULTIQC_TOOL"
galaxy-cli tool show "$MULTIQC_TOOL" \
| jq '.inputs[] | select(.name == "results")'
Create and inspect a history
HID=$(galaxy-cli history create "qc $(date +%F)" | jq -r .id)
galaxy-cli history show "$HID"
galaxy-cli history show "$HID" --contents
galaxy-cli dataset list --history-id "$HID"
Upload and inspect datasets
R1=$(galaxy-cli dataset upload reads_R1.fastq.gz \
--history-id "$HID" \
--file-type fastqsanger.gz | jq -r .id)
galaxy-cli dataset show "$R1" --history-id "$HID"
galaxy-cli dataset peek "$R1" --lines 5
Create collections
PAIR=$(galaxy-cli collection create sampleA \
--history-id "$HID" \
--collection-type paired \
--forward "$R1" \
--reverse "$R2" | jq -r .id)
galaxy-cli collection show "$PAIR"
Run FastQC with JSON inputs
cat > fastqc_inputs.json <<EOF
{"input_file": "hda:$R1"}
EOF
galaxy-cli tool run "$FASTQC_TOOL" \
--history-id "$HID" \
--inputs-json fastqc_inputs.json
Run MultiQC on FastQC raw data
cat > multiqc_inputs.json <<EOF
{
"results": [
{
"software_cond": {
"software": "fastqc",
"output": [
{
"type": "data",
"input": [
{"src": "hda", "id": "$FASTQC_DATA_1"},
{"src": "hda", "id": "$FASTQC_DATA_2"}
]
}
]
}
}
],
"flat": true,
"export": true
}
EOF
galaxy-cli tool run "$MULTIQC_TOOL" \
--history-id "$HID" \
--inputs-json multiqc_inputs.json
Debug failed jobs
galaxy-cli job list --history-id "$HID" --state error
galaxy-cli job show "$JOB_ID"
galaxy-cli job show "$JOB_ID" --logs
galaxy-cli job wait "$JOB_ID" --timeout 1800
Download outputs
galaxy-cli dataset download "$REPORT_ID" multiqc_report.html
galaxy-cli dataset download "$DATA_ZIP_ID" multiqc_data.zip
galaxy-cli history export "$HID"
Run and export workflows
WF=$(galaxy-cli workflow import workflow.ga | jq -r .id)
galaxy-cli workflow show "$WF"
galaxy-cli workflow run "$WF" \
--history-id "$HID" \
-i 0="$R1" \
--wait
galaxy-cli workflow export "$WF" -o workflow.ga