2 if (is
.null(argv
) | length(argv
)<2) {
3 cat("Usage: kmerfreq.r blood_hist hist_file\n")
9 if(!exists("D__myfit"))
14 #infile <- 'mlbacDonor.k25.lz4.hist'
19 blood
=read
.table(bloodfile
,skip
=8)
20 #mda=read.table('mdaS23.k25.lz4.hist',skip=8)
21 #malbac=read.table('S01.k25.lz4.hist',skip=8)
22 indata
=read
.table(infile
,skip
=8)
24 getdata
<- function(x
,range
) {
26 cnt
<- as
.numeric(x
[,2])
28 thedata
<- cbind(thefreq
,cnt
)
29 flag
<- thedata
[,1] <= range
30 #RVAL <- cbind(theratio[flag],thefreq[flag])
31 RVAL
<- cbind(cnt
[flag
],thefreq
[flag
])
35 usedata1
<- getdata(blood
,testXrange
)
36 usedata2
<- getdata(indata
,testXrange
)
37 #usedata3 <- getdata(malbac,testXrange)
39 #xx=cbind(usedata2[,1],usedata1[,1])
42 #yy=cbind(usedata1[,1],usedata2[,1])
43 #aa=chisq.test(usedata2[,1], p = usedata1[,1], rescale.p = TRUE)
44 aa
=chisq
.test(cbind(xx
,yy
))
47 bb
<-wilcox
.test(xx
,yy
,alternative
='two',paired
=TRUE,conf
.int
=TRUE)
52 print(c(sum(xx
),sum(yy
)))
56 scaleres <- myfit(usedata2, par = list(lambda = 3))
57 scaleres$fitted <- as.vector(usedata1[, 1])
58 print('===scaledmyfit===')
61 arg <- deparse(substitute(x))
62 RVAL <- cbind(x$observed,x$fitted,(x$observed-x$fitted)/x$fitted)
63 #RVAL <- round(RVAL,digits = 6)
64 colnames(RVAL) <- c(paste0(arg,'.ob'),paste0(arg,'.fi'),'(O-E)/E')
65 rownames(RVAL) <- 1+ 1:nrow(RVAL)
68 print(cbind(dbg1(scaleres)))
69 scalesum <- summary(scaleres)
74 ksres
<- ks
.test(xx
,yy
,alternative
='t')
76 ksres
<- ks
.test(mm
,nn
,alternative
='t')
80 ./kmercmp.r blood.fq.k25.gz.hist.fixed S1.fq.k25.gz.hist.fixed
81 ./kmercmp.r blood.fq.k25.gz.hist.fixed S2.fq.k25.gz.hist.fixed
82 ./kmercmp.r blood.fq.k25.gz.hist.fixed S3.fq.k25.gz.hist.fixed
83 ./kmercmp.r blood.fq.k25.gz.hist.fixed S23.fq.k25.gz.hist.fixed
84 ./kmercmp.r blood.fq.k25.gz.hist.fixed S24.fq.k25.gz.hist.fixed
85 ./kmercmp.r blood.fq.k25.gz.hist.fixed S28.fq.k25.gz.hist.fixed
87 ./kmercmp.r S2.fq.k25.gz.hist.fixed S1.fq.k25.gz.hist.fixed
88 ./kmercmp.r blood.fq.k25.gz.hist.fixed mlbacDonor.k25.lz4.hist.fixed
89 ./kmercmp.r mlbacDonor.k25.lz4.hist.fixed S23.fq.k25.gz.hist.fixed