Skip to content

Instantly share code, notes, and snippets.

View mossmatters's full-sized avatar

Matt Johnson mossmatters

View GitHub Profile
@mossmatters
mossmatters / transcript2genome_exonerate
Last active April 26, 2017 06:12
Map transcriptome results to genome scaffolds with Exonerate.
#!/usr/bin/env python
import argparse,sys,os,subprocess,shutil,errno
from Bio import SeqIO
helptext='''
This script is intended to use the results of a BLAST search of a transcriptome
against a draft genome to conduct more specific exonerate alignments. Each transcript
is paired with its genome scaffold hit using the BioPython Indexing feature.
@mossmatters
mossmatters / brlen_outliers.py
Created February 28, 2017 17:56
Automatic detection of branch length outliers on a gene tree
#!/usr/bin/env python
helptext='''This script identfies branch length outliers on a phylogeny. An outlier is a
branch with a length that exceeds a percentage of the maximum depth of the tree.
The input is a file containing one tree in newick format, and an optional file containing
a list of outgroup taxa (one per line).
The output will be an ASCII depiction of each branch with a length exceeding the threshold
(default 25% for ingroups, 75% for outgroups). A PNG file will also be generated for the
@mossmatters
mossmatters / anolis.nex
Last active September 13, 2018 13:04
Basic Nexus file
#NEXUS
begin data;
dimensions ntax=10 nchar=16;
format datatype=standard symbols="0 1 2";
MATRIX
Anolis_outgroupus 0000000000000000
Anolis_acutus 0021021121101101
@mossmatters
mossmatters / intro_ggplot.R
Created November 14, 2019 13:51
intro to GG plot with assignment
#install.packages(c('datasauRus',"ggplot2","dplyr"))
library(ggplot2)
library(datasauRus)
library(dplyr)
#Showing the importance of data visualization
# The anscombe dataset has four x and four y variables
data("anscombe")
anscombe
library(jsonlite)
library(readxl)
library(dplyr)
library(ggplot2)
#define the source data location and get a JSON with the assetIDs
url = 'https://beta.healthdata.gov/api/views/gqxm-d9w9'
document <- fromJSON(txt=url)
files = document[["metadata"]]$attachments
excels = files[endsWith(files$filename,".xlsx"),]