From 5b067236b73f45d6d5fff5cbd20f7fd451f3f169 Mon Sep 17 00:00:00 2001 From: Maryam Hayati Date: Sun, 7 Jul 2019 12:55:51 -0700 Subject: [PATCH] Implementation in R using NTT --- RF_NTTfromPy.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RF_NTTfromPy.R b/RF_NTTfromPy.R index 663ef38..608362a 100644 --- a/RF_NTTfromPy.R +++ b/RF_NTTfromPy.R @@ -3,7 +3,6 @@ library("ape") library("phangorn") library("readtext") -setwd("/Users/maryam/Desktop/Research/RF_improvment/FinalCodes") options("digits"=22) options("scipen"=100) #Beta function @@ -116,9 +115,9 @@ RF_Convolve=function(tree,n){ #read the output of Python - system('python /Users/maryam/Desktop/Research/RF_improvment/FinalCodes/python_code/ntt_fromR.py') + system('python /python_code/ntt_fromR.py') - U=as.matrix(read.csv("/Users/maryam/Desktop/Research/RF_improvment/FinalCodes/outNTT.txt",header = FALSE, quote="")) + U=as.matrix(read.csv("outNTT.txt",header = FALSE, quote="")) Matc=ceiling(length(R1aug)/(3*nrow(R1))) sum3=matrix(c(U,numeric(Matc*3*nrow(R1)-length(R1aug))),nrow=3*nrow(R1))[1:nrow(R1),1:ncol(R1)] @@ -155,6 +154,7 @@ qmT=function(R,n,m){ return(qmt) } +#this function computes the RF distribution polynomial=function(tree,n){ Coef=numeric() R=RF_Convolve(tree,n)