Skip to content

Instantly share code, notes, and snippets.

View matteoferla's full-sized avatar

Matteo Ferla matteoferla

View GitHub Profile
@matteoferla
matteoferla / slimmer
Created March 6, 2024 17:38
Slim down PSE file with superposed chains in multiple objects
import numpy as np
import pymol2
token_resi = 25 # this present in all chains
filename = '👾👾👾.pse'
coords = {}
with pymol2.PyMOL() as pymol:
pymol.cmd.load('crysalin_lattice.pse')
for name in pymol.cmd.get_object_list():
for chain in pymol.cmd.get_chains(name):
@matteoferla
matteoferla / cuda11.8.md
Last active January 26, 2024 17:01
Singularity and CUDA

I want Pytorch, Jax and Tensorflow.

Check: nvidia-smi still gives 'NVIDIA-SMI 510.85.02 Driver Version: 510.85.02 CUDA Version: 11.6 '

conda activate base
unset LD_LIBRARY_PATH
unset CUDA_HOME
export NEW_ENV='cuda118redux'
export CONDA_ALWAYS_YES=yes
@matteoferla
matteoferla / best_template.ipynb
Last active December 12, 2023 09:54
Find the best Fragalysis template retrospectively. Namely, a compound was positioned against a template under an induced fit assumption, whereas for visualisation lock and key is needed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@matteoferla
matteoferla / adding_xyz_in_NGL.js
Created December 12, 2023 06:16
Add xyz to origin in NGL.js
// In NGL it may be handy to show an XYZ system axes / caltrop / cube edge
// the following is called via `addAxis(stage)`
const addAxis = (stage) => {
let shape = new NGL.Shape("shape", { dashedCylinder: true })
shape.addArrow([ 0, 0, 0 ], [ 10, 0, 0 ], [ 1, 0, 0 ], 1.0);
shape.addText([ 12, 0, 0 ], [ 1, 0, 0 ], 2.5, "x");
shape.addArrow([ 0, 0, 0 ], [ 0, 10, 0 ], [ 0, 1, 0 ], 1.0);
shape.addText([ 0, 12, 0 ], [ 0, 1, 0 ], 2.5, "y");
shape.addArrow([ 0, 0, 0 ], [ 0, 0, 10 ], [ 0, 0, 1 ], 1.0);
@matteoferla
matteoferla / notes_on_OESpicoli_tests.md
Last active December 4, 2023 16:30
Get void with OpenEye Spicoli

I wanted to get the void volume with OpenEye Spicoli for use in OERocs.

But it did not create a usable surface.

This here is for my reference as I am missing something.

Standard reading:

# -----------------------------------
@matteoferla
matteoferla / test-cset.ipynb
Created November 13, 2023 13:38
Testing cset-uload
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@matteoferla
matteoferla / job.sh
Last active October 12, 2023 13:02
Example of how I run a Fragmenstein analysis in Diamond
#! bin/bash
# For scripts required see: https://gist.github.com/matteoferla/e0496d5766c12a0ae1738b943b41a536
# A few things don't work in CentOS 7 due to GNU lib C (glibc) 2.17, so it has to be run in a Singularity container
: << USAGE
export JOB_SCRIPT=/data/xchem-fragalysis/shared/singularity.sh;
export APPTAINER_CONTAINER=/data/xchem-fragalysis/shared/singularity/rockyplus.sif;
export JOB_INNER_SCRIPT=/data/xchem-fragalysis/mferla/Zika/job.sh;
condor_submit /data/xchem-fragalysis/shared/target_script.condor
@matteoferla
matteoferla / bashrc.sh
Last active December 21, 2023 10:08
A bunch of scripts used on the HTCondor cluster
# ========================
# Sets presents...
# tries to source $HOME/.bashrc
# or $HOME2/.bashrc;
# or a fallback
# ========================
# source /data/xchem-fragalysis/shared/bashrc.sh
# universal fixes
@matteoferla
matteoferla / wooden_gcode_wobble.py
Created August 24, 2023 11:09
Add random M104 codes to a gcode for a 3D print in wood PLA to make stripes (old script, may be better out there)
# Randomize layer temperatures for wood PLA.
import argparse
import re
import random
import os
gcode_folder = '../../3DPrints/gcodes/'
filename = 'scrabble_hold_10v3.gcode'
@matteoferla
matteoferla / fixes-found.md
Last active March 16, 2024 19:26
I am going to write a comment for every damn IT issue/fix I get...

This is an experiment. Is a GitHub Gist comment a good way to log publically how I fixed an installation or similar issue?

See comments