Dear all

I got stuck using mvrs in ape3.4, running into the following error message:

> ph <- mvrs(ds, vs, fs = 15)
*Error in mvrs(ds, vs, fs = 15) : *
*  distance information insufficient to construct a tree, leaves 805 and
806 isolated from tree*

I would be prepared to drop a few taxa if this means that mvrs runs to
completion. But I am not sure which taxa to delete, the problem persists if
rows 805, 806 are deleted from my distance matrix. Does someone know of a
workaround?

Alternatively, is there another tree reconstruction algorithm that can also
make use of the information provided through a variance matrix? I may not
be aware of all options.

I should add that the following works fine
> njs(ds, fs = 15)
but I would really want to use the variance matrix too because some of the
distances are estimated from short regions where the corresponding two
sequences overlap, and are therefore much less reliable than others.

Thank you in advance

Oliver

To reproduce:

The ds and vs matrix can be collected here within the next 3 weeks, size is
33MB:
https://fileexchange.imperial.ac.uk/
Claim ID: aHyXuXHmf8tVXyEa
Claim Passcode: GefSka7PbmyeoE2c

load("mvrs_inputs.rda")
na.rm.p <- 0.1
diag(d) <- NA_real_
diag(v) <- NA_real_
# remove cols/rows that contain nothing else than NAs
tmp <- apply(d, 1, function(x) !all(is.na(x)))
cat('\nIn D: found',length(which(!tmp)),'columns / rows with NA only:
remove in D and V. ', rownames(d)[!tmp])
ds <- d[tmp,tmp]
vs <- v[tmp,tmp]
tmp <- apply(vs, 1, function(x) !all(is.na(x)))
cat('\nIn V: found additional',length(which(!tmp)),'columns / rows with NA
only: remove in D and V too. ', rownames(d)[!tmp])
ds <- ds[tmp,tmp]
vs <- vs[tmp,tmp]
# remove cols/rows that contain more than 10% NAs
tmp <- apply(ds, 1, function(x) length(which(is.na(x))) ) / ncol(ds)
tmp <- which(tmp>na.rm.p)
cat('\nIn D: found',length(tmp),'columns / rows with more
than',na.rm.p*100,'% NAs: remove in D and V. ', rownames(ds)[tmp])
ds <- ds[-tmp,-tmp]
vs <- vs[-tmp,-tmp]
ph<- mvrs(ds, vs, fs = 15)



-- 
Oliver Ratmann
Research fellow
Dep Infectious Disease Epidemiology
Imperial College London, St Mary's Campus
Norfolk Place,
London W2 1PG
UK

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Reply via email to