This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#The input is two colums: x and corresponding y values | |
require(MASS) ## for mvrnorm() | |
set.seed(1) | |
mine <- read.table("xy.txt") | |
mine <- data.frame(mine) | |
names(mine) <- c("X","Y") | |
plot(mine) | |
res <- resid(mod <- lm(Y ~ X, data = mine)) | |
res.qt <- quantile(res, probs = c(0.001,0.999)) | |
want <- which(res >= res.qt[1] & res <= res.qt[2]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""retrieve only parsimony infomative | |
sites from a nucleotide multiple sequence alignment""" | |
from optparse import OptionParser | |
import sys | |
try: | |
from Bio import SeqIO | |
except: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from __future__ import division | |
"""calculates the SNP and homoplash density | |
using a NASP formatted SNP matrix""" | |
import optparse | |
import sys | |
import collections |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""filter a NASP formatted SNP | |
matrix, to only include a list of genomes. | |
The collections module requires Python 2.7+. | |
This script has not been tested with Python 3""" | |
from optparse import OptionParser | |
from collections import deque | |
import sys |
NewerOlder