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 | |
# ssn (show slurm nodes) lists SLURM nodes | |
# bash ssn.sh | less -SR | |
# to fix colors run echo -e '\033[0m' | |
# Define ANSI color codes | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
YELLOW='\033[0;33m' |
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
pip install --user ruff black isort pre-commit codespell | |
echo 'repos: | |
- repo: https://github.com/psf/black | |
rev: 24.8.0 | |
hooks: | |
- id: black | |
- repo: https://github.com/PyCQA/isort | |
rev: 5.13.2 |
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 | |
################################################################################# | |
# Description: This script automates the setup of a Rust development environment | |
################################################################################# | |
# Define color codes for output formatting | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
YELLOW='\033[0;33m' |
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
# The script fetches and prints genetic variants from the gnomAD database for a specified genomic region. | |
# Adapted from https://gist.github.com/ressy/6fd7f6ee6401ac8e703dc2709399869e | |
import re | |
import sys | |
from pprint import PrettyPrinter | |
from typing import Any, Dict, Tuple | |
import fire | |
import requests | |
import tenacity |
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 | |
# Script to archive a specified directory | |
# Install dependencies: | |
# mamba install -y -c conda-forge pv crabz | |
# Ensure the script exits immediately if any command fails | |
set -e | |
# Cleanup function |
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
import yfinance as yf | |
import numpy as np | |
from sklearn.covariance import LedoitWolf | |
from scipy.optimize import minimize | |
import pandas as pd | |
from typing import Tuple | |
from typing import Optional | |
def shrinkage(returns: np.array) -> Tuple[np.array, float, float]: | |
# from https://github.com/WLM1ke/LedoitWolf/ |
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 | |
############################################################################# | |
# Script: restore_from_glacier.sh | |
# Description: | |
# This script restores files and folders recursively from | |
# Amazon S3 Glacier for a given S3 path. It checks if the restore | |
# is already in progress and initiates the restore for objects | |
# that are not currently being restored. The default values for |
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
mamba create --name ichorCNA && \ | |
mamba activate ichorCNA && \ | |
mamba install -y -c conda-forge -c bioconda r-essentials r-base r-devtools hmmcopy bioconductor-genomeinfodb bioconductor-genomicranges r-ichorcna && \ | |
cd $CONDA_PREFIX/lib/R/library/ichorCNA/ && \ | |
mkdir -p tmp && \ | |
git clone https://github.com/broadinstitute/ichorCNA.git tmp && \ | |
cp -r ./tmp/scripts/ . | |
# dry-run | |
Rscript $CONDA_PREFIX/lib/R/library/ichorCNA/scripts/runIchorCNA.R |
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
import os | |
import requests | |
import shutil | |
from tqdm import tqdm | |
def download_file(url: str, file_path: str) -> None: | |
""" | |
Downloads a file from the given URL and saves it to the specified file path. | |
Shows a progress bar using the tqdm library. |
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 print_columns(data: list, num_cols : int): | |
""" | |
Prints the elements of a list in columns. | |
Args: | |
data: A list of data to be printed. | |
num_cols: The number of columns to print. | |
Returns: | |
None |
NewerOlder