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
@jmchilton
jmchilton / gist:4164c07f3443e811982f
Created January 20, 2015 02:06
Mass Spec Merge Script by JJ
library(mzR)
library(msdata)
library(jsonlite)
library("RSQLite")
z <- openMSfile("iTRAQ_Erwinia.mzML")
x <- openIDfile("iTRAQ_Erwinia.mzid")
p <- psms(x)
m <- modifications(x)
s <- score(x)
## add a column for the scanNum by parsing
@jmchilton
jmchilton / backport.sh
Created January 15, 2015 21:03
backport.bash output
#!/bin/sh
tags="
latest_2013.06.03:/tmp/old.patch
latest_2013.08.12:/tmp/old.patch
latest_2013.11.04:/tmp/old.patch
latest_2014.02.10:/tmp/new.patch
latest_2014.04.14:/tmp/new.patch
latest_2014.06.02:/tmp/new.patch
latest_2014.08.11:/tmp/new.patch
# Is dataset an image?
image = check_image( dataset.path )
if image:
if not PIL:
image = None
# get_image_ext() returns None if nor a supported Image type
ext = get_image_ext( dataset.path, image )
data_type = ext
# Is dataset content multi-byte?
elif dataset.is_multi_byte:
from bioblend import toolshed
ts = toolshed.ToolShedInstance(url='http://localhost:9009/', key="3eb77b8c27ae339e1d8056473ce1d6c2")
print ts.key
rl = ts.repositories.update_repository('adb5f5c93f827949', 'test_repo.tar.gz')
print rl
@jmchilton
jmchilton / ts.patch
Created September 25, 2014 18:59
more tool shed resolver logging
diff --git a/lib/galaxy/tools/deps/resolvers/tool_shed_packages.py b/lib/galaxy/tools/deps/resolvers/tool_shed_packages.py
index d72b4d6..c54885f 100644
--- a/lib/galaxy/tools/deps/resolvers/tool_shed_packages.py
+++ b/lib/galaxy/tools/deps/resolvers/tool_shed_packages.py
@@ -3,6 +3,9 @@ from os.path import abspath, join, exists
from .galaxy_packages import GalaxyPackageDependencyResolver, GalaxyPackageDependency
from ..resolvers import INDETERMINATE_DEPENDENCY
+import logging
+log = logging.getLogger( __name__ )
@jmchilton
jmchilton / gist:9e56a8862f13d89e6952
Created August 11, 2014 12:55
universe_wsgi.ini changes for August release.
Summary of new options added to universe_wsgi.ini:
display_chunk_size - Size of chunks to use when incrementally loading tabular data in the web browser.
citation_cache_type, citation_cache_data_dir, citation_cache_lock_dir - Tool citation (add this release) information maybe fetched from external sources such as http://dx.doi.org/ by Galaxy - these parameters can be used to control the caching used to store this information.
job_resource_params_file - An experimental feature allowing deployers to inject extra parameters into the tool form that can be parsed and used when allocating resources via dynamic job destinations. This option describes the tool form elements.
Options that have been removed: rsync_url, genome_data_path.
PR # Open Date Merge/Decline Date
-------------------------------------------
PR 1: 2011-07-03 - 2011-08-03
PR 4: 2011-07-25 - 2011-09-01
PR 5: 2011-08-18 - 2011-10-10
PR 8: 2011-10-05 - 2013-01-17
PR 13: 2011-10-16 - 2013-09-11
PR 177/241: 2013-06-06 - 2014-07-09
PR 419: 2014-06-13 - 2014-07-30
diff --git a/lib/galaxy/util/topsort.py b/lib/galaxy/util/topsort.py
index 80c6bd3..84cedae 100644
--- a/lib/galaxy/util/topsort.py
+++ b/lib/galaxy/util/topsort.py
@@ -31,9 +31,10 @@ then CycleError is raised, and the exception object supports
many methods to help analyze and break the cycles. This requires
a good deal more code than topsort itself!
"""
-
+from collections import OrderedDict
from galaxy.util import topsort
def test_topsort_level_stability():
data = [
(0, 2),
(1, 2),
(2, 3),
(2, 4),
(3, 4),
@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))