Skip to content

Instantly share code, notes, and snippets.

View DustinMorado's full-sized avatar

Dustin Morado DustinMorado

  • Science for Life Laboratory (SciLifeLab)
  • Stockholm, Sweden
  • X @DustinMorado
View GitHub Profile
@DustinMorado
DustinMorado / print_extheader.py
Last active November 22, 2021 16:40
print FEI2 extended header info
#!/usr/bin/env python
import mrcfile
import numpy
import argparse
parser = argparse.ArgumentParser(description='Print MRC extended header')
parser.add_argument('input_mrc', help='input mrc file')
parser.add_argument('-f', '--field', help='specific key to print')
args = parser.parse_args()
#!/bin/bash
if [[ ! -d 3DEM ]]
then
mkdir 3DEM
fi
cd 3DEM
curl -s http://mail.ncmir.ucsd.edu/pipermail/3dem/ |\
@DustinMorado
DustinMorado / shiftTRF.py
Created September 29, 2016 17:27
Shift the raw motif center in an I3 trf file
import numpy
import argparse
parser = argparse.ArgumentParser(
description='Shift particle centers in a TRF file',
epilog='Written by Dustin R. Morado 28.09.2016')
parser.add_argument('input', help='Input trf file', metavar='IN.trf')
parser.add_argument('output', help='Output trf file', metavar='OUT.trf')
parser.add_argument(
@DustinMorado
DustinMorado / createPtclCube.py
Last active September 20, 2016 13:52
Make a pool of particles in a pseudo-tomogram for use in I3
import argparse
import subprocess
import math
import glob
# Take a number of particles, designed for a single day of data collection
# and using i3paste place them in a large tomogram volume to avoid the limit
# of 1000 tomograms in I3.
# The size of the tomogram is given by:
header_fmt = 'iii' -- nx, ny, nz
header_fmt = header_fmt .. 'i' -- mode
header_fmt = header_fmt .. 'iii' -- nxstart, nystart, nzstart
header_fmt = header_fmt .. 'iii' -- mx, my, mz
header_fmt = header_fmt .. 'fff' -- xlen, ylen, zlen
header_fmt = header_fmt .. 'fff' -- alpha, beta, gamma
header_fmt = header_fmt .. 'iii' -- mapc, mapr, maps
header_fmt = header_fmt .. 'fff' -- amin, amax, amean
header_fmt = header_fmt .. 'i' -- ispg
header_fmt = header_fmt .. 'i' -- Next
#!/usr/bin/env talua
--[[
Copyright (c) 2015 Dustin Reed Morado
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
#!/usr/bin/env talua
local tomoauto = require('tomoauto')
local yalgo = require('yalgo')
local io = io
local parser = yalgo:new_parser('Convert pos file from rotx tomogram to slab.')
parser:add_argument({
name = 'tomogram',
description = 'Slab style tomogram to change pos file onto.',