R version 2.6.2 (2008-02-08) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(genealogicalSorting) Loading required package: ape > # begin working with cricket data > cyt.tree <- read.tree("cyt-c.tree") > cyt.assignments <- readAssignmentFile("cyt-c.groups",cyt.tree) > gsi(cyt.tree,"firmus",cyt.assignments) [1] 0.84 > gsi(cyt.tree,"pennsylvanicus",cyt.assignments) [1] 0.8333333 > gsi(cyt.tree,"ovisopis",cyt.assignments) [1] 1 > gsi(cyt.tree,"veletis",cyt.assignments) [1] 1 > results <- singleTreeAnalysis(cyt.tree,"cyt-c.groups",10000,10) Loading required package: snow Loading required package: Rmpi 10 slaves are spawned successfully. 0 failed. [1] "Doing 1000 reps on each client" $groups [1] "pennsylvanicus" "firmus" "ovisopis" "veletis" $gsi [1] 0.8333333 0.8400000 1.0000000 1.0000000 $pvals [1] 0.00009999 0.00009999 0.00719928 0.00809919 $nperms [1] 10000 > # begin working with dolphin data -- over 800 trees in four separate files > act_info <- readWeightedNexus("act_bs.trees") > act_trees <- act_info$trees > act_weights <- act_info$weights > for(i in 1:length(act_trees)) { # root each tree at a particular outgroup act_trees[[i]] <- root(act_trees[[i]],"LAC9300") # remove the outgroup from each tree act_trees[[i]] <- drop.tip(act_trees[[i]],"LAC9300") } > # here, one could perform an analysis on this particular set of trees like so... act_results <- multiTreeAnalysis(act_trees,dolphin_mapping.txt,10000,10,act_weights) > but_info <- readWeightedNexus("but_bs.trees") > but_trees <- but_info$trees > but_weights <- but_info$weights > for(i in 1:length(but_trees)) { but_trees[[i]] <- root(but_trees[[i]],"LAC9300") but_trees[[i]] <- drop.tip(but_trees[[i]],"LAC9300") } > cam_info <- readWeightedNexus("cam_bs.trees") > cam_trees <- cam_info$trees > cam_weights <- cam_info$weights > for(i in 1:length(cam_trees)) { cam_trees[[i]] <- root(cam_trees[[i]],"LAC9300") cam_trees[[i]] <- drop.tip(cam_trees[[i]],"LAC9300") } > hex2_info <- readWeightedNexus("hex2_bs.trees") > hex2_trees <- hex2_info$trees > hex2_weights <- hex2_info$weights > for(i in 1:length(hex2_trees)) { hex2_trees[[i]] <- root(hex2_trees[[i]],"LAC9300") # remove both outgroups from this set of trees hex2_trees[[i]] <- drop.tip(hex2_trees[[i]],"LAC9300") hex2_trees[[i]] <- drop.tip(hex2_trees[[i]],"LAC9300b") } > # concatenate the four sets of trees together > all_trees <- act_trees > for(i in 1:length(but_trees)) { all_trees[[1 + length(all_trees)]] <- but_trees[[i]] } > for(i in 1:length(cam_trees)) { all_trees[[1 + length(all_trees)]] <- cam_trees[[i]] } > for(i in 1:length(hex2_trees)) { all_trees[[1 + length(all_trees)]] <- hex2_trees[[i]] } > # concatenate the four sets of weights together > all_weights <- array() > for(i in 1:length(act_weights)) { all_weights[i] <- act_weights[i] } > for(i in 1:length(but_weights)) { all_weights[1 + length(all_weights)] <- but_weights[i] } > for(i in 1:length(cam_weights)) { all_weights[1 + length(all_weights)] <- cam_weights[i] } > for(i in 1:length(hex2_weights)) { all_weights[1 + length(all_weights)] <- hex2_weights[i] } > # now we will perform an analysis on the combined set of trees... > all_results <- multiTreeAnalysis(all_trees,"dolphin_mapping.txt",10000,10,all_weights) 10 slaves are spawned successfully. 0 failed. [1] "Doing 1000 reps on each client" "treenum" "group" "gsi" "pval" 1 "lob" 1.0000000 0.00239976 1 "los" 0.8000000 0.00239976 2 "lob" 1.0000000 0.00069993 2 "los" 0.8000000 0.00079992 3 "lob" 0.8750000 0.00219978 3 "los" 0.3333333 0.98050195 4 "lob" 1.0000000 0.00069993 4 "los" 0.8000000 0.00079992 5 "lob" 0.7000000 0.03289671 5 "los" 0.3333333 0.98050195 6 "lob" 1.0000000 0.00239976 6 "los" 0.8000000 0.00239976 7 "lob" 0.7777778 0.01739826 7 "los" 0.3333333 0.98050195 8 "lob" 1.0000000 0.00069993 8 "los" 0.8000000 0.00079992 9 "lob" 0.5833333 0.19728027 9 "los" 0.3333333 0.98050195 10 "lob" 0.5833333 0.18288171 10 "los" 0.3333333 0.97180282 11 "lob" 0.5833333 0.19728027 11 "los" 0.3636364 0.89321068 12 "lob" 0.8750000 0.00219978 12 "los" 0.3333333 0.97510249 [output truncated] "group" "egsi" "epval" "lob" 0.6094504 0.00169983 "los" 0.6150855 0.00009999