Skip to content

Instantly share code, notes, and snippets.

View jmchilton's full-sized avatar

John Chilton jmchilton

  • Penn State University
  • Pittsburgh, PA
  • X @jmchilton
View GitHub Profile
toolshed.g2.bx.psu.edu/repos/devteam/cummerbund_to_tabular/cummerbund_to_cuffdiff
toolshed.g2.bx.psu.edu/repos/miller-lab/genome_diversity/gd_coverage_distributions
toolshed.g2.bx.psu.edu/repos/miller-lab/genome_diversity/gd_population_structure
Server running... press ctrl-c to stop.
Regenerating: 1 file(s) changed at 2020-07-09 12:50:54
topics/dev/images/core_plugins_overview.plantuml.txt
Warning: Empty `slug` generated for ''.
Warning: Empty `slug` generated for ''.
[2020-07-09 12:57:05] ERROR Errno::ECONNRESET: Connection reset by peer @ io_fillbuf - fd:17
/Users/john/miniconda3/envs/galaxy_training_material/lib/ruby/2.4.0/webrick/httpserver.rb:82:in `eof?'
/Users/john/miniconda3/envs/galaxy_training_material/lib/ruby/2.4.0/webrick/httpserver.rb:82:in `run'
/Users/john/miniconda3/envs/galaxy_training_material/lib/ruby/2.4.0/webrick/server.rb:308:in `block in start_thread'
@jmchilton
jmchilton / history_context.xml
Created May 5, 2015 19:11
Get the history name and encoded id from inside a Galaxy tool.
<tool id="history_context" name="history_context" version="1.0.0">
<command>
#set $history_id=$__app__.security.encode_id($output_dataset.creating_job.history.id)
#set $history_name=$output_dataset.creating_job.history.name
echo $history_id > $output_dataset;
echo $history_name >> $output_dataset;
</command>
<inputs>
<param name="ignored" type="integer" value="0" />
</inputs>
>>> import galaxy.tools.parser
>>> import galaxy.tools.parser.factory
>>> tool_source = galaxy.tools.parser.factory.get_tool_source("bwa.xml")
>>> reqs, _ = tool_source.parse_requirements_and_containers()
>>> from galaxy.tools.deps.conda_util import CondaTarget
>>> from galaxy.tools.deps.conda_util import hash_conda_packages
>>> hash_conda_packages([CondaTarget(req.name, req.version) for req in reqs])
'28bd91abdde0d474ee5121c1db757e2fe25984a7b393b5288912c68b29b67e02'
@jmchilton
jmchilton / run_random_lines_bioblend_example.py
Created July 24, 2014 15:59
Example script that runs Galaxy's random lines tool using bioblend.
# Setup Galaxy instance and dataset for testing...
from bioblend import galaxy
gi = galaxy.GalaxyInstance("localhost:8080", "1957431058be3aa3c57ca312f4a05521")
history = gi.histories.create_history(name="TestRandomLines")
dataset_id = gi.tools.paste_content("1\n2\n3", history["id"])['outputs'][0]["id"]
# Prepare tool inputs.
from bioblend.galaxy.tools.inputs import inputs, dataset
random_lines_inputs = inputs().set("num_lines", 1).set("input", dataset(dataset_id))
@jmchilton
jmchilton / gist:89db5844d72ae8326499
Created January 29, 2015 18:40
Cleaning up Docker...
# Remove stopped images...
sudo bash -c 'docker rm $(docker ps -a -q)'
sudo bash -c 'docker images -q --filter "dangling=true" | xargs docker rmi'
$ mulled-build --recipes-dir ../bioconda-recipes --targets 'samtools=1.3.1,bedtools=2.22' build
./involucro -v=3 -f /home/john/workspace/galaxy-lib/galaxy/tools/deps/mulled/invfile.lua -set CHANNELS='bioconda,conda-forge,r' -set TEST='true' -set TARGETS='samtools=1.3.1,bedtools=2.22' -set REPO='quay.io/mulled/mulled-v1-a93fa17175d6f093a6423535399b7ad4ac06ceed' build
[Sep 27 15:58:40] DEBU Run file [/home/john/workspace/galaxy-lib/galaxy/tools/deps/mulled/invfile.lua]
[Sep 27 15:58:40] STEP Run image [continuumio/miniconda:latest] with command [[rm -rf /data/dist]]
[Sep 27 15:58:40] DEBU Creating container [step-4ff4f7eeac]
[Sep 27 15:58:40] DEBU Created container [eb5cdfab2b12 step-4ff4f7eeac], starting it
[Sep 27 15:58:40] DEBU Container [eb5cdfab2b12 step-4ff4f7eeac] started, waiting for completion
[Sep 27 15:58:40] DEBU Container [eb5cdfab2b12 step-4ff4f7eeac] completed with exit code [0] as expected
[Sep 27 15:58:40] DEBU Container [eb5cdfab2b12 step-4ff4f7eeac] removed
[Sep 27 15:58:40] STEP Run image [
@jmchilton
jmchilton / PeptideShaker
Last active May 2, 2016 20:30
Wrapper scripts for PeptideShaker and SearchGUI, just drop these scripts in your PeptideShaker or SearchGUI directories. Allows easy uniform access to programs regardless of current working directory, hides class name details.
#!/bin/bash
SOURCE="${BASH_SOURCE[0]}"
app_dir="$( dirname "$SOURCE" )"
while [ -h "$SOURCE" ]
do
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
app_dir="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
done
class: CommandLineTool
cwlVersion: "cwl:draft-3"
baseCommand: python
arguments:
- valueFrom: input.txt
position: 1
requirements:
- class: CreateFileRequirement
fileDef:
- filename: input.txt
@jmchilton
jmchilton / gist:8443052
Created January 15, 2014 19:43
Galaxy History Dataset Association Children
11:56 < jmchilton> I am trying to understand hda.children - is the only for an hda to have a child if a tool output is
specified this way. Is anything else a parent/child (implicit conversions, etc...)?
11:57 < jmchilton> And more specifically - should it possible for a parent to be 'deleted' but not the child?
....
13:22 < jmchilton> Well you cannot purge datasets with children because of a bug in user.quota_amount. I am assuming this
feature doesn't get used much :)
13:27 < natefoo> galaxy_main=> select count(*) from history_dataset_association where parent_id is not null;
13:27 < natefoo> count
13:27 < natefoo> -------
13:27 < natefoo> 30