Skip to content

Instantly share code, notes, and snippets.

View moritzschaefer's full-sized avatar

Moritz moritzschaefer

View GitHub Profile
@moritzschaefer
moritzschaefer / 5t5f.pdb
Last active October 19, 2022 09:33
Openfold Atom Frame Position Conversion
ATOM 1 N GLY A 30 -25.973 -7.656 -55.577 1.00 78.08 N
ATOM 2 CA GLY A 30 -25.554 -9.056 -55.591 1.00 77.73 C
ATOM 3 C GLY A 30 -26.655 -9.972 -55.099 1.00 80.55 C
ATOM 4 O GLY A 30 -27.811 -9.759 -55.496 1.00 80.15 O
ATOM 5 N LEU A 31 -26.372 -10.952 -54.187 1.00 75.03 N
ATOM 6 CA LEU A 31 -27.450 -11.796 -53.636 1.00 73.77 C
ATOM 7 C LEU A 31 -28.261 -10.923 -52.694 1.00 75.94 C
ATOM 8 O LEU A 31 -27.713 -10.327 -51.766 1.00 75.37 O
ATOM 9 CB LEU A 31 -26.909 -13.053 -52.943 1.00 73.60 C
ATOM 10 CG LEU A 31 -27.936 -14.041 -52.418 1.00 77.96 C
@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
name: TEPIC
channels:
- bioconda
- conda-forge
- defaults
dependencies:
- _libgcc_mutex=0.1=conda_forge
- _openmp_mutex=4.5=1_gnu
- _r-mutex=1.0.1=anacondar_1
- bedtools=2.29.2=hc088bd4_0
'''
Download a file from SRA (using SRX accessions or anything else that
is queryable by esearch) and rename them according to a yaml file.
Example yaml file:
CXXC1:
signal:
- SRX373166
control:
@moritzschaefer
moritzschaefer / batch_convert_to_dina4_ai.js
Created August 24, 2020 15:39
Adobe illustrator script to batch process SVG files: 1. open SVG 2. resize to DIN A4 3. save as ai files
function resize() {
if (app.documents.length > 0) {
var docRef = app.activeDocument;
if (docRef.artboards.length > 1)
{
alert('Need exactly one artboard');
quit;
}
// Found 1 artboard
var current = docRef.artboards[0].artboardRect;
@moritzschaefer
moritzschaefer / format-tex.py
Last active June 19, 2019 08:26
Fix org babel ipython export related issues
#!/usr/bin/env python
import sys
import re
import argparse
parser = argparse.ArgumentParser(description='Postprocess/fix org mode tex output')
parser.add_argument('--dont-replace-fig-labels', action='store_true')
parser.add_argument('--dont-delete-file-output', action='store_true')
@moritzschaefer
moritzschaefer / Deep1.py
Created January 17, 2018 10:15
Combination of LSTM and ConvLayer
from torch import nn
import torch
from torch.nn.init import kaiming_normal, normal
def weights_init(m):
if isinstance(m, (nn.Conv1d, nn.Linear)):
kaiming_normal(m.weight.data)
try:
kaiming_normal(m.bias.data)
@moritzschaefer
moritzschaefer / seafile-upload.py
Last active December 10, 2015 12:14
Upload and share to Seafile. Command line tool using Web API
#!/usr/bin/env python3
import sys
import requests
import getpass
try:
host = sys.argv[1]
library = sys.argv[2]
username = sys.argv[3]
@moritzschaefer
moritzschaefer / create_git_deploy
Last active August 29, 2015 14:19
Git Deploy Init
#!/bin/sh -x
DEPLOY_DIR=/root/deploy
PROJECT_NAME="$1"
cd $DEPLOY_DIR
git init --bare ${PROJECT_NAME}.git
mkdir $PROJECT_NAME
cat <<EOF > ${PROJECT_NAME}.git/hooks/post-update
#!/bin/sh
GIT_WORK_TREE="${DEPLOY_DIR}/${PROJECT_NAME}" git checkout -f master
@moritzschaefer
moritzschaefer / elasticsearch_import.py
Last active August 29, 2015 14:18
Small script for importing csv files to elasticsearch
#!/usr/bin/env python
import argparse
import sys, os, time
import pandas
import requests
from elasticsearch import Elasticsearch
es = Elasticsearch()