Skip to content

Instantly share code, notes, and snippets.

View seandavi's full-sized avatar

Sean Davis seandavi

View GitHub Profile
@mtmorgan
mtmorgan / readKallisto.R
Last active December 4, 2017 11:51
read kallisto RNA-seq quantification into R / Bioconductor data structures
.require <-
function(pkg)
{
withCallingHandlers({
suppressPackageStartupMessages({
require(pkg, character.only=TRUE, quietly=TRUE)
})
}, warning=function(w) {
invokeRestart("muffleWarning")
}) || {
@iMilnb
iMilnb / boto3_hands_on.md
Last active October 19, 2022 09:15
Programmatically manipulate AWS resources with boto3 - a quick hands on

boto3 quick hands-on

This documentation aims at being a quick-straight-to-the-point-hands-on AWS resources manipulation with [boto3][0].

First of all, you'll need to install [boto3][0]. Installing it along with [awscli][1] is probably a good idea as

  • [awscli][1] is boto-based
  • [awscli][1] usage is really close to boto's
@lindenb
lindenb / BamServer.java
Last active December 3, 2015 00:07
Setting up a jetty server for https://www.biostars.org/p/168197/
import org.eclipse.jetty.server.*;
import org.eclipse.jetty.servlet.*;
public class BamServer {
public static void main(String[] args) throws Exception {
Server jettyServer = new Server(8080);
ServletContextHandler context = new ServletContextHandler();
context.setContextPath("/");
DefaultServlet servlet= new DefaultServlet();
@mixxorz
mixxorz / graphene.py
Last active January 9, 2025 16:46
Get requested fields from ResolveInfo. Graphene python.
"""
MIT License
Copyright (c) 2018 Mitchel Cabuloy
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
@craigbeck
craigbeck / introspection-query.graphql
Created April 6, 2016 20:20
Introspection query for GraphQL
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
subscriptionType { name }
types {
...FullType
}
directives {
@eloypnd
eloypnd / dnsmasq_setup_osx.md
Last active July 4, 2025 01:04
wildcard DNS record on OS X in localhost development with dnsmasq

wildcard DNS in localhost development

$ brew install dnsmasq
   ...
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
  • edit /usr/local/etc/dnsmasq.conf
address=/local/127.0.0.1
@pgrosu
pgrosu / Python_client_secrets.py
Created August 18, 2016 02:30
Python and R code examples (with results) using Google Genomics API and a client_secrets.json file
from __future__ import print_function
import httplib2
import os
from apiclient import discovery
import oauth2client
from oauth2client import client
from oauth2client import tools
@seandavi
seandavi / getPubMetrics.R
Last active January 26, 2020 17:52
Get RCR and citation metrics for a list of pubmed IDs from https://icite.od.nih.gov/analysis
#' Get publication metrics from iCite
#'
#' iCite is a tool to access a dashboard of bibliometrics for papers
#' associated with a portfolio. Users upload the PubMed IDs of articles
#' of interest (from SPIRES or PubMed), optionally grouping them for
#' comparison. iCite then displays the number of articles, articles per
#' year, citations per year, and Relative Citation Ratio (a field-normalized
#' metric that shows the citation impact of one or more articles relative
#' to the average NIH-funded paper). A range of years can be selected,
#' as well as article type (all, or only research articles), and individual
@bhtucker
bhtucker / upsert.py
Last active February 17, 2025 15:08
A demonstration of Postgres upserts in SQLAlchemy
"""
Upsert gist
Requires at least postgres 9.5 and sqlalchemy 1.1
Initial state:
[]
Initial upsert:
@montanaflynn
montanaflynn / pget.go
Last active January 17, 2025 17:07
Bounded Parallel Get Requests in Golang
package main
import (
"fmt"
"net/http"
"sort"
"time"
)
// a struct to hold the result from each request including an index