Skip to content

Instantly share code, notes, and snippets.

View amdevine's full-sized avatar

Amanda Devine amdevine

  • Washington, D.C.
View GitHub Profile
@amdevine
amdevine / markdown-pandoc-revealjs-github.md
Last active January 8, 2023 17:06
Creating slides with markdown, pandoc, and reveal.js and hosting them on GitHub pages

Creating a presentation with Markdown, pandoc, reveal.js, and GitHub Pages

Based on a Vimeo video detailing the process.

Code is written for a Windows PC - may need syntactical changes to work on Mac/Linux.

Substitute your own GitHub username where you see amdevine and your repository name where you see repository-name.

1. Create empty GitHub repository

@amdevine
amdevine / accessing-ggbn-api-data.md
Last active March 8, 2021 14:30
Access data from the GGBN API

Access data from the GGBN API

The Global Genome Biodiversity Network (GGBN) API is a service that allows users to retrieve data from the GGBN Data Portal quickly and easily. Data can be accessed via a script or a web browser. Data are output in the JavaScript Object Notation (JSON) format, a common format for sharing and accessing data from websites.

Types of data available

The GGBN API is accessed by using a web browser (or a script) to navigate to a specific URL (the endpoint) on the GGBN website:

http://data.ggbn.org/ggbn_portal/api/search

@amdevine
amdevine / real_time_name_query.py
Last active March 24, 2022 17:40
Real-time Name Query (CoL, GGBN, GenBank)
"""
This script reproduces the functionality of the Real-Time Name Query web app
found at https://www.globalgeno.me/gaps/live. It is intended to be run as
a script at the command line. The correct usage is:
python real_time_name_query.py <names file path> <NCBI API key>
e.g. python real_time_name_query.py querynames.txt 01234567890ABCDEFGHIK
Names files should be text files formatted with one name on each line.
@amdevine
amdevine / update-forked-repository.md
Created March 22, 2019 18:43
Update a forked GitHub repository from the original repository

Information copied from Jill Cates at Medium.

Step 1: Add the remote (original repo that you forked) and call it “upstream”

git remote add upstream https://github.com/original-repo/goes-here.git

Step 2: Fetch all branches of remote upstream

git fetch upstream
@amdevine
amdevine / dc-sql-cheat-sheet.md
Last active November 23, 2020 02:51
Data Carpentry SQL Cheat Sheet

Data Carpentry - SQL Cheat Sheet

Query order of operations

SELECT tablea.column1, tablea.column2, tableb.column3 AS somealias, SUM(tableb.column4)
FROM tablea
LEFT JOIN tableb
ON tablea.columnx = tableb.columnx
WHERE (tablea.column1 = 'someString') AND (tablea.column2 = someNumber)
@amdevine
amdevine / clone-remote-branches.md
Created July 23, 2019 17:29
Clone remote branches in Git

Text was taken from Stackoverflow, user emk. https://stackoverflow.com/a/72156

First, clone a remote Git repository and cd into it:

$ git clone git://example.com/myproject
$ cd myproject

Next, look at the local branches in your repository:

@amdevine
amdevine / .block
Created September 13, 2019 21:35 — forked from kerryrodden/.block
Sequences sunburst (d3 v4)
license: apache-2.0
@amdevine
amdevine / change-values-column.R
Created December 12, 2019 20:26
Change values in a column of an R data frame
library(tidyverse)
#### Changing the values in a character/numeric vector ####
# Create sample data frame
df <- data.frame(
col1 = c("A", "A", "A", "A", "B", "B", "B", "B"),
col2 = c("C", "C", "D", "D", "C", "C", "D", "D"),
col3 = c("E", "F", "E", "F", "E", "F", "E", "F"),
stringsAsFactors = FALSE
@amdevine
amdevine / terrestrial-arthropods.md
Last active April 2, 2020 19:16
Terrestrial Arthropod Classes

Terrestrial Arthropod Classes

This gist contains all classes that occur in phylum Arthropoda for each data source, and whether these classes would be classified as "terrestrial arthropods" when doing analyses.

Catalogue of Life

Class Terrestrial Arthropod
Arachnida Yes
Branchiopoda No
@amdevine
amdevine / vertebrate-classes.md
Last active April 7, 2021 17:17
Vertebrate Classes

Vertebrate Classes

This gist contains all classes that occur in phylum Chordata for each data source, and whether these classes would be classified as vertebrates for the purpose of analysis.

Catalogue of Life

Class Vertebrate? Category
Actinopterygii Yes Fishes
Amphibia Yes Amphibians and Reptiles