Skip to content

Instantly share code, notes, and snippets.

View ksuderman's full-sized avatar

Keith Suderman ksuderman

View GitHub Profile
@ksuderman
ksuderman / Instructions.md
Last active June 3, 2024 20:07
Patch to fix NFS permission problems

Installations instructions

PR #314 had the unfortunate side effect of breaking some tools with permission denied or file not found errors. This affects Helms chart versions 5.10.0 through 5.14.0. Until that PR is rolled back please add the above YAML snippet when installing Galaxy to Kubernetes with the Galaxy Helm chart.

  1. Use curl to download the nfs-fix.yml file. If you copy/paste the nfs-fix.yml file be sure to do so from the raw view
curl -o nfs-fix.yml https://gist.githubusercontent.com/ksuderman/7147b41832ab9434a243fbe58141a7a4/raw/c29820b60de205b0ab55d9d1c92acdaffa3894bb/nfs-fix.yml
  1. Include the nfs-fix.yml file as one of the --values files in the helm install command.
@ksuderman
ksuderman / gist.txt
Created May 11, 2024 13:29
Pod details for failed SnpEff job
apiVersion: v1
kind: Pod
metadata:
name: gxy-galaxy-7sfwd-bcf7s
generateName: gxy-galaxy-7sfwd-
namespace: galaxy
uid: 6d31be0a-146b-498a-82ad-1cd91f99d7ac
resourceVersion: '77286'
creationTimestamp: '2024-05-11T08:49:46Z'
labels:
@ksuderman
ksuderman / GalaxyTests1C.md
Created October 30, 2023 19:37
Galaxy Test Summary

The approximate number and type of each kind of tests run as GitHub actions as of Oct 30, 2023

Test Number
API 1724
Client 834
Converter 109
DB Migration 92
Framework 360
Integration 889
@ksuderman
ksuderman / log-timing.py
Created October 19, 2023 16:04
Compare greedy vs lazy string interpolation in log messages
# A simple timing test to compare lazy and greedy string interpolation
# in log messages
import timeit
# Debug messages will not be logged
SETUP = '''
import logging
logging.basicConfig(level=logging.WARNING)
log = logging.getLogger("mylogger")
@ksuderman
ksuderman / render_template.py
Created January 25, 2023 18:26
Python script to render Jinja2 templates
#!/usr/bin/env python3
import os
import sys
import yaml
import argparse
from jinja2 import Template
from pprint import pprint
def render_template(template, values):
@ksuderman
ksuderman / ask-galaxy.py
Created November 6, 2022 00:02
Python script to query the AskGalaxy service to generate CSV data for Observable.
#!/usr/bin/env python3
import os
import sys
import json
import requests
KB = 1024
MB = KB * KB
GB = MB * KB
@ksuderman
ksuderman / abm_sample.csv
Created September 27, 2022 21:27
Sample ABM output
job_id tool_id tool_version state memory.max_usage_in_bytes cpuacct.usage process_count galaxy_slots runtime_seconds ref_data_size input_data_size
ce4eadcc6a9dc62d toolshed.g2.bx.psu.edu/repos/iuc/hisat2/hisat2/2.1.0+galaxy7 2.1.0+galaxy7 ok 10230325248.0000000 1524636164586.0000000 32.0000000 1.0000000 1467.0000000 0 1407644464
b944eb0f5f220e64 toolshed.g2.bx.psu.edu/repos/iuc/minimap2/minimap2/2.24+galaxy0 2.24+galaxy0 ok 23552430080.0000000 1284559376976.0000000 32.0000000 1.0000000 1242.0000000 0 1407644464
8510271abb9e802c toolshed.g2.bx.psu.edu/repos/devteam/bowtie2/bowtie2/2.4.2+galaxy0 2.4.2+galaxy0 ok 8763760640.0000000 5420490778352.0000000 32.0000000 1.0000000 5462.0000000 0 1407644464
7c2d1b475743f5b6 toolshed.g2.bx.psu.edu/repos/devteam/bwa/bwa_mem/0.7.17.1 0.7.17.1 ok 12500324352.0000000 9858370786969.0000000 32.0000000 1.0000000 9451.0000000 0 1407644464
@ksuderman
ksuderman / sample_help.sh
Last active February 1, 2023 12:37
Print simple help with ANSI highlighting
# ANSI color codes for the console.
reset="\033[0m"
bold="\033[1m"
ital="\033[3m" # does not work on OS X
# Function used to highlight text.
function hi() {
echo -e "$bold$@$reset"
}
@ksuderman
ksuderman / bumpleo
Created August 15, 2022 18:11
Updates the GalaxyKubeman versions in Leo
#!/usr/bin/env bash
# Use this script to update the GalaxyKubeman Helm chart versions in Leo
#
# Put this script on your path and run from the root Leonardo source directory.
# > cd /home/user/leonardo
#
# USAGE
# > bumpleo <new version>
#
@ksuderman
ksuderman / run_workflow.py
Last active July 23, 2021 18:45
Example of running a Galaxy workflow with BioBlend
"""
This script is loosely based on https://github.com/galaxyproject/bioblend/blob/main/docs/examples/run_imported_workflow.py
TO-DO
1. Allow the user to specify an output history.
2. Maybe allow the user to specify a URL to data that should be uploaded to
the server to be used as input to the workflow.
3. Don't assume the name of the input parameter is 'input'
usage: workflows.py [-h] [-s SERVER] [-a API_KEY] -w WORKFLOW -d DATASET