Skip to content

Instantly share code, notes, and snippets.

View Guillawme's full-sized avatar
💭
I may be slow to respond (days).

Guillaume Gaullier Guillawme

💭
I may be slow to respond (days).
View GitHub Profile
@bbarad
bbarad / tomoseg_to_imod.py
Created December 5, 2019 16:27
Convert segmentation HDF to .mod file appropriate for imod.
"""
Script to convert eman2 segmentation hdf maps to imod model files at a user defined contour level.
Requires python>=3.5 as well as having Eman2 and IMOD in the path.
Usage: `python3 tomoseg_to_imod.py -i EXAMPLE.hdf -o EXAMPLE.mod -t 0.8`
Author: Benjamin Barad <benjamin.barad@gmail.com>
"""
import argparse
#!/bin/bash
if [[ ! -d 3DEM ]]
then
mkdir 3DEM
fi
cd 3DEM
curl -s http://mail.ncmir.ucsd.edu/pipermail/3dem/ |\
@sneakers-the-rat
sneakers-the-rat / e_hashs.json
Last active February 18, 2022 15:54
Elsevier PDF "hashes"
[
"FCi27mtaKod38ztmGndn-y8NNz.r.lt6SndqGztz_ztr-ngqQm9aMo9eOnMeJntuNntu",
"D2ei2mgqJz9b-m.mGmPqRyLNNnwmOlt7.ywiGmt-Kndr9otqRywv8o9ePmtiNmd2Sn92Tma",
"6U7vcmPuOn9uLnMaGyM7-nLNNntv9lt6RmtaGmweOyMmJnMmSmgmOo9eOnM6LnMaRmM-Tma",
"lXLf8owyQztiMzwqGnMz7zcNNotb7lwf.m9qGzt6Km.qMngqLndqLo9eOotaNm96Mmt6Tma",
"FCi27y9qOnd-Ny96GmPmOmcNNzwf-lwj-m9mGztz7ytaMnM78n9v-o9ePmM6Rm9-Qn9eTma",
"XlEDumMz7nM7-m9iGogmRmLNNyt_8lwiKz9eGm9-Pm.v7ztiLztz_o9eOnMeQnd-Sodm",
"lXLf8yt-JywmNmPeGm9n9n8NNzgn.lt_8zwqGogz7zgn7zt6SyPr-o9eOnM6Pot2Mn9qTma",
"FCi27zgf8mdqMmMeGnMmMy8NNz9eQlweNy.eGmMiMm96Qmgr9nMb-o9ePmtuRmt6JotmTma",
"FCi27nwmKnMeSodeGm.z.y8NNntz.lt-PywmGy9__ngqQmtiPmtb7o9ePmteJotyJoduTma",
@hanjinliu
hanjinliu / microtubule_in_napari.py
Last active June 23, 2022 05:07
Make a microtubule in napari, for illustration.
import napari
import numpy as np
class MtModel:
def __init__(
self,
npf: int = 13,
start: int = 3,
space: float = 4.0,
radius: float = 9.8,
@alisterburt
alisterburt / raps_3d.py
Last active March 28, 2023 19:32
Rotational average 3D for Pranav
from pathlib import Path
from typing import List, Sequence, Tuple
import einops
import mrcfile
import numpy as np
import torch
import typer
cli = typer.Typer(name='raps_3d', no_args_is_help=True, add_completion=False)
@andersjohansson
andersjohansson / emacs-zotero-bib-fetch.el
Created March 31, 2016 10:05
Emacs-zotero-bib-fetch: fork of zotelo to use better-bibtex's pull export
;;; emacs-zotero-bib-fetch.el --- Manage Zotero collections from emacs
;;
;; Filename: emacs-zotero-bib-fetch.el
;; Author: Anders Johansson, based on zotelo by Spinu Vitalie
;; Maintainer: Anders Johansson
;; Copyright (C) 2011-2014, Anders Johansson and Spinu Vitalie
;; Created: 1 Jul 2014
;; Version: 1.2
;; URL: https://github.com/andersjohansson/emacs-zotero-bib-fetch
;; Keywords: zotero, emacs, reftex, bibtex, bibliography manager
#!/usr/bin/env python
import numpy as np
import pandas as pd
import umap
import sys
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.preprocessing import StandardScaler
from cryosparc.dataset import Dataset
@svpino
svpino / neural-network-from-scratch.py
Last active July 25, 2023 18:04
An implementation of a neural network from scratch
import numpy as np
def sigmoid(x):
return 1 / (1 + np.exp(-x))
def neural_network(X, y):
learning_rate = 0.1
W1 = np.random.rand(2, 4)
W2 = np.random.rand(4, 1)
@cosimo
cosimo / wget-exit-codes.txt
Last active September 15, 2023 10:09
wget exit codes
This is the list of exit codes for wget:
0 No problems occurred
1 Generic error code
2 Parse error — for instance, when parsing command-line options, the .wgetrc or .netrc…
3 File I/O error
4 Network failure
5 SSL verification failure
6 Username/password authentication failure
7 Protocol errors
@hadley
hadley / ds-training.md
Created March 13, 2015 18:49
My advise on what you need to do to become a data scientist...

If you were to give recommendations to your "little brother/sister" on things that they need to do to become a data scientist, what would those things be?

I think the "Data Science Venn Diagram" (http://drewconway.com/zia/2013/3/26/the-data-science-venn-diagram) is a great place to start. You need three things to be a good data scientist:

  • Statistical knowledge
  • Programming/hacking skills
  • Domain expertise

Statistical knowledge