python - Biopython bootstrapping phylogenetic trees with custom distance matrix -


i trying create bootstrapped phylogenetic tree instead of using raw multiple sequence alignment data , standard scoring system, want use own custom distance matrix have created. have looked @ http://biopython.org/wiki/phylo , have been able create single tree using own custom distance matrix using following code:

dm = treeconstruction._distancematrix(tfs,dmat) treeconstructor  = distancetreeconstructor(method = 'upgma') upgmatree = treeconstructor.upgma(dm) phylo.draw(upgmatree) 

where dmat lower triangle distance matrix, , tfs list of names used columns/rows. when looking @ bootstrapping examples, seems of input needs raw sequence data , not distance matrix used above, know workaround problem? thanks!

short answer: no, cannot use distance matrix bootstrap phylogeny.

long answer: first step in bootstrapping phylogeny calls creating set of data pseudoreplicates. dna sequences, nucleotide positions randomly drawn alignment (the whole column) repetitions total length of alignment.

let's assume 10 bp long alignment 2 sequences differing 2 mutations. simplicity sake, distance d = 0.2.

aattccgggg aactccggag 

bootstrapping such dataset call positions 3, 8, 5, 9, 10, 1, 6, 9, 6, 5 represent pseudoreplicate.

set.seed(123) sample(1:10, 10, replace = true) [1]  3  8  5  9 10  1  6  9  6  5  tgcggacgcc cgcagacacc 

we obtained dataset variables (columns) identical original alignment, occurring @ different frequencies. note d = 0.3 in bootstrapped alignment.

using approach, can bootstrap variable or dataset containing multiple variables. distance matrix cannot used in way, because represents processed information.

solution:

repeat process calculating custom distance matrix on own data pseudoreplications.

# function calculate custom distance matrix calc.dist <- function(dat) { ... }  nrep <- 100 reps <- lapply(1:nrep, fun=function(i) calc.dist(dat[,sample(1:ncol(dat), ncol(dat), replace = true)])) 

Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -