Skip to content

Instantly share code, notes, and snippets.

View ale94mleon's full-sized avatar

Alejandro Martínez-León ale94mleon

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hypnopump
hypnopump / dihedral_angle_from_coordinates.py
Last active February 29, 2024 20:53
Dihedral angles from coordinates. Get dihedral angles from protein backbone coordinates. Calculate Phi, Psi from 3D coordinates of (N-term, C-alpha and C-term)
""" Dihedral angles from coordinates. Get dihedral angles from
protein backbone coordinates.
This script takes 4 vectors representing 4 points as input
and returns the dihedral angle between them.
The script was originally developed to calculate dihedral angles (phi,psi)
from protein backbone atoms' coordinates in 3D (N-term, C-alhpa, Cterm).
"""
import numpy as np
@marcelm
marcelm / snakemake-pure-python.py
Last active November 29, 2023 00:45
pure Python module that uses snakemake to construct and run a workflow
#!/usr/bin/env python3
"""
Running this script is (intended to be) equivalent to running the following Snakefile:
include: "pipeline.conf" # Should be an empty file
shell.prefix("set -euo pipefail;")
rule all:
input:
@aliang
aliang / Mac SSH Autocomplete
Created June 14, 2011 07:14
Add auto complete to your ssh, put into your .bash_profile
_complete_ssh_hosts ()
{
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \
cut -f 1 -d ' ' | \
sed -e s/,.*//g | \
grep -v ^# | \
uniq | \
grep -v "\[" ;