Skip to content

Instantly share code, notes, and snippets.

View chasemc's full-sized avatar
:octocat:

Chase Clark chasemc

:octocat:
View GitHub Profile

We have created a Docker container that contains everything needed for the workshop (in case the internet is wonky). Please download and install Docker and the container prior to your arrival in case the internet is unreliable.

Follow the instructions on Docker's website to install Docker on your machine.

# Load libraries
library(data.table)
library(ggplot2)
library(lubridate) # for month()
# https://reporter.nih.gov/search/43gg1_mEQUWulgAiysCfEg/projects?shared=true
# Load data
data <- fread('SearchResult_Export_06Jul2025_102053.csv')
data <- data[!duplicated(`Serial Number`)]
# Convert 'Award Notice Date' to Date
# Start with Ubuntu base image
FROM ubuntu:22.04
# Set environment variables to prevent prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Update and install dependencies
RUN apt-get update && apt-get install -y \
software-properties-common \
build-essential \
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chasemc
chasemc / mac_dirselect.R
Created January 2, 2024 17:20
Select a directory in R with macOS Finder
selected_dir<- system('osascript -l JavaScript -e \'a=Application.currentApplication();a.includeStandardAdditions=true;a.chooseFolder({withPrompt:"Please select a file to process:"}).toString()\'', intern = TRUE, ignore.stderr = T)
import pandas as pd
from shiny import App, Inputs, Outputs, Session, reactive, render, ui
from shiny.types import FileInfo
app_ui = ui.page_fluid(
ui.input_file("file1", "Choose CSV File", accept=[".csv"], multiple=False),
ui.input_checkbox_group(
"stats",
"Summary Stats",
library(IDBacApp)
library(dplyr)
library(DBI)
library(pool)
library(coop)
# Change this to be the full file path to your sqlite file
sqlite_filepath <- "/home/chase/Downloads/NK_Library_Full_Up_To_2023-10-02-Copy.sqlite"
def parse_fasta(filepath: str) -> Generator[str, str]:
seq_id = ""
with open(filepath, "r") as h:
seq_id = ""
seq = ""
for i in h:
if i[0] == ">":
if seq_id:
yield (seq_id, seq)
seq_id = i[1:].strip()
@chasemc
chasemc / fasta_to_sqlite.py
Created August 24, 2023 19:36
Convert a fasta file to sqlite, assumes defline is a unique id and there are no duplicates
#!/usr/bin/python3
# MIT License
# Copyright (c) Chase M. Clark
# 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
https://docs.google.com/presentation/d/1NqwMVOYB2o_sqkOjoPH_AK1zKxrYyYcaUv8ZuAmU8og/edit?usp=sharing