Skip to content

Commit

Permalink
merge me
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyBoy432 committed Feb 24, 2017
2 parents 61e4ae6 + 9a1e078 commit 01a93c7
Show file tree
Hide file tree
Showing 13 changed files with 238,079 additions and 0 deletions.
825 changes: 825 additions & 0 deletions Week6-PhyloTraits/PhyloTraits_handout.Rmd

Large diffs are not rendered by default.

456 changes: 456 additions & 0 deletions Week7-PhyloCom/PhyloCom_assignment.Rmd

Large diffs are not rendered by default.

Binary file added Week7-PhyloCom/PhyloCom_assignment.pdf
Binary file not shown.
51 changes: 51 additions & 0 deletions Week7-PhyloCom/bin/MothurTools.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
################################################################################
# #
# MothurTools Functions Source Code #
# #
################################################################################
# #
# Written by: Mario Muscarella #
# #
# Last update: 2015/02/22 #
# #
################################################################################
# #
# Notes: This code provides numerous functions to be used in the analysis of #
# 16S rRNA sequence data post mothur anlaysis #
# #
# Issues: Slow performance reading in OTU tables (common R issue) #
# #
# Recent Changes: #
# #
# Future Changes (To-Do List): #
# 1. Design functions to work with shared files in memory #
# 2. Add warnings #
# #
################################################################################

require("reshape")||install.packages("reshape");require("reshape")

# Import OTU Site-by-Species Matrix
read.otu <- function(shared = " ", cutoff = "0.03"){
matrix <- read.table(shared, header=T, fill=TRUE, comment.char="", sep="\t")
matrix.cutoff <- subset(matrix, matrix$label == cutoff)
matrix.out <- as.matrix(matrix.cutoff[1:dim(matrix.cutoff)[1],
4:(3+mean(matrix.cutoff$numOtus))])
row.names(matrix.out) <- matrix.cutoff$Group
return(matrix.out)
}

# Import Taxonomy Information
read.tax <- function(taxonomy = " ", format = "rdp"){
tax_raw <- read.delim(taxonomy) # load genus-level data
if (format == "rdp"){
tax <- cbind(OTU = tax_raw[,1],colsplit(tax_raw[,3], split="\\;",
names=c("Domain","Phylum","Class","Order","Family","Genus")))
for (i in 2:7){
tax[,i] <- gsub("\\(.*$", "", tax[,i])
}
} else {
stop("This funciton currently only works for RDP taxonomy")
}
return(tax)
}
1 change: 1 addition & 0 deletions Week7-PhyloCom/data/20130801_PondDataMod.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Location,Sample_ID,lat,long,Elevation,Diameter,Depth,Cal_Volume,ORP,Temp,SpC,DO,TDS,Salinity,pH,Color,chla,DOC,DON,canopy,TPBCSP,BC001,39.121528,-86.194583,226,11.5,1,398.1641439,198,19.9,31,2.3,0.02,0.01,6.11,0.0859,86.27,8.746,0.6036,0.1518,598.1020545BCSP,BC002,39.163583,-86.211806,276,15.5,0.5,974.9081952,144.5,21.61,48,1.89,0.031,0.02,6.39,0.03624922,93.38,10.01,0.3829,0.3226,123.0635415BCSP,BC003,39.152194,-86.194175,258,15.5,1.3,974.9081952,107.4,21.14,61,0.81,0.04,0.03,6.31,0.0917,131.28,6.817,1.282,0.2085,291.4364115BCSP,BC004,39.144528,-86.192694,249,13.5,0.75,644.1246688,84.7,22.63,41,1.8,0.026,0.02,6.25,0.0436,88.16,6.97,0.2195,0.506,80.1190005BCSP,BC005,39.1485,-86.190167,241,7,0.75,89.79719002,91.8,21.74,46,2.75,0.03,0.02,6.17,0.057,110.62,7.836,0.2928,0.1954,81.2540985BCSP,BC015,39.133194,-86.196833,126,12,1.2,452.3893421,71.3,22.48,61,0.99,0.039,0.03,6.31,0.0543,374.92,6.665,0.2014,0.4956,568.7786895BCSP,BC016,39.127528,-86.199278,238,11.5,2,398.1641439,252.5,19.73,63,2.04,0.041,0.03,6.5,0.0278,27.38,7.41,0.8582,0.2129,160.26BCSP,BC018,39.123889,-86.206722,244,11,0.75,348.4549852,185.7,19.33,38,1.53,0.025,0.02,6.31,0.0386,28.39,8.868,0.1879,0.2055,253.7889945BCSP,BC020,39.127806,-86.209833,248,10,1.5,261.7993878,132,19.45,60,2.13,0.039,0.03,6.6,0.0205,27.58,5.598,1.497,0.1775,76.92BCSP,BC048,39.132889,-86.275639,246,16,1.5,1072.330292,42,23.7,48,0.27,0.031,0.02,6.34,0.06881364,48.66,9.395,1.024,0.2096,137.87BCSP,BC049,39.140167,-86.275889,247,16.5,1.75,1176.035575,30,24.4,68,0.44,0.044,0.03,6.47,0.07097846,70.61,9.817,0.638,0.1347,217.63BCSP,BC051,39.142111,-86.270639,282,22.5,1.75,2982.058652,83,24.14,48,3.55,0.031,0.02,6.66,0.0543508,2399.78,8.655,0.3469,0.1637,549.63BCSP,BC105,39.135583,-86.265,284,24.5,2,3850.054522,104.4,24.68,55,3.5,0.036,0.02,6.55,0.0481327,109.79,8.718,0.6411,0.1379,156.13BCSP,BC108,39.133056,-86.257611,285,13.8,1.4,254.1,62.2,22.5,63,0.32,0.041,0.03,6.25,0.06581974,184.47,10.31,1.17,0.132,227.82BCSP,BC262,39.176139,-86.205722,222,17.5,1.75,1403.081094,133.9,22.64,37,2.47,0.024,0.02,6.41,0.0200361,65.03,7.349,0.4767,0.1951,131.81BCSP,BCL01,39.167917,-86.203889,225,15.5,1.5,974.9081952,141.7,22,55,1.16,0.036,0.02,6.47,0.03763102,136.6,10.45,0.5833,0.1901,159.99BCSP,BCL03,39.17525,-86.209444,222,13.5,1.5,644.1246688,84.7,20.8,98,0.53,0.064,0.05,6.37,0.06015436,764.6,10.03,1.699,0.0967,405.06HNF,HNF132,39.038278,-86.209194,256,16,1.5,1072.330292,190.5,23.4,59,4.49,0.039,0.03,6.9,0.0147,80.57,8.662,0.3646,0.1797,170.5484745HNF,HNF133,39.046472,-86.2155,279,13.5,1.5,644.1246688,144.8,21.7,5,1.28,0.037,0.03,6.36,0.0831,103.62,7.842,0.6778,0.2375,419.229528HNF,HNF134,39.043056,-86.214444,294,13,1.5,575.173255,134.2,22.61,70,1.74,0.046,0.03,6.65,0.019,88.16,10.064,0.3928,0.2337,145.7655015HNF,HNF144,39.053056,-86.218639,286,16,0.75,1072.330292,156.1,23.26,23,1.38,0.015,0.01,6.05,0.023,76.71,9.628,0.2196,0.399,208.1958915HNF,HNF168,39.035111,-86.329639,257,32.5,1.5,8987.082109,161.3,24.72,29,3.78,0.019,0.01,6.38,0.0356965,50.19,7.501,0.2272,0.4778,151.3464HNF,HNF185,38.991972,-86.387556,279,30,2,7068.583471,153,22.86,28,2.86,0.018,0.01,6.27,0.0192,84.25,8.016,0.08127,0.3407,184.5480165HNF,HNF187,39.011836,-86.409764,267,26,1,4601.38604,188.6,22.36,27,1.92,0.017,0.01,5.9,0.0161,31.49,10.59,0.08139,0.4805,62.32HNF,HNF216,39.024258,-86.312464,267,27,1.25,5152.99735,267.6,22.36,13,1.91,0.008,0,6.24,0.0163,20.94,8.413,0.264,0.5246,83.24052HNF,HNF217,39.021417,-86.316778,226,25,0.75,4090.615434,178.3,24.22,22,3.28,0.014,0.01,6.18,0.03790738,23.52,13.15,0.2608,0.4594,68.295063HNF,HNF224,39.032361,-86.303861,250,25,1.25,4090.615434,163,22.37,43,1.9,0.028,0.02,6.44,0.0244,66.56,4.995,0.2266,0.3841,197.6016435HNF,HNF225,39.042639,-86.316139,247,28,1.1,5747.020161,230.8,23.06,12,2.79,0.008,0,5.78,0.0384,31.97,9.25,0.12,0.5521,89.483559HNF,HNF229,39.049417,-86.317472,268,31,1.1,7799.265562,138.5,24,35,4.33,0.022,0.01,6.57,0.0313,48.55,9.833,0.2992,0.4448,147.751923HNF,HNF242,39.008736,-86.305094,293,23.7,0.75,3485.087326,221.6,22.93,16,5.58,0.01,0.01,6.21,0.0206,56.4,9.206,0.2824,0.6273,86.456631HNF,HNF250,39.029278,-86.319667,165,23,1,3185.313151,140.2,22.96,50,2.44,0.032,0.02,6.54,0.02726752,20.74,7.26,1.004,0.2062,222.1954335HNF,HNF267,39.003806,-86.305833,216,24,1,3619.114737,101.6,24.01,40,3.51,0.026,0.02,6.53,0.02749782,162.56,7.36,0.913,0.3134,238.8435375HNF,HNF269,39.0998264,-86.306817,281,20,0.25,2094.395102,326,25.8,24,6.05,0.015,0.01,6.6,0.0296,27.06,18.38,0.4344,0.7596,246.505449HNF,HNF279,39.017394,-86.393003,265,14.5,1,798.1281586,27.1,21.3,70,0.31,0.046,0.03,6.54,0.0275,237.12,4.815,0.8656,,191.5477875YSF,YSF004,39.124278,-86.282444,309,22,1.5,2787.639881,106.8,20.1,57,0.97,0.037,0.03,6.63,0.0453,445.1,10.746,0.2257,0.2645,391.7034015YSF,YSF117,39.133017,-86.30795,276,11,1.1,348.4549852,163.7,19.56,64,1.11,0.042,0.03,6.47,0.0255,11.6,12.028,0.7348,0.203,305.2467705YSF,YSF295,39.134417,-86.280583,287,13.5,2,644.1246688,120,21.23,49,3.1,0.032,0.02,6.63,0.0295,217.87,16.198,0.4623,0.1497,295.4092545YSF,YSF296,39.131583,-86.295111,258,10,1.5,261.7993878,78.4,20.84,56,0.96,0.037,0.03,6.43,0.0975,46.87,14.326,0.6268,0.1518,570.765111YSF,YSF298,39.1284,-86.327567,258,13,1.5,575.173255,190.7,20.03,44,0.63,0.028,0.02,6.35,0.039,36.62,7.054,0.3259,0.275,455.741847YSF,YSF300,39.125517,-86.3425,257,17,1.75,1286.220392,181.3,19.87,44,1.01,0.028,0.02,6.3,0.0706,163.64,7.8,0.2224,0.1788,160.1434095YSF,YSF44,39.109833,-86.298111,298,16,1.5,1072.330292,140.6,19.72,55,0.19,0.036,0.03,6.38,0.0413,27.82,10.824,1.035,0.1862,737.246151YSF,YSF45,39.113667,-86.293333,301,21.5,1.5,2601.860491,116,19.26,45,0.8,0.029,0.02,6.18,0.0366,204.1,9.922,0.4197,0.226,211.2228195YSF,YSF47,39.1169,-86.284417,289,19.5,1.25,1941.209736,138.8,21.41,33,3.55,0.022,0.01,6.33,0.0222,222.61,9.246,0.1648,0.2199,477.9708495YSF,YSF65,39.142167,-86.286083,272,10,1.5,261.7993878,157.5,21.99,28,2.82,0.018,0.01,6.35,0.0357,183.2,8.14,0.271,0.1391,157.967805YSF,YSF66,39.137778,-86.297528,280,17,0.75,1286.220392,146,21.04,37,0.79,0.023,0.02,6.16,0.0375,27.95,9.662,0.1931,0.1659,442.120671YSF,YSF69,39.129806,-86.283333,283,14,1.5,718.3775201,115.5,21.53,65,1.13,0.043,0.03,6.52,0.0332,289.05,10.506,0.4639,0.1752,439.5667005YSF,YSF70,39.127567,-86.286233,278,14.5,0.5,798.1281586,45,21.46,44,3.52,0.029,0.02,6.31,0.0425,401.69,11.266,0.1026,0.2205,538.3202265YSF,YSF71,39.123278,-86.288667,283,17,1.5,1286.220392,215,20.78,44,1.96,0.028,0.02,6.24,0.0333,78.67,10.502,0.3617,0.1985,381.771294YSF,YSF74,39.110767,-86.2867,265,13.5,1,644.1246688,130,21.6,58,0.86,0.038,0.03,6.5,0.0268,35.78,14.87,1.079,0.2487,479.389722BCSP,BC010,39.140722,-86.196611,258,20,1.2,2094.395102,187.4,23.62,15,4.39,0.01,0.01,5.99,0.0487,36.46,6.616,0.1531,0.3983,145.7655015HNF,HNF221,39.033139,-86.31075,198,28,1.5,5747.020161,203.1,22.5,30,4.27,0.019,0.01,6.5,0.0306,87.79,9.726,0.1342,0.3941,92.4158955YSF,YSF46,39.3118583,-86.290278,307,16,1.25,1072.330292,156.2,18.57,36,2.97,0.023,0.02,6.46,0.0271,4.84,7.318,0.28,0.1882,651.735435YSF,YSF67,39.13775,-86.296889,276,15,1.2,883.5729338,184.4,23.54,34,3.72,0.023,0.01,6.53,0.0287,50.91,11.02,0.1441,0.3095,270.6262815HNF,HNF189,39.018853,-86.329706,227,35.2,1.5,11418.17295,187.3,24.29,42,3.71,0.027,0.02,6.7,0.0107,23.81,7.993,0.3153,0.4844,HNF,HNF190,39.020928,-86.440528,239,31,1.5,7799.265562,114.5,26.2,82,4.9,0.053,0.04,7.08,0.0157,34.81,5.829,0.2151,,HNF,HNF191,39.022747,-86.445147,234,35,1.5,11224.64875,,,,,,,6.54,,24.81,9.459,0.3543,,HNF,HNF236,39.060744,-86.312136,247,,,0,294.3,20,36,,,,6.5,,13.35,8.642,0.256,,151.4409915HNF,HNF237,39.003781,-86.30575,278,21.7,0.5,2675.148088,400,20.3,52,5.9,,,7.3,,,14.19,1.037,,431.904789
Expand Down
Loading

0 comments on commit 01a93c7

Please sign in to comment.