Skip to content

Instantly share code, notes, and snippets.

View corneliusroemer's full-sized avatar

Cornelius Roemer corneliusroemer

View GitHub Profile
@corneliusroemer
corneliusroemer / add-branch-labels.py
Created February 22, 2023 19:49
Script to add node data as branch label
import argparse
import json
def extract_attribute(node_data, attribute: str) -> dict[str, str]:
data = {}
for name, node in node_data["nodes"].items():
if attribute in node:
data[name] = node[attribute]
return data
[tool.poetry]
name = "nwkfmt"
version = "0.1.0"
description = "Simple Newick tree validator and formatter"
authors = ["Cornelius Roemer <[email protected]>"]
readme = "README.md"
[tool.poetry.scripts]
greet = "nwkfmt.cli:main"
>MN908947 (Wuhan-Hu-1/2019)
TTELLFLVMFLLTTKRTMFVFLVLLPLVSSQCVNLTTRTQLPPAYTNSFTRGVYYPDKVFRSSVLHSTQDLFLPFFSNVTWFHAIHVSGTNGTKRFDNPVLPFNDGVYFASTEKSNIIRGWIFGTTLDSKTQSLLIVNNATNVVIKVCEFQFCNDPFLGVYYHKNNKSWMESEFRVYSSANNCTFEYVSQPFLMDLEGKQGNFKNLREFVFKNIDGYFKIYSKHTPINLVRDLPQGFSALEPLVDLPIGINITRFQTLLALHRSYLTPGDSSSGWTAGAAAYYVGYLQPRTFLLKYNENGTITDAVDCALDPLSETKCTLKSFTVEKGIYQTSNFRVQPTESIVRFPNITNLCPFGEVFNATRFASVYAWNRKRISNCVADYSVLYNSASFSTFKCYGVSPTKLNDLCFTNVYADSFVIRGDEVRQIAPGQTGKIADYNYKLPDDFTGCVIAWNSNNLDSKVGGNYNYLYRLFRKSNLKPFERDISTEIYQAGSTPCNGVEGFNCYFPLQSYGFQPTNGVGYQPYRVVVLSFELLHAPATVCGPKKSTNLVKNKCVNFNFNGLTGTGVLTESNKKFLPFQQFGRDIADTTDAVRDPQTLEILDITPCSFGGVSVITPGTNTSNQVAVLYQDVNCTEVPVAIHADQLTPTWRVYSTGSNVFQTRAGCLIGAEHVNNSYECDIPIGAGICASYQTQTNSPRRARSVASQSIIAYTMSLGAENSVAYSNNSIAIPTNFTISVTTEILPVSMTKTSVDCTMYICGDSTECSNLLLQYGSFCTQLNRALTGIAVEQDKNTQEVFAQVKQIYKTPPIKDFGGFNFSQILPDPSKPSKRSFIEDLLFNKVTLADAGFIKQYGDCLGDIAARDLICAQKFNGLTVLPPLLTDEMIAQYTSALLAGTITSGWTFGAGAALQIPFAMQMAYRFNGIGVTQNVLYENQKLIANQFNSAIGKIQDSLSSTASALGKLQDVVNQNAQALNTLVKQLSSNFGAISSVLND
{
"nucMutLabelMap": {
"A10195G": [
"20I (Alpha, V1)"
],
"A10317G": [
"21J (Delta)"
],
"A10323G": [
"21J (Delta)",
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@corneliusroemer
corneliusroemer / JQfix
Created April 23, 2020 16:12
JQ fix of inconsistent timestamps
jq 'if .topic == "devices_overview" then .timestamp = (.timestamp * 1000 | round | tostring) else . end' <out
@corneliusroemer
corneliusroemer / diffscript
Created April 21, 2020 15:05
Comparing text files, only changed lines shown, changed words color highlighted
diff -U 0 gry gryold | wdiff -d | colordiff
@corneliusroemer
corneliusroemer / findgunzip.sh
Last active April 16, 2020 14:46
Extract and concatenate all .gz files in all subdirectories into a new text file without touching the original files
find . -name '*.gz' -exec gzip -ckd {} + > test.txt
@corneliusroemer
corneliusroemer / UndeliverableEmailExtractor.js
Created January 17, 2020 19:21
Google Apps Script that searches for "undeliverable" emails and extracts email addresses that bounced. Pastes emails and context into Google Sheet for analysis.
function processInboxToSheet() {
var threads = GmailApp.search("Undeliverable", 0, 500)
//Replace ID with one of your private spreadsheets ID
var sheet = SpreadsheetApp.openById("16RsL_4fh0WXSICw5VJDHVAKtija21JBxxxxxxxxx").getActiveSheet();
for (var i = 0; i < threads.length; i++) {
var messages = threads[i].getMessages();
for (var j = 0; j < messages.length; j++){
var subject = messages[j].getSubject();
var content = messages[j].getPlainBody();
var date = messages[j].getDate();