Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 33 lines (30 sloc) 1.24 kb
9abe07d @sharpton Adding documentation, installation wrapper, license to repository
authored
1 #tree_to_matrix.R - convert a phylogeny to an R distance matrix
2 #Copyright (C) 2011 Thomas J. Sharpton
3 #author contact: thomas.sharpton@gladstone.ucsf.edu
4 #
5 #This program is free software: you can redistribute it and/or modify
6 #it under the terms of the GNU General Public License as published by
7 #the Free Software Foundation, either version 3 of the License, or
8 #(at your option) any later version.
9 #
10 #This program is distributed in the hope that it will be useful,
11 #but WITHOUT ANY WARRANTY; without even the implied warranty of
12 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 #GNU General Public License for more details.
14 #
15 #You should have received a copy of the GNU General Public License
16 #along with this program (see LICENSE.txt). If not, see
17 #<http://www.gnu.org/licenses/>.
18
8097d61 @sharpton adding core code base
authored
19 # Invoke % R --slave --args intree outmatrix < tree_to_matrix.R
20
21 library(ape)
22 Args <- commandArgs()
23 intree <- Args[4]
24 outmatrix <- Args[5]
25 #refnames <- Args[6]
26 phy <- read.tree( intree )
27 #reftips <- as.vector(scan(file=refnames))
28 #pruned <- drop.tip(phy, reftips)
29 #phy$tip.label[grep(pattern, invert=TRUE)])
30 #phydist <- cophenetic( pruned )
31 phydist <- cophenetic( phy )
32 write.table( phydist, outmatrix )
Something went wrong with that request. Please try again.