# HG changeset patch # User elixir-it # Date 1592403770 0 # Node ID 2d8f37e3b77411ca56cbaf83dd0066d0e1b752df # Parent a3342d37ab295519e79b1b4bc93b69a7162b904a Uploaded diff -r a3342d37ab29 -r 2d8f37e3b774 survival.R --- a/survival.R Tue Jun 09 16:15:40 2020 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -#!/usr/bin/env Rscript -args <- commandArgs(trailingOnly = TRUE) -fileR=args[1] -fileT=args[2] -ofile=args[3] -data_R=read.table(fileR,header=T) -data_T=read.table(fileT,header=T) - -#P=wilcox.test(data_R$Score,data_T$Score,alternative="gr")$p.value -range= rev(seq(min(data_R$VINYL_score),max(data_R$VINYL_score),0.5)) -header=paste("Cut-off","PosD","PosH","FisherPV","OR",sep="\t"); -cat(header,file=ofile,sep="\n",append=T) - -m=matrix(ncol=2,nrow=2) -totR=nrow(data_R) -totT=nrow(data_T) -for (r in range) -{ - posR=sum(data_R$VINYL_score>=r); - posT=sum(data_T$VINYL_score>=r); - m[,1]=c(posR,totR); - m[,2]=c(posT,totT); - - F=fisher.test(m,alternative="greater") - Fpv=F$p.value - Fodds=F$estimate - - string=paste(r,posR,posT,Fpv,Fodds,sep="\t") - cat(string,file=ofile,sep="\n",append=T) -} diff -r a3342d37ab29 -r 2d8f37e3b774 survival_M.R --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/survival_M.R Wed Jun 17 14:22:50 2020 +0000 @@ -0,0 +1,30 @@ +#!/usr/bin/env Rscript +args <- commandArgs(trailingOnly = TRUE) +fileR=args[1] +fileT=args[2] +ofile=args[3] +data_R=read.table(fileR,header=T) +data_T=read.table(fileT,header=T) + +#P=wilcox.test(data_R$Score,data_T$Score,alternative="gr")$p.value +range= rev(seq(min(data_R$VINYL_score),max(data_R$VINYL_score),0.5)) +header=paste("Cut-off","PosD","PosH","FisherPV","OR",sep="\t"); +cat(header,file=ofile,sep="\n",append=T) + +m=matrix(ncol=2,nrow=2) +totR=nrow(data_R) +totT=nrow(data_T) +for (r in range) +{ + posR=sum(data_R$VINYL_score>=r); + posT=sum(data_T$VINYL_score>=r); + m[,1]=c(posR,totR); + m[,2]=c(posT,totT); + + F=fisher.test(m,alternative="greater") + Fpv=F$p.value + Fodds=F$estimate + + string=paste(r,posR,posT,Fpv,Fodds,sep="\t") + cat(string,file=ofile,sep="\n",append=T) +}