Skip to content

Save Results in svg format

3 messages · Anas Jamshed, Bert Gunter, David Winsemius

#
#Loading the required libraries
library(ape)
library(phangorn)
library(seqinr)
#Importing the required file
align_5 <- read.alignment("C:/Users/VAMSI/align 5.fasta", format = "fast")
align_119 <- read.alignment("C:/Users/VAMSI/align 119.fasta", format = "fasta")
Computing the distance matrix for both UPGMA and NJ algorithms implementation.
 matrix_5x5 <- dist.alignment(align_5, matrix = "identity")
summary(matrix_5x5)

matrix_119x119 <- dist.alignment(align_119, matrix = "identity")
summary(matrix_119x119)
#Implementation of UPGMA algorithm for a small matrix (5x5) and entire
matrix (119x119)
UPGMA_5x5 <- upgma(matrix_5x5)
UPGMA_119x119 <- upgma(matrix_119x119)
summary(UPGMA_5x5)

summary(UPGMA_119x119)
#Implementation of NJ algorithm for a small matrix (5x5) and entire
matrix (119x119)
NJ_5x5 <- NJ(matrix_5x5)
NJ_119x119 <- NJ(matrix_119x119)
summary(NJ_5x5)

summary(NJ_119x119)


I have done this whole analysis but don't know how can I  the save my
tree file in svg or some other image format
#
Warning: I have basically no idea what you are doing. I presume that you
have consulted ?svg, however. If not , you should probably do so.

Also, a search on "save as svg" on rseek.org  brought up the svglite
package, among other resources. You might want to see what that offers.

Cheers,
Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Thu, Dec 3, 2020 at 7:12 PM Anas Jamshed <anasjamshed1994 at gmail.com>
wrote:

  
  
#
On 12/3/20 7:12 PM, Anas Jamshed wrote:
SVG format is for graphics. I don't see any R graphics calls or anything 
I recognize as a "tree". (Perhaps the summary function for objects 
returned from `upgma` include graphics? I surely do not know.)

Cairo graphics is supported in the grDevices package. It should be 
loaded by default. Have your tried this at your console:


?svg