Skip to content

Instantly share code, notes, and snippets.

View PlethoraChutney's full-sized avatar

Rich PlethoraChutney

View GitHub Profile
#!/bin/bash
# Test to make sure csparc2star.py is in PATH and installed correctly:
csparc2star.py -h &> /dev/null
if [ $? -ne 0 ]; then
echo Failed to run csparc2star.py. Are you in the correct virtual environment? Did you check your path?
exit
fi
# Change this to your csparc scratch directory. This should be where all your P* dirs are
@PlethoraChutney
PlethoraChutney / fix-blender.sh
Last active February 2, 2023 15:13
MolNodes blender fix commands
conda create --name blender python==3.10 biotite==0.35.0 mdanalysis==2.2.0 -c conda-forge -y
CONDAENV=$(conda info --envs | grep blender | awk -F ' ' '{print $2}')
pushd /Applications/Blender.app/Contents/Resources/3.4/ > /dev/null
mv python old_python
ln -s $CONDAENV python
popd > /dev/null
library(tidyverse)
data <- read_csv('~/Downloads/data-precs.csv')
counted <- data |>
filter(!is.na(res_id)) |>
select(pdb_id, name, secondary) |>
group_by(pdb_id) |>
mutate(
previous = lag(secondary)
#!/usr/bin/env python3
import re
import sys
char_pattern = re.compile('color:#7f7f7f[^>]*>([^<]*)')
with open(sys.argv[1], 'r') as f:
lines = [x.rstrip() for x in f]
line = ''.join(lines)
#!/usr/bin/env python3
import sys
if len(sys.argv) == 1:
diam = input('Particle diameter (A): ')
defocus = input('Mean defocus (um): ')
res = input('Target resolution (A): ')
ps = input('Pixel size (a/pix): ')
elif len(sys.argv) != 5:
print('Usage: box-sizer.py {diameter in A} {defocus in um} {resolution in A} {apix in A/pix}')
sys.exit(1)

Keybase proof

I hereby claim:

  • I am plethorachutney on github.
  • I am plethorachutney (https://keybase.io/plethorachutney) on keybase.
  • I have a public key ASCNhMxyDzdrBvmhlN1W1u8lln0lwMH4G38UAhsueU3WJgo

To claim this, I am signing this object: