Skip to content

Instantly share code, notes, and snippets.

@roblanf
roblanf / repellent_primes.R
Created March 16, 2016 01:01
This gist is an attempt to recreate some of the analyses discussed in this article:
library(primes)
library(coda)
library(parallel)
library(ggplot2)
# set this to the number of processors on your machine
processors = 4
remainder <- function(number, divisor){ return(number%%divisor) }
@roblanf
roblanf / repellent_primes.R
Created March 16, 2016 01:01
This gist is an attempt to recreate some of the analyses discussed in this article:
library(primes)
library(coda)
library(parallel)
library(ggplot2)
# set this to the number of processors on your machine
processors = 4
remainder <- function(number, divisor){ return(number%%divisor) }
@roblanf
roblanf / repellent_primes.R
Last active March 16, 2016 22:16
This gist is an attempt to analyse the distribution of the last digits of prime numbers, inspired by this article: http://www.nature.com/news/peculiar-pattern-found-in-random-prime-numbers-1.19550?WT.mc_id=FBK_NatureNews
library(primes)
library(coda)
library(parallel)
library(ggplot2)
# set this to the number of processors on your machine
processors = 4
remainders <- function(divisor, numbers){
@roblanf
roblanf / AAL.tsv
Last active May 19, 2016 00:21
The AAL (ANU Acronym List) is a list to help out anyone who is struggling to understand the many wonderful acronyms so beloved of the Australian National University (ANU). To enter your own data, follow this link: http://goo.gl/forms/T1k7BBrqL3CEnmfF2.
Acronym Full Link
ANU Australian National University http://anu.edu.au/
BSB (Division of) Biomedical Science and Biochemistry http://biology.anu.edu.au/research/divisions/biomedical-science-and-biochemistry
CBA Centre for Biodiversity Analysis http://cba.anu.edu.au/
CBBU Computational Biology and Bioinformatics Unit http://biology.anu.edu.au/research/facilities/computational-biology-and-bioinformatics-unit
CGMB Centre for Genomics, Metabolomics, and Bioinformatics
CMBE Colloge of Medicine, Biology, and Environment http://science.anu.edu.au/
CSIRO Commonwealth Scientific and Industrial Research Organisation http://www.csiro.au/
EBL Ecogenomics and Bioinformatics Lab
EEG (Division of) Ecology, Evolution, and Genetics http://biology.anu.edu.au/research/divisions/evolution-ecology-and-genetics
@roblanf
roblanf / genome_plots.r
Last active September 4, 2016 09:23
Make plots about genome sequencing, size, and gene content
source("http://bioconductor.org/biocLite.R")
biocLite("genomes")
library(genomes)
library(ggplot2)
valid <- c("released", "created", "submitted")
data(proks)
update(proks)
# build the map for R9.5 flowcell, as a long-form dataframe that translates
# channels into rows and columns on the flowcell. Good for plotting in R.
p1 = data.frame(channel=33:64, row=rep(1:4, each=8), col=rep(1:8, 4))
p2 = data.frame(channel=481:512, row=rep(5:8, each=8), col=rep(1:8, 4))
p3 = data.frame(channel=417:448, row=rep(9:12, each=8), col=rep(1:8, 4))
p4 = data.frame(channel=353:384, row=rep(13:16, each=8), col=rep(1:8, 4))
p5 = data.frame(channel=289:320, row=rep(17:20, each=8), col=rep(1:8, 4))
p6 = data.frame(channel=225:256, row=rep(21:24, each=8), col=rep(1:8, 4))
p7 = data.frame(channel=161:192, row=rep(25:28, each=8), col=rep(1:8, 4))
p8 = data.frame(channel=97:128, row=rep(29:32, each=8), col=rep(1:8, 4))
@roblanf
roblanf / speciesplot
Last active October 24, 2018 16:04
Make a speciesplot in R
# Create a scatterplot with any species as the data points.
# To choose your species, go here: http://phylopic.org/ , then enter the name of the spp you want. Click on the image and click 'thumbnail', click on the picture, and then copy the link in the address bar of your browser. It should end with 'thumb.png' Paste it in place of the link below.
library(TeachingDemos)
library(png)
# Paste a link to a png of your favourite animal here. This will be an aardvarkplot. Make sure it ends with .thumb.png.
# If it doesn't end with .thumb.png reread the instructions above and try again.
link = "http://phylopic.org/assets/images/submissions/cfee2dca-3767-46b8-8d03-bd8f46e79e9e.thumb.png"
echo "copying source pics"
mkdir source_pics
cp ~/pikrellcam/media/timelapse/* source_pics
cd source_pics
echo "renaming"
mkdir renamed
counter=1
ls -1tr *.jpg | while read filename; do cp $filename renamed/$(printf %05d $counter)_$filename; ((cou\
nter++)); done
This file has been truncated, but you can view the full file.
#NEXUS
begin DATA;
dimensions ntax=235 nchar=137324;
format datatype=nucleotide missing=? gap=-;
matrix
Acanthisitta_chloris_genome NNCTCTCAGGATCCAGACTTCACACAGGTT--AGAAACTACT-C-T-GCCTTCTGGATCC-T-TGCT----------------TT-ATGCCC---T-GTCCTG-TTTTATTGTGACAGTTGCCTG--------------TTTTT-CACAGAA--------------AC-TAAG-----------GCCTAGTGA---------CTCCTTATCCTTTGG--TTCGGGCA--ACACAGCTGTC-TTATCTTAAGGCCCAGTGGAATGA--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------G-TCAGCTGGCTC-CTCAGGTGTGA--------AAAC------------TTGGG-CATAG------GTATAGATATGCTCT-TAATTGACCTC-TAGCTG------------GTG--
# infer the concatentated tree with 1000 ultrafast bootstraps and an edge-linked fully-partitioned model (-p is the same as -spp from version 1.7 onwards)
iqtree -s alignment.nex -p alignment.nex --prefix concat -bb 1000 -nt AUTO
# infer the 88 single-locus trees
iqtree -s alignment.nex -S alignment.nex --prefix loci -nt 50
# calculate concordance factors
iqtree -t concat.treefile --gcf loci.treefile -s alignment.nex --scf 100 --prefix concord