Skip to content

Instantly share code, notes, and snippets.

@jameshenegan
jameshenegan / readme.md
Last active February 9, 2021 17:21
Converting a YAML Dictionary to JSON

Converting a YAML Dictionary to JSON

In this Gist, we look at how you can convert a Gen3 Data Dictionary from YAML to JSON.

Get a copy of the Dictionary for Testing Purposes

First, we need a copy of the dictionary that's in YAML format so that we can convert it to JSON.o

git clone https://github.com/uc-cdis/compose-services.git
@jameshenegan
jameshenegan / readme.md
Last active February 9, 2021 16:35
Running Tests on YAML Dictionaries

Running Tests on YAML Dictionaries

The Gen3 developers use Travis CI to test their data dictionaries. Why not test locally? The data dictionary tests use some tools (poetry and nose) that may be difficult to install.

In this Gist, we will provide instructions on how you can use Travis-CI to test the dictionary that comes with Compose Services.

Get a copy of the Dictionary for Testing Purposes

First, we need a copy of the dictionary so that we can perform a test on it.

@jameshenegan
jameshenegan / readme.md
Created February 9, 2021 15:30
Gen3 Data Dictionary Tool - Excel to YAML

Gen3 Dictionary Tool - Excel to YAML

According to a conversation with a Gen3 developer, the working tool is on the charlie_fix branch of the gen3_dictionary_tools repo.

In this code chunk, we clone the branch and set up the environment.

Mac

git clone --single-branch --branch charlie_fix https://github.com/uc-cdis/gen3_dictionary_tools.git
cd gen3_dictionary_tools/Dictionarytool/
@jameshenegan
jameshenegan / readme.md
Last active February 9, 2021 15:48
Gen3 Dictionary Tool - YAML to Excel

Gen3 Dictionary Tool - YAML to Excel

According to a conversation with a Gen3 developer, the working tool is on the charlie_fix branch of the gen3_dictionary_tools repo.

In this code chunk, we clone the branch and set up the environment.

Mac

git clone --single-branch --branch charlie_fix https://github.com/uc-cdis/gen3_dictionary_tools.git
cd gen3_dictionary_tools/Dictionarytool/
@jameshenegan
jameshenegan / figure-9-3.R
Created December 29, 2020 22:06
Trying to reproduce Figure 9.3 from the Second Edition of "Statistical Rethinking" by Richard McElreath
library(magrittr)
library(ggplot2)
# Trying to reproduce Figure 9.3 from the
# Second Edition of "Statistical Rethinking"
# by Richard McElreath
##########################################################
# Main Steps:
# 1. Try to identify the posterior used by McElreath
@jameshenegan
jameshenegan / index.html
Last active June 21, 2020 13:44
Latin Squares
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://d3js.org/d3.v5.min.js"></script>
</head>
@jameshenegan
jameshenegan / index.html
Last active June 21, 2020 13:47
Complete Graph Manipulation Viz
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://d3js.org/d3.v5.min.js"></script>
</head>
@jameshenegan
jameshenegan / index.html
Last active October 12, 2019 18:56
VC Dimension, Axis Aligned Rectanges
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="https://d3js.org/d3.v5.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
@jameshenegan
jameshenegan / index.html
Last active September 30, 2019 22:52
D3.V5 Sequential Multi Hue Color Scale
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="https://d3js.org/d3.v5.min.js"></script>
</head>
@jameshenegan
jameshenegan / index.html
Last active September 30, 2019 03:11
Transitions with Variable Durations
<!DOCTYPE html>
<head>
<script src="https://d3js.org/d3.v5.min.js"></script>
</head>
<body>
<div id = "chart"></div>
<button type="button" style = "position: absolute; left: 550px">Click to Restart</button>
<script src="index.js"></script>