Skip to content

Instantly share code, notes, and snippets.

View moritzschaefer's full-sized avatar

Moritz moritzschaefer

View GitHub Profile
@moritzschaefer
moritzschaefer / alphafold_integrate_uncertainty.py
Created August 9, 2021 18:50
Integrate the plddt-uncertainty from AlphaFold into the generated PDBs, "abusing" the b-factor field
#!/usr/bin/env python
# coding: utf-8
'''
Simply run this script in the output folder of an AlphaFold-run. For more infos on the pLDDT, refer to the original AlphaFold publication (https://www.nature.com/articles/s41586-021-03819-2)
https://github.com/deepmind/alphafold/issues/8
'''
import json
@afrendeiro
afrendeiro / get_gene_set_libraries.py
Last active March 4, 2024 13:43
Download gene set libraries from Enrichr in GMT format for ssGSEA - done in parallel with async
from pathlib import Path
import parmap
import requests
def update(gsll):
return [g for g in gsll if not (output_dir / (g + ".gmt")).exists()]
@dpryan79
dpryan79 / convertBigWigChroms.py
Last active September 7, 2021 12:49
Convert chromosome names in a bigWig file
#!/usr/bin/env python
import argparse
import pyBigWig
parser = argparse.ArgumentParser(description="Convert the chromosome names of a bigWig file.")
parser.add_argument("conv", metavar="conversion.txt", help="Text file with two columns, the first a chromosome name and the second the converted chromosome name.")
parser.add_argument("input", metavar="input.bigWig", help="Input bigWig file")
parser.add_argument("output", metavar="output.bigWig", help="Output bigWig file name")
args = parser.parse_args()
@emmanuelrosa
emmanuelrosa / myriad-pro-font.nix
Last active September 10, 2020 16:48
Nix package for Myriad Pro font
{ stdenv, fetchurl }:
let
fetchfont = name: num: sha:
fetchurl {
url = "https://fontsup.com/download/${builtins.toString num}.html";
sha256 = sha;
name = "${name}";
};
in stdenv.mkDerivation rec {
@dblyon
dblyon / volcano.py
Last active August 14, 2022 13:32
Volcano plot: log2(ratio) vs. log10(p-value)
class Volcano(object):
"""
create a Volcano plot from log2(ratios) and corresponding -log10(p_values)
ToDo: take care of infinite ratios
e.g. usage
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
@domenkozar
domenkozar / nixos-on-dell-9560.org
Last active August 25, 2023 17:07 — forked from grahamc/nixos-on-dell-9560.org
NixOS on a Dell 15" 9560 with the 4K screen.
@fud
fud / allocate.sh
Created September 3, 2016 08:06
More swap space for a docker machine.
for i in $(docker-machine ls | awk '{print $1}'); do
docker-machine ssh $i -- ls /swapfile || docker-machine ssh $i "fallocate -l 512M /swapfile && chmod 400 /swapfile && mkswap /swapfile" &&
docker-machine ssh $i "swapon /swapfile && echo '/swapfile none swap defaults 0 0' >> /etc/fstab" &>/dev/null;
done
@adham90
adham90 / spacemacs-keybindings
Last active April 5, 2024 14:24
spacemacs keybindings that i need to learn
SPC s c remove highlight
**** Files manipulations key bindings
Files manipulation commands (start with ~f~):
| Key Binding | Description |
|-------------+----------------------------------------------------------------|
| ~SPC f c~ | copy current file to a different location |
| ~SPC f C d~ | convert file from unix to dos encoding |
| ~SPC f C u~ | convert file from dos to unix encoding |
@kennethkalmer
kennethkalmer / nginx.conf
Last active August 3, 2021 19:44
Sample nginx config for serving a rails API and static frontend like Ember on the same domain...
daemon off;
worker_processes 4;
events {
use epoll;
accept_mutex on;
multi_accept on;
worker_connections 1024;
}
@mattratleph
mattratleph / vimdiff.md
Last active May 9, 2024 03:11 — forked from roothybrid7/vimdiff_cheet.md
vimdiff cheat sheet

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)