This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################ | |
# Update and install OS packages | |
# https://docs.anaconda.com/anaconda/install/silent-mode/#linux-macos | |
################################################################################ | |
RUN curl --location --fail --remote-name \ | |
https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh \ | |
&& bash Miniforge3-Linux-x86_64.sh -b -p /opt/conda -u \ | |
&& rm Miniforge3-Linux-x86_64.sh | |
############################################################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("Hello") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abuilder = SamBuilder(r1_len=20, r2_len=20) | |
(read1, read2) = builder.add_pair( | |
name="query", | |
chrom1="chr1", | |
start1=100, | |
bases1="A" * 10, | |
chrom2="chr1", | |
start2=200, | |
bases2="C" * 20, | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM debian:bookworm-20250113-slim AS base | |
ENV LANG=C.UTF-8 | |
RUN apt-get update \ | |
&& apt-get install -y --no-install-recommends \ | |
build-essential \ | |
cmake \ | |
git \ | |
gnupg \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def dna_sequence_from_DAS(build: str, chrom: str, start: int, end: int) -> str: | |
""" | |
Return the DNA sequence along an interval for a reference sequence build. | |
Uses the DAS web server. | |
Args: | |
build: The UCSC genome build. | |
chrom: The reference sequence name. | |
start: The 1-based start locus. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MethodType: | |
"""A Python-equivalent method type that binds type arguments to the calling class.""" | |
def __init__(self, func: Callable, obj: object) -> None: | |
"""Initialize this method with the calling class and function.""" | |
self.__func__ = func | |
self.__self__ = obj | |
self._generic_classmethod = False | |
def __call__(self, *args: object, **kwargs: object) -> object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_classmethod(method: FunctionType) -> bool: | |
"""Determine if a method is a classmethod or not by searching for a classmethod sentinel.""" | |
bound_to = getattr(method, "__self__", None) | |
if not isinstance(bound_to, type): | |
return False | |
name = method.__name__ | |
for clazz in bound_to.__mro__: | |
descriptor = vars(clazz).get(name) | |
if descriptor is not None: | |
return isinstance(descriptor, classmethod) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
cat <<- EOM | |
#!/usr/bin/env sh | |
set -e | |
PROP_OPTS=() | |
MEM_OPTS=() | |
PASS_ARGS=() | |
DEFAULT_MEM_OPTS=('-Xms512m' '-XX:+AggressiveHeap') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Attempts to compile the groovy present in nextflow/lib/ with the groovy compiler and nextflow | |
# libararies properly linked (because they dont live in a place groovy can find them by default.) | |
# | |
# Must have a conda env with nextflow and groovy installed in order for this script to work. | |
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Convert DOT graph data into a terminal-ready visualization | |
function idot { | |
dot \ | |
-Tpng -Gdpi=300 \ | |
-Efontsize=18 -Efontname=sans -Nfontname=sans \ | |
-Gbgcolor=black -Gcolor=white -Ecolor=white -Efontcolor=white -Ncolor=white -Nfontcolor=white \ | |
| convert -trim -bordercolor black -border 20 -transparent black -resize "60%" - - \ | |
| imgcat # Or swap with your favorite terminal image viewer | |
} |
NewerOlder