Skip to content

Instantly share code, notes, and snippets.

View vsoch's full-sized avatar
💭
rawr

Vanessasaurus vsoch

💭
rawr
View GitHub Profile
@vsoch
vsoch / vcademy_mutual_information.m
Last active April 5, 2021 17:22
Mutual Information for Image Registration: an example of why maximizing mutual information is preferable over minimizing the least sum of squares for aligning two images from different modality.
% Mutual Information
% This shows why mutual information is important for registration, more-so
% than another metric like the least sum of squares.
% VSoch July 2013
% First, let's read in two pickle images that we want to register
% Note - this is a picture I found on google search, and I transformed it in
% photoshop by moving it down and right, and then CONTROL+I to get the inverse
pickle1 = imread('pickle1.png');
pickle2 = imread('pickle2.png');
@vsoch
vsoch / dinosaur.lp
Last active March 21, 2021 17:31
My first logic program - am I a dinosaur (requires clingo)
% clingo dinosaur.lp
% These are blanket facts, statements that each of these is living
% I think these are called atoms
living(vanessa).
living(fernando).
living(maria).
% This tells use size of arms for each living thing
armsize(vanessa, "small").
armsize(fernando, "large").
@vsoch
vsoch / joblib_vs_pickle.py
Created April 24, 2015 03:44
Joblib vs Pickle
from sklearn.externals import joblib
import time
import numpy
import pickle
bigarray = numpy.zeros([190,91,190])
bigarray = bigarray.flatten()
### Saving
@vsoch
vsoch / snakemake-debugging.sh
Created October 20, 2020 16:52
Snakemake Debugging on Google Cloud
# This is a small script (that typically I copy paste) on a Google Cloud instance
# to set up an environment to mimic a worker. It includes installing snakemake,
# retrieving a package with the working directory (which typically has the
# version of snakemake I aim to develop or debug, and then interactively debugging
# or doing this.
sudo apt-get install -y wget bzip2 ca-certificates gnupg2 git
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
sudo chown -R $USER /opt
bash Miniconda3-latest-Linux-x86_64.sh -b -p /opt/conda
@vsoch
vsoch / vcademy_mds.m
Created August 6, 2013 16:12
Multidimensional Scaling: a simple Matlab demonstration
% Multidimensional scaling (MDS) Example
% Load matlab cities data
load cities
% This data has cities in rows, and different categories for ratings in
% columns. We will implement MDS to assess city similarity based on
% ratings.
% Step 1: Set up our proximity matrix
@vsoch
vsoch / gls.py
Last active September 2, 2020 18:50
Testing Google Life Sciences updated download / upload script (will be put into version control)
#!/usr/bin/env python
# This is a helper script for the Google Life Sciences instance to be able to:
# 1. download a blob from storage, which is required at the onset of the Snakemake
# gls.py download <bucket> <source> <destination>
# workflow step to obtain the working directory.
# 2. Upload logs back to storage (or some specified directory of files)
# gls.py save <bucket> <source-dir> <destination-dir>
# gls.py save <bucket> /google/logs/output source/logs
@vsoch
vsoch / Dockerfile
Last active August 25, 2020 22:14
Dolmades Files
FROM ubuntu:16.04
LABEL version="1.0"
ENTRYPOINT [ "/singularity" ]
RUN mkdir -p /APPS /PROFILES
RUN chmod 0777 /APPS /PROFILES
RUN dpkg --add-architecture i386
RUN apt-get update && apt-get -y install wget less vim software-properties-common python3-software-properties apt-transport-https winbind
RUN wget https://dl.winehq.org/wine-builds/Release.key
@vsoch
vsoch / Singularity
Last active August 17, 2020 17:23
Singularity image with anaconda + R
From:rocker/ropensci
Bootstrap:docker
%environment
PATH=$PATH:/opt/anaconda3/bin
export PATH
%runscript
Rscript /code/runman.R
@vsoch
vsoch / AIRFLOW_FEEDBACK.md
Last active January 22, 2020 19:01
Apache Airflow Feedback 1/22/2020

Airflow Feedback

This is feedback about contribution to Apache Airflow.

Background

I first opened up a pull request in early March 2019 to add a Singularity operator to airflow. I am fairly experienced with Singularity (but not Airflow) so largely my strategy was to use an existing operator (Docker) as an example, and go from there. The interaction felt more controlled than usual because I was required to open a JIRA issue, but this wasn't terrible and is understandable for a larger community. A reviewer was very quick

@vsoch
vsoch / cargo-debstatus-nu-0.3.0_10-17-2019.txt
Last active December 7, 2019 17:18
nu 0.3.0 dependency output from running cargo-debstatus in the root of the repository, and commenting out #default-run = "nu" in Cargo.toml. Do a find for (outdated) to highlight all the packages that were highlighted in yellow on the terminal (that I cannot show here)
nu v0.3.0 (/home/vanessa/Documents/Dropbox/Code/rust/nushell-debian/nushell-0.3.0)
├── ansi_term v0.12.1 (in debian)
├── app_dirs v1.2.1
│ ├── ole32-sys v0.2.0
│ │ ├── winapi v0.2.8 (outdated)
│ │ └── winapi-build v0.1.1 (in debian)
│ ├── shell32-sys v0.1.2
│ │ ├── winapi v0.2.8 (outdated)
│ │ └── winapi-build v0.1.1 (in debian)
│ ├── winapi v0.2.8 (outdated)