Skip to content

Instantly share code, notes, and snippets.

View woemler's full-sized avatar

Will Oemler woemler

  • Vesalius Therapeutics
  • Somerville, MA
View GitHub Profile
@woemler
woemler / Elasticsearch-setup.md
Last active November 30, 2021 22:48
Instructions for setting up Study Tracker (v 0.5.0)

Elasticsearch Setup

  1. Create new Elasticsearch domain with the desired configuration. Be sure to enable SSL and user-authentication.
  2. Create a user for your Study Tracker integration (eg. studytracker).
  3. Create a role for the user, grant it unlimited privileges on the studies index and the indics:data/write/bulk permission.
@woemler
woemler / manifest.yaml
Last active May 2, 2017 15:02
Centromere import manifest
### Data Set Manifest Example
displayName: Cancer Cell Line Encyclopedia # The data set display name. Short, but descriptive
shortName: ccle # Data set short name. No whitespace or file system-forbidden characters. Maybe this value could just come from the manifest file name? eg ccle.yaml
source: Borad Institute # Source organization of the data
version: v1 # Version number, if available.
description: Cancer cell line genomic data from the Broad Institute. # General notes or data set description.
attributes: # Dynamic key value attributes. Allows capturing of custom attributes for historical record
source-species: "Homo sapiens"
@woemler
woemler / RestUtils.class
Last active December 30, 2018 17:11
Simple wrapper for Spring RestTemplate requests and object mapping.
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.http.*;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestTemplate;
import java.io.IOException;
import java.util.List;
/**
* @author woemler
@woemler
woemler / ComplexTableDescription.java
Created May 12, 2015 14:37
SQL building for more dynamic JDBC operations in Spring JdbcTemplates.
package me.woemler.sqlbuilder;
import org.springframework.util.Assert;
import java.util.Arrays;
import java.util.List;
/**
* Based on com.nurkiewicz.jdbcrepository.TableDescription, with a number of modifications.
*
@woemler
woemler / ApplicationConfig.java
Created May 12, 2015 14:03
Spring web app, full-Java configuration (no web.xml)
package me.woemler.myapp.config;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@ComponentScan(basePackages = { "me.woemler.myapp" })
public class ApplicationConfig {
}
@woemler
woemler / find_cosmic_cell_line.py
Last active January 4, 2016 09:19
Searches Sanger's COSMIC cell line database and retrieves basic sample metadata.
from BeautifulSoup import BeautifulSoup
import urllib2
import re
def fetch_page_soup(url):
""" Fetches page data from a URL and returns a parsed BeautifulSoup object """
try:
response = urllib2.urlopen(url)
@woemler
woemler / pandas_hdf5_test.py
Created January 7, 2014 21:15
Pandas HDF5 cheat sheet
import pandas as pd
# Read a TSV file into a data frame
# This will automatically handle the data types
df = pd.read_csv("my_data.txt", sep="\t")
# Write the data frame to a storer HDF5 file in the table "data", overwriting existing files
df.to_hdf("my_data.store.h5", 'data', mode="w")
# Writing to ta table formatted HDF5 file is a little trickier
@woemler
woemler / Controller.java
Created November 8, 2013 19:29
Using Properties file variables in JSP files and Controllers in Spring 3.2
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class DefaultController {
@Value("${app.var2}")
private String var2;