Skip to content

Instantly share code, notes, and snippets.

View natefoo's full-sized avatar

Nate Coraor natefoo

View GitHub Profile
import os
import subprocess
import time
from datetime import (
date,
datetime,
)
import click
import psutil
#!/usr/bin/env python3
import os
import traceback
import click
from rich import progress
from tusclient.fingerprint import fingerprint
from bioblend import ConnectionError
from bioblend.galaxy import GalaxyInstance
#!/usr/bin/env python3
# Quick and dirty script to update usegalaxy-tools with missing tools fron GTN trainings. Note that this installs the
# newest versions of things, not necessarily the version specified in the training json.
import argparse
import os
import pathlib
import string
import subprocess
import sys
@natefoo
natefoo / manumull.md
Last active March 8, 2023 18:57
Galaxy/BioContainers mulled container command line utilities

Manually mulling container images

This is occasionally necessary e.g. when trying to build images for old software or old versions that won't be supported by BioContainers, custom channels, etc.

Another common use case is for when you are trying to run a Galaxy tool that is missing a requirement specification for something it depends on (this is common especially with older tools that assumed Python would be present) or that requires older conda packages that did not fully specify their dependencies.

Prerequisites

You will need Docker on whatever host you plan to run on. Singularity is not required (even if building Singularity images) since the Singularity build occurs in Docker.

#!/usr/bin/env python
"""
Finds datasets on disk that shouldn't be there.
This script is not object-store aware. You just point it at directories that are DiskObjectStore backends (e.g.
file_path in the Galaxy config by default).
"""
from __future__ import absolute_import, print_function
import sys
#!/usr/bin/env python3
# run with:
# find topics -name \*.md -type f -print0 | xargs -0 python3 lamefix.py
import fileinput
import sys
def fix(mdfileobj):
in_diff = False
min_length = sys.maxsize
SELECT
subq.*,
(subq.total_size_mb / subq.input_count)::INT8 AS average_size_mb,
(subq.mem_used_mb / subq.total_size_mb)::INT8 AS mem_inputs_ratio,
(subq.mem_used_mb / greatest(subq.total_size_mb / subq.input_count, 1))::INT8 AS mem_avg_input_ratio
FROM
(
SELECT
subq2.*
FROM
SELECT
rank_filter.*
FROM
(
SELECT
job.id AS job_id,
job.create_time AS job_create_time,
job.update_time AS job_update_time,
job.history_id AS job_history_id,
job.library_folder_id AS job_library_folder_id,
RefactoringTool DEBUG 2021-02-10 22:58:00,404 Refactoring auto_translate_cheetah
galaxy.jobs.runners ERROR 2021-02-10 22:58:01,444 (33368295) Failure preparing job
Traceback (most recent call last):
File "/cvmfs/main.galaxyproject.org/galaxy/lib/galaxy/util/__init__.py", line 1039, in unicodify
value = str(value)
File "/cvmfs/main.galaxyproject.org/venv/lib/python3.6/site-packages/Cheetah/Template.py", line 1053, in __unicode__
return getattr(self, mainMethName)()
File "cheetah_DynamicallyCompiledCheetahTemplate_1613019481_1763794_97887.py", line 157, in respond
TypeError: 'NoneType' object is not callable