This file contains hidden or 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
#!/usr/bin/env bash | |
echo $1 | rev | tr TAGC ATCG |
This file contains hidden or 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
# reorder manually | |
import pandas as pd | |
df = pd.DataFrame({'x': ['low', 'medium', 'high', 'medium']}) | |
df['x'] = df['x'].astype('category') | |
df['x'] = df['x'].cat.reorder_categories(['low', 'medium', 'high'], ordered=True) | |
# reorder by another variable |
This file contains hidden or 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
#!/usr/bin/env bash | |
# | |
# | |
PS3="Select an option: " | |
select opt in "Option 1" "Option 2" "Quit"; do | |
echo "You picked $opt" | |
break | |
done |
This file contains hidden or 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 pandas as pd | |
from pathlib import Path | |
COLSPECS = [ | |
(0, 6), (6, 11), (12, 16), (16, 17), (17, 20), | |
(21, 22), (22, 26), (26, 27), (30, 38), (38, 46), | |
(46, 54), (54, 60), (60, 66), (72, 76), (76, 78), | |
(78, 80) | |
] |
This file contains hidden or 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
#!/usr/bin/env python | |
import pyarrow.parquet as pq | |
import pyarrow as pa | |
import glob | |
import sqlite3 | |
import polars as pl | |
from pathlib import Path | |
from tqdm import tqdm | |
import sys |
This file contains hidden or 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
#!/usr/bin/env bash | |
# | |
# A program to remove protons from pdb files | |
# | |
mkdir -p $1-deprotonated | |
fd -t f -e .pdb . $1 | | |
parallel --eta "pdb_delelem -H {} > $1-deprotonated/{/}" |
This file contains hidden or 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
IMGT_FRAMEWORK = { | |
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, | |
21, 22, 23, 24, 25, 26, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, | |
55, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, | |
87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 118, 119, | |
120, 121, 122, 123, 124, 125, 126, 127, 128, 129 | |
} | |
# Coreset is a minimally varying set of positions (in physical space) |
This file contains hidden or 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
Mononoki | |
Fira Code | |
Cascadia Code | |
Monospace | |
Comic Mono | |
Agave | |
Inconsolata | |
JetBrains Mono | |
Cousine | |
Ubuntu Mono |
This file contains hidden or 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
#!/usr/bin/env bash | |
# fasta_converter.sh | |
# | |
usage() { | |
echo "Usage: $0 [-i input_file.csv] [-o output_file.fasta]" | |
echo " -i : Specify the input file (CSV). If omitted, reads from stdin." | |
echo " -o : Specify the output file (FASTA). If omitted, writes to stdout." | |
echo " -h : Display this help and exit." | |
exit 1 | |
} |
This file contains hidden or 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 | |
from concurrent.futures import ThreadPoolExecutor | |
from urllib.parse import urlparse | |
def download_urls(url_list, download_dir, max_threads=5): | |
if not os.path.exists(download_dir): | |
os.makedirs(download_dir) | |
def download_url(url): |
NewerOlder