Skip to content

Instantly share code, notes, and snippets.

View biochem-fan's full-sized avatar
🍀

biochem_fan biochem-fan

🍀
  • Osaka
View GitHub Profile
@biochem-fan
biochem-fan / list.sh
Created November 28, 2022 11:47
MicroED scripts
#!/bin/bash
JOB=$1
for f in */$1/dials.scale.log; do
DIR=`dirname $f | cut -d/ -f1,2`
awk '/cc_ano/ {f=1; b=999; next}
f==1 && $13 > 0.3 {b = $2;}
f==1 && $13 <= 0.3 {printf FILENAME" "b" "; exit}' $f
grep "Best sol" $DIR/dials.cosym.log| tr -d '\n'
@biochem-fan
biochem-fan / FormatROD.py
Last active August 28, 2023 08:49
dxtbx class for Rigaku Hypix detector
# This has been merged to the dxtbx (with many updates).
# See https://github.com/cctbx/dxtbx/blob/main/src/dxtbx/format/FormatROD.py.
@biochem-fan
biochem-fan / CMakeLists.txt
Last active October 1, 2022 08:29
Homebrew libomp GCC incompatibility
# A simple project to show including /opt/homebrew/include
# in the GCC search path breaks OpenMP because GCC picks up
# libomp headers for LLVM.
# https://github.com/3dem/relion/issues/913#issuecomment-1263499265
# On Mac OS X:
# CC=gcc-12 cmake ..; make; ./omp_test # hangs
# CC=gcc-12 cmake .. -DAVOID_JPEG=ON; make; ./omp_test # OK
# gcc-12 -o omp_test ../main.c -fopenmp; ./omp_test # OK
@biochem-fan
biochem-fan / FormatTIFFTVIPS.py
Last active June 27, 2023 02:15
a dxtbx class for multi-frame TIFF images from TVIPS cameras
# This dxtbx class has been renamed to FormatTIFFMultipage.py and the latest version is now hosted in
# https://github.com/GKLabIPR/MicroED/blob/main/scripts/FormatTIFFMultipage.py.
@biochem-fan
biochem-fan / NOTES.md
Last active April 24, 2024 13:54
Warp-RELION4-M Protocol
@biochem-fan
biochem-fan / NOTES.md
Last active March 13, 2024 07:29
AlphaFold2 without Docker

Warning: this is my personal messy ad-hoc note. Not intended for production installation. Instruction by @kalinialab is probably better.

My environment

  • Cent OS 7.0
  • CUDA 11.2
  • Without root accoumt

Directories

# Group particles by time by @biochem_fan
# GPLv3; contact me if you want other license
import sys
import numpy as np
from collections import OrderedDict
def load_star(filename):
from collections import OrderedDict
# This is not a very serious parser; should be token-based.
@biochem-fan
biochem-fan / BoxNet2DRunner.cs
Last active September 16, 2023 23:37
WarpConsole
/* BoxNet2D runner
* Based on Warp 1.0.7 by Dimitry Tegunov https://github.com/cramerlab/warp/
* Command line interface and Linux port by @biochem_fan
* Licensed under GPLv3
*/
using System;
using System.IO;
using System.Linq; // for toList()
using System.Diagnostics; // for Stopwatch
@biochem-fan
biochem-fan / atom2svg.py
Last active March 30, 2023 23:31
atom2svg
# atom2svg.py by @biochem_fan
# VERSION: 210224
# License: GPLv2 or later (ask me if this is inconvenient for you)
#
# LIMITATIONS:
# - This supports only a single chain. If you have more chains, shift residue IDs and merge chains.
#
# TODO:
# - Residue numbers (how to pack??)
#

Tested Environment

  • Ubuntu 20.04 LTS
  • CUDA 11.6
  • GCC 9.4.0
  • Mono 6.12.0

Be careful with your driver and runtime version! For example, when I tried to run a binary compiled with CUDA 9.2 on a machine with CUDA runtime 9.0, it said 'DeviceCount = 0'.