├── .gitignore ├── Addmixture2.plots.R ├── Addmixture3.plots.R ├── genomic_window_mean.R ├── manhattan_plot_VAAST_simple ├── .Rapp.history ├── manhattanVAAST.R ├── manhattanVAAST.Rcheck │ ├── 00check.log │ ├── 00install.out │ ├── Rdlatex.log │ ├── manhattanVAAST-Ex.R │ ├── manhattanVAAST-Ex.Rout │ ├── manhattanVAAST-Ex.pdf │ ├── manhattanVAAST-manual.log │ ├── manhattanVAAST-manual.pdf │ └── manhattanVAAST │ │ ├── DESCRIPTION │ │ ├── INDEX │ │ ├── Meta │ │ ├── Rd.rds │ │ ├── hsearch.rds │ │ ├── links.rds │ │ ├── nsInfo.rds │ │ └── package.rds │ │ ├── NAMESPACE │ │ ├── R │ │ ├── manhattanVAAST │ │ ├── manhattanVAAST.rdb │ │ └── manhattanVAAST.rdx │ │ ├── help │ │ ├── AnIndex │ │ ├── aliases.rds │ │ ├── manhattanVAAST.rdb │ │ ├── manhattanVAAST.rdx │ │ └── paths.rds │ │ └── html │ │ ├── 00Index.html │ │ └── R.css ├── manhattanVAAST │ ├── DESCRIPTION │ ├── DESCRIPTION~ │ ├── NAMESPACE │ ├── R │ │ ├── manhattanVAAST-internal.R │ │ ├── manhattanVAAST.R │ │ └── manhattanVAAST.R~ │ ├── Read-and-delete-me │ └── man │ │ ├── manhattanVAAST-package.Rd │ │ ├── manhattanVAAST-package.Rd~ │ │ ├── manhattanVAAST.Rd │ │ └── manhattanVAAST.Rd~ ├── manhattanVAAST_1.0.tar.gz └── test.simple ├── mean.R ├── mean_window.c ├── mean_window.o ├── mean_window.so ├── plot_N50.R ├── smoother1.c ├── smoother1.o ├── smoother1.so ├── smoothers.R └── tajimasD.R /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /Addmixture2.plots.R: -------------------------------------------------------------------------------- 1 | plot.admixture<-function(directory){ 2 | 3 | require(reshape2) 4 | require(grid) 5 | require(ggplot2) 6 | require(plyr) 7 | require(RColorBrewer) 8 | 9 | Qmatrix <- dir(directory,pattern="*.Q") 10 | fam<-dir(directory, pattern="*.fam") 11 | temp.name<-read.csv(paste(directory, fam, sep=""), sep=" ", header=FALSE) 12 | 13 | imax<-function(x,n){ 14 | tmp<-as.data.frame(cbind(x, 1:length(x))) 15 | colnames(tmp)<-c("val","index") 16 | stmp<-tmp[order(tmp$val, decreasing=TRUE),] 17 | return(stmp$index[n]) 18 | } 19 | vmax<-function(x,n){ 20 | tmpd<-sort(x, decreasing=TRUE) 21 | return(tmpd[n]) 22 | } 23 | 24 | parse.Q.files<-function(x){ 25 | dat<-read.csv(file=paste(directory,x, sep=""), sep=" ",header=FALSE) 26 | ldat<-length(dat) 27 | 28 | outter <- NULL 29 | 30 | for(i in 1:ldat){ 31 | outter<-c(outter,list(apply(dat, 1, FUN=imax, n=i))) 32 | outter<-c(outter,list(apply(dat, 1, FUN=vmax, n=i))) 33 | } 34 | 35 | dat<-cbind(temp.name$V2,dat) 36 | colnames(dat)<-c( "names", 1:ldat) 37 | 38 | dat<-dat[do.call(order, outter),] 39 | dat$ov<-1:length(dat$names) 40 | 41 | dat2<-melt(dat, id.vars=c("names", "ov")) 42 | 43 | 44 | dat2$Krun<-ldat 45 | colnames(dat2)<-c("Name","ov","Admixture.Group","Value", "Krun") 46 | 47 | 48 | return(dat2) 49 | } 50 | 51 | 52 | 53 | plotgg<-function(datframe){ 54 | 55 | my.max.k<-max(as.numeric(as.character(datframe$Admixture.Group))) 56 | 57 | 58 | datframe<-datframe[order(datframe$ov),] 59 | datframe$Name<-factor(datframe$Name, levels=datframe$Name, ordered=TRUE) 60 | 61 | my.col<-colors()[c(26,547,498,69,33,51,536,100,76,200,300,400,450)] 62 | 63 | the.plot<-ggplot(datframe, aes(x=Name, y=Value, fill=Admixture.Group))+geom_bar(stat="identity") 64 | the.plot<-the.plot+scale_fill_manual(values = my.col[1:my.max.k], name="Admixture group") 65 | the.plot<-the.plot+theme_classic(18) 66 | the.plot<-the.plot+theme(axis.text.x = element_text(angle = 90, hjust = 1)) 67 | the.plot<-the.plot+labs(x="Individual", y="fraction ancestry") 68 | the.plot 69 | 70 | } 71 | 72 | fdat<-ldply(Qmatrix, parse.Q.files, .inform=TRUE) 73 | 74 | my.plots<-dlply(fdat, .(Krun), plotgg) 75 | 76 | return(my.plots) 77 | 78 | } 79 | 80 | 81 | 82 | plot.all.together<-function(file.name, plotCols, list.of.plots){ 83 | 84 | numPlots = length(list.of.plots) 85 | plotRows = ceiling(numPlots/plotCols) 86 | # Fiddle with the to adjust your plot dimentions 87 | pdf(file=paste(file.name, "pdf", sep="."),bg="transparent", width=18*plotCols, height=8*plotRows) 88 | 89 | grid.newpage() 90 | pushViewport(viewport(layout = grid.layout(plotRows, plotCols))) 91 | vplayout <- function(x, y) 92 | viewport(layout.pos.row = x, layout.pos.col = y) 93 | 94 | # Make each plot, in the correct location 95 | for (i in 1:numPlots) { 96 | curRow = ceiling(i/plotCols) 97 | curCol = (i-1) %% plotCols + 1 98 | print(my.plots[[i]], vp = vplayout(curRow, curCol )) 99 | } 100 | 101 | dev.off() 102 | 103 | } 104 | 105 | # example of running the code: 106 | # results<- plot.admixture("/Users/zev/Documents/projects/human_diversity/admixture/") 107 | # example of pulling a subplot (K=5): 108 | # results$`5` 109 | -------------------------------------------------------------------------------- /Addmixture3.plots.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | require(ggplot2) 4 | require(plyr) 5 | require(RColorBrewer) 6 | 7 | fam<-dir(pattern="*.fam") 8 | Qmatrix <- dir(pattern="*.Q") 9 | 10 | temp.name<-read.csv(fam, sep=" ", header=FALSE) 11 | 12 | 13 | parse.Q.files<-function(x){ 14 | dat<-read.csv(file=x, sep=" ",header=FALSE) 15 | ldat<-length(dat) 16 | dat<-cbind(temp.name$V1,temp.name$V2,dat) 17 | colnames(dat)<-c("group_membership", "names", 1:ldat) 18 | dat2<-melt(dat) 19 | dat2$Krun<-rep(ldat, length(dat2$variable)) 20 | colnames(dat2)<-c("Group", "Name","Admixture.Group","Value", "Krun") 21 | col.order<-cluster(dat) 22 | dat2<-cbind(dat2,col.order) 23 | return(dat2) 24 | 25 | } 26 | 27 | my.data<-ldply(Qmatrix, parse.Q.files) 28 | 29 | #ggplot(my.data, aes(x=reorder(Name, Value*as.numeric(Admixture.Group), Group), y=Value, fill=Admixture.Group))+geom_bar(stat="identity")+facet_grid(Krun ~ .) 30 | 31 | cluster<-function(x){ 32 | row.names(x)<-as.character(x[,2]) 33 | x<-x[,-2] 34 | x[,1]<-as.numeric(x[,1]) 35 | heatmap.data<-heatmap(as.matrix(x)) 36 | my.color.order<-heatmap.data$rowInd 37 | print(my.color.order) 38 | return(my.color.order) 39 | } -------------------------------------------------------------------------------- /genomic_window_mean.R: -------------------------------------------------------------------------------- 1 | dyn.load("~/github/ZevRTricks/mean_window.so") 2 | zwindow<-function(xpts, ypts, window){ 3 | nxpts <- length(xpts) 4 | dens <- .C("gslide_mean", as.double(xpts), as.double(ypts), as.double(xpts), as.integer(nxpts), as.double(window), result = double(length(xpts))) 5 | dens[["result"]] 6 | } -------------------------------------------------------------------------------- /manhattan_plot_VAAST_simple/.Rapp.history: -------------------------------------------------------------------------------- 1 | setwd(dir="~/github/ZevRTricks/manhattan_plot_VAAST_simple/") 2 | source(file="manhattanVAAST.R") 3 | manhattanVAAST 4 | ????????pac 5 | ??package.skeleton 6 | package.skeleton(name ="manhattanVAAST", namespace=FALSE) 7 | manhattanVAAST 8 | manhattanVAASTn. 9 | ?data 10 | ?data 11 | library(pegas) 12 | ?Fst 13 | data(list=pegas) 14 | ?data 15 | data(pegas) 16 | ?data 17 | ?sys.sorce 18 | ?sys.source 19 | ??match.call 20 | -------------------------------------------------------------------------------- /manhattan_plot_VAAST_simple/manhattanVAAST.R: -------------------------------------------------------------------------------- 1 | manhattanVAAST<-function(n.features, sig.level, vaast.simple, the.title, sig.line=TRUE, axis.text=TRUE, custom.xlab="index", sig.hjust=0, sig.vjust=0, the.color="NULL"){ 2 | 3 | #gtools for mixed sorting 4 | 5 | require(gtools) 6 | 7 | 8 | # READ IN THE DATA 9 | dat<-read.table(vaast.simple, header=FALSE, skip=1, sep="\t", fill=TRUE) 10 | 11 | # RID ZERO VALUE LINES 12 | dat$V4<-as.numeric(as.character(dat$V4)) 13 | dat<-dat[dat$V4 > 0,] 14 | 15 | # HEAVY FORMATTING DON'T DIG TOO DEEP OR YOUR BRAIN WILL FRY 16 | 17 | # only care about first five columns 18 | dat<-dat[,1:5] 19 | 20 | # only care about lines with data found by chr grep 21 | dat<-dat[grep(dat$V5, pattern="chr"),] 22 | 23 | #parsing apart fifth column 24 | 25 | pos.dat<-strsplit(as.character(dat$V5), split=":|;", perl=TRUE) 26 | 27 | #returning values on index 28 | 29 | dat$seqid<-as.character(sapply(pos.dat, FUN=function(xx){return(xx[[1]][1])})) 30 | dat$pos<-as.numeric(as.character(sapply(pos.dat, FUN=function(xx){return(xx[[2]][1])}))) 31 | 32 | dat<-dat[mixedorder(dat$seqid),] 33 | 34 | 35 | 36 | loff<-tapply(dat$pos, INDEX=dat$seqid, FUN=function(x){nmax<- max(x); c(nmax,rep(0, length(x)-1))}, simplify=TRUE) 37 | loff2 <-cumsum(unlist(loff[mixedorder(names(loff))])) 38 | #loff2<- cumsum(c(0, loff2[1:(length(loff2) -1)])) 39 | dat$relpos <- dat$pos + loff2 40 | dat$index<-1:length(dat$relpos) 41 | 42 | 43 | #recoding x axis data 44 | 45 | axis.name<-unique(dat$seqid) 46 | axis.name.pos.rel<-as.vector(tapply(dat$index, INDEX=dat$seqid, FUN=function(x){middle<-(max(x) + min(x))/2})) 47 | axis.name.pos.real<-sort(as.vector(tapply(dat$relpos, INDEX=dat$seqid, FUN=function(x){middle<-(max(x) + min(x))/2}))) 48 | 49 | #call to the plot 50 | print(is.null(the.color)) 51 | if(is.null(the.color)){the.col<-as.factor(dat$seqid)} 52 | 53 | plot(y=-log10(as.numeric(as.character(dat$V3))), x=dat$relpos, col=the.color, xaxt="n", xlab=custom.xlab, pch=20, ylab="-log10(p-value)", main=the.title) 54 | 55 | if(sig.line == TRUE){ abline(h=-log10(sig.level/n.features), lty=2, lwd=3, col="grey") 56 | text(x=(0.5 * max(dat$relative.pos)) + sig.hjust, y=0.5 + -log10(sig.level/n.features) + sig.vjust, "genome-wide sig. level", cex=1.0)} 57 | 58 | if(axis.text == TRUE){axis(1, at=axis.name.pos.real, labels=axis.name, las=2)} 59 | if(axis.text == FALSE){axis(1, at=axis.name.pos.real, labels=FALSE, las=2)} 60 | return(dat) 61 | 62 | } 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /manhattan_plot_VAAST_simple/manhattanVAAST.Rcheck/00check.log: -------------------------------------------------------------------------------- 1 | * using log directory ‘/Users/zev/github/ZevRTricks/manhattan_plot_VAAST_simple/manhattanVAAST.Rcheck’ 2 | * using R version 2.14.0 alpha (2011-10-13 r57241) 3 | * using platform: x86_64-apple-darwin9.8.0 (64-bit) 4 | * using session charset: UTF-8 5 | * checking for file ‘manhattanVAAST/DESCRIPTION’ ... OK 6 | * checking extension type ... Package 7 | * this is package ‘manhattanVAAST’ version ‘1.0’ 8 | * checking package namespace information ... OK 9 | * checking package dependencies ... OK 10 | * checking if this is a source package ... OK 11 | * checking if there is a namespace ... OK 12 | * checking for executable files ... OK 13 | * checking whether package ‘manhattanVAAST’ can be installed ... OK 14 | * checking installed package size ... OK 15 | * checking package directory ... OK 16 | * checking for portable file names ... OK 17 | * checking for sufficient/correct file permissions ... OK 18 | * checking DESCRIPTION meta-information ... WARNING 19 | Non-standard license specification: 20 | none 21 | Standardizable: FALSE 22 | * checking top-level files ... OK 23 | * checking index information ... OK 24 | * checking package subdirectories ... OK 25 | * checking R files for non-ASCII characters ... OK 26 | * checking R files for syntax errors ... OK 27 | * checking whether the package can be loaded ... OK 28 | * checking whether the package can be loaded with stated dependencies ... OK 29 | * checking whether the package can be unloaded cleanly ... OK 30 | * checking whether the namespace can be loaded with stated dependencies ... OK 31 | * checking whether the namespace can be unloaded cleanly ... OK 32 | * checking for unstated dependencies in R code ... OK 33 | * checking S3 generic/method consistency ... OK 34 | * checking replacement functions ... OK 35 | * checking foreign function calls ... OK 36 | * checking R code for possible problems ... OK 37 | * checking Rd files ... NOTE 38 | prepare_Rd: manhattanVAAST-package.Rd:44-46: Dropping empty section \examples 39 | prepare_Rd: manhattanVAAST.Rd:46-52: Dropping empty section \value 40 | prepare_Rd: manhattanVAAST.Rd:59-61: Dropping empty section \note 41 | prepare_Rd: manhattanVAAST.Rd:53-55: Dropping empty section \references 42 | prepare_Rd: manhattanVAAST.Rd:65-67: Dropping empty section \seealso 43 | * checking Rd metadata ... OK 44 | * checking Rd cross-references ... OK 45 | * checking for missing documentation entries ... OK 46 | * checking for code/documentation mismatches ... WARNING 47 | Codoc mismatches from documentation object 'manhattanVAAST': 48 | manhattanVAAST 49 | Code: function(n.features, sig.level, vaast.simple, title, sig.line = 50 | TRUE, axis.text = TRUE, custom.xlab = "index", 51 | sig.hjust = 0, sig.vjust = 0) 52 | Docs: function(n.features = 23000, sig.level = 0.05, vaast.simple, 53 | title, sig.line = TRUE, axis.text = TRUE, custom.xlab 54 | = "index", sig.hjust = 0, sig.vjust = 0) 55 | Mismatches in argument default values: 56 | Name: 'n.features' Code: Docs: 23000 57 | Name: 'sig.level' Code: Docs: 0.05 58 | 59 | * checking Rd \usage sections ... OK 60 | * checking Rd contents ... OK 61 | * checking for unstated dependencies in examples ... OK 62 | * checking examples ... OK 63 | * checking PDF version of manual ... OK 64 | WARNING: There were 2 warnings, see 65 | ‘/Users/zev/github/ZevRTricks/manhattan_plot_VAAST_simple/manhattanVAAST.Rcheck/00check.log’ 66 | for details 67 | -------------------------------------------------------------------------------- /manhattan_plot_VAAST_simple/manhattanVAAST.Rcheck/00install.out: -------------------------------------------------------------------------------- 1 | * installing *source* package ‘manhattanVAAST’ ... 2 | ** R 3 | ** preparing package for lazy loading 4 | ** help 5 | *** installing help indices 6 | ** building package indices ... 7 | ** testing if installed package can be loaded 8 | 9 | * DONE (manhattanVAAST) 10 | -------------------------------------------------------------------------------- /manhattan_plot_VAAST_simple/manhattanVAAST.Rcheck/Rdlatex.log: -------------------------------------------------------------------------------- 1 | Hmm ... looks like a package 2 | 3 | This is pdfTeX, Version 3.1415926-1.40.11 (TeX Live 2010) 4 | restricted \write18 enabled. 5 | entering extended mode 6 | 7 | (/private/var/folders/A+/A+dnn3HhFK895KLHSyHdh++++TM/-Tmp-/RtmpQ51gw5/Rd2pdf5d3 8 | 3553/Rd2.tex 9 | LaTeX2e <2009/09/24> 10 | Babel and hyphenation patterns for english, dumylang, nohyphenation, ge 11 | rman-x-2009-06-19, ngerman-x-2009-06-19, ancientgreek, ibycus, arabic, armenian 12 | , basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danish, dutch, u 13 | kenglish, usenglishmax, esperanto, estonian, farsi, finnish, french, galician, 14 | german, ngerman, swissgerman, monogreek, greek, hungarian, icelandic, assamese, 15 | bengali, gujarati, hindi, kannada, malayalam, marathi, oriya, panjabi, tamil, 16 | telugu, indonesian, interlingua, irish, italian, kurmanji, lao, latin, latvian, 17 | lithuanian, mongolian, mongolianlmc, bokmal, nynorsk, polish, portuguese, roma 18 | nian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, turkish, 19 | turkmen, ukrainian, uppersorbian, welsh, loaded. 20 | 21 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/book.cls 22 | Document Class: book 2007/10/19 v1.4h Standard LaTeX document class 23 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/bk10.clo)) 24 | (/Library/Frameworks/R.framework/Resources/share/texmf/tex/latex/Rd.sty 25 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/ifthen.sty) 26 | (/usr/local/texlive/2010/texmf-dist/tex/latex/tools/longtable.sty) 27 | (/usr/local/texlive/2010/texmf-dist/tex/latex/tools/bm.sty) 28 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/alltt.sty) 29 | (/usr/local/texlive/2010/texmf-dist/tex/latex/tools/verbatim.sty) 30 | (/usr/local/texlive/2010/texmf-dist/tex/latex/url/url.sty) NOT loading ae 31 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/fontenc.sty 32 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/t1enc.def)) 33 | (/usr/local/texlive/2010/texmf-dist/tex/latex/psnfss/times.sty) 34 | NOT loading lmodern 35 | (/usr/local/texlive/2010/texmf-dist/tex/latex/inconsolata/inconsolata.sty 36 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/textcomp.sty 37 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/ts1enc.def)) 38 | (/usr/local/texlive/2010/texmf-dist/tex/latex/graphics/keyval.sty)) 39 | (/usr/local/texlive/2010/texmf-dist/tex/latex/graphics/color.sty 40 | (/usr/local/texlive/2010/texmf-dist/tex/latex/latexconfig/color.cfg) 41 | (/usr/local/texlive/2010/texmf-dist/tex/latex/pdftex-def/pdftex.def)) 42 | (/usr/local/texlive/2010/texmf-dist/tex/latex/hyperref/hyperref.sty 43 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/ltxcmds.sty) 44 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty 45 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/infwarerr.sty) 46 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/etexcmds.sty)) 47 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/pdfescape.sty 48 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty 49 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/ifluatex.sty))) 50 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/ifpdf.sty) 51 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/ifvtex.sty) 52 | (/usr/local/texlive/2010/texmf-dist/tex/generic/ifxetex/ifxetex.sty) 53 | (/usr/local/texlive/2010/texmf-dist/tex/latex/oberdiek/hycolor.sty 54 | (/usr/local/texlive/2010/texmf-dist/tex/latex/oberdiek/xcolor-patch.sty)) 55 | (/usr/local/texlive/2010/texmf-dist/tex/latex/oberdiek/letltxmacro.sty) 56 | (/usr/local/texlive/2010/texmf-dist/tex/latex/hyperref/pd1enc.def) 57 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/intcalc.sty) 58 | (/usr/local/texlive/2010/texmf-dist/tex/latex/latexconfig/hyperref.cfg) 59 | (/usr/local/texlive/2010/texmf-dist/tex/latex/oberdiek/kvoptions.sty) 60 | Implicit mode ON; LaTeX internals redefined 61 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/bitset.sty 62 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/bigintcalc.sty)) 63 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/atbegshi.sty)) 64 | * hyperref using default driver hpdftex * 65 | (/usr/local/texlive/2010/texmf-dist/tex/latex/hyperref/hpdftex.def 66 | (/usr/local/texlive/2010/texmf-dist/tex/latex/oberdiek/atveryend.sty) 67 | (/usr/local/texlive/2010/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty 68 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/uniquecounter.sty))) 69 | 70 | Package hyperref Warning: Option `hyperindex' has already been used, 71 | (hyperref) setting the option has no effect on input line 342. 72 | 73 | 74 | Package hyperref Warning: Option `pagebackref' has already been used, 75 | (hyperref) setting the option has no effect on input line 342. 76 | 77 | ) (/usr/local/texlive/2010/texmf-dist/tex/latex/base/makeidx.sty) 78 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/inputenc.sty 79 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/utf8.def 80 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/t1enc.dfu) 81 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/ot1enc.dfu) 82 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/omsenc.dfu) 83 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/ts1enc.dfu)) 84 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/latin1.def)) 85 | Writing index file Rd2.idx 86 | No file Rd2.aux. 87 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/ts1cmr.fd) 88 | (/usr/local/texlive/2010/texmf-dist/tex/latex/psnfss/t1ptm.fd) 89 | (/usr/local/texlive/2010/texmf-dist/tex/context/base/supp-pdf.mkii 90 | [Loading MPS to PDF converter (version 2006.09.02).] 91 | ) (/usr/local/texlive/2010/texmf-dist/tex/latex/hyperref/nameref.sty 92 | (/usr/local/texlive/2010/texmf-dist/tex/latex/oberdiek/refcount.sty) 93 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/gettitlestring.sty)) 94 | (/usr/local/texlive/2010/texmf-dist/tex/latex/inconsolata/t1fi4.fd) 95 | (/usr/local/texlive/2010/texmf-dist/tex/latex/psnfss/t1phv.fd) 96 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/utf8.def) 97 | Underfull \vbox (badness 10000) has occurred while \output is active [1{/usr/lo 98 | cal/texlive/2010/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] 99 | Overfull \hbox (21.83638pt too wide) in paragraph at lines 49--51 100 | []\T1/ptm/m/n/10 Maintainer: Lab page: 102 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/utf8.def) 103 | Overfull \hbox (389.78088pt too wide) in paragraph at lines 79--79 104 | []\T1/fi4/m/n/10 manhattanVAAST(n.features=23000, sig.level=0.05, vaast.simple 105 | , title, sig.line = TRUE, axis.text = TRUE, custom.xlab = "index", sig.hjust = 106 | 0, sig.vjust = 0)[] 107 | [2] 108 | Underfull \vbox (badness 10000) has occurred while \output is active [3] 109 | No file Rd2.ind. 110 | [4] (./Rd2.aux) 111 | 112 | Package rerunfilecheck Warning: File `Rd2.out' has changed. 113 | (rerunfilecheck) Rerun to get outlines right 114 | (rerunfilecheck) or use package `bookmark'. 115 | 116 | ) 117 | (see the transcript file for additional information){/usr/local/texlive/2010/te 118 | xmf-dist/fonts/enc/dvips/base/8r.enc}{/usr/local/texlive/2010/texmf-dist/fonts/ 119 | enc/dvips/inconsolata/fi4-ec.enc} 124 | 125 | Output written on Rd2.pdf (4 pages, 79443 bytes). 126 | Transcript written on Rd2.log. 127 | This is makeindex, version 2.15 [TeX Live 2010] (kpathsea + Thai support). 128 | Scanning input file ./Rd2.idx....done (6 entries accepted, 0 rejected). 129 | Sorting entries....done (17 comparisons). 130 | Generating output file ./Rd2.ind....done (17 lines written, 0 warnings). 131 | Output written in ./Rd2.ind. 132 | Transcript written in ./Rd2.ilg. 133 | This is pdfTeX, Version 3.1415926-1.40.11 (TeX Live 2010) 134 | restricted \write18 enabled. 135 | entering extended mode 136 | 137 | (/private/var/folders/A+/A+dnn3HhFK895KLHSyHdh++++TM/-Tmp-/RtmpQ51gw5/Rd2pdf5d3 138 | 3553/Rd2.tex 139 | LaTeX2e <2009/09/24> 140 | Babel and hyphenation patterns for english, dumylang, nohyphenation, ge 141 | rman-x-2009-06-19, ngerman-x-2009-06-19, ancientgreek, ibycus, arabic, armenian 142 | , basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danish, dutch, u 143 | kenglish, usenglishmax, esperanto, estonian, farsi, finnish, french, galician, 144 | german, ngerman, swissgerman, monogreek, greek, hungarian, icelandic, assamese, 145 | bengali, gujarati, hindi, kannada, malayalam, marathi, oriya, panjabi, tamil, 146 | telugu, indonesian, interlingua, irish, italian, kurmanji, lao, latin, latvian, 147 | lithuanian, mongolian, mongolianlmc, bokmal, nynorsk, polish, portuguese, roma 148 | nian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, turkish, 149 | turkmen, ukrainian, uppersorbian, welsh, loaded. 150 | 151 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/book.cls 152 | Document Class: book 2007/10/19 v1.4h Standard LaTeX document class 153 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/bk10.clo)) 154 | (/Library/Frameworks/R.framework/Resources/share/texmf/tex/latex/Rd.sty 155 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/ifthen.sty) 156 | (/usr/local/texlive/2010/texmf-dist/tex/latex/tools/longtable.sty) 157 | (/usr/local/texlive/2010/texmf-dist/tex/latex/tools/bm.sty) 158 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/alltt.sty) 159 | (/usr/local/texlive/2010/texmf-dist/tex/latex/tools/verbatim.sty) 160 | (/usr/local/texlive/2010/texmf-dist/tex/latex/url/url.sty) NOT loading ae 161 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/fontenc.sty 162 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/t1enc.def)) 163 | (/usr/local/texlive/2010/texmf-dist/tex/latex/psnfss/times.sty) 164 | NOT loading lmodern 165 | (/usr/local/texlive/2010/texmf-dist/tex/latex/inconsolata/inconsolata.sty 166 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/textcomp.sty 167 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/ts1enc.def)) 168 | (/usr/local/texlive/2010/texmf-dist/tex/latex/graphics/keyval.sty)) 169 | (/usr/local/texlive/2010/texmf-dist/tex/latex/graphics/color.sty 170 | (/usr/local/texlive/2010/texmf-dist/tex/latex/latexconfig/color.cfg) 171 | (/usr/local/texlive/2010/texmf-dist/tex/latex/pdftex-def/pdftex.def)) 172 | (/usr/local/texlive/2010/texmf-dist/tex/latex/hyperref/hyperref.sty 173 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/ltxcmds.sty) 174 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty 175 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/infwarerr.sty) 176 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/etexcmds.sty)) 177 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/pdfescape.sty 178 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty 179 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/ifluatex.sty))) 180 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/ifpdf.sty) 181 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/ifvtex.sty) 182 | (/usr/local/texlive/2010/texmf-dist/tex/generic/ifxetex/ifxetex.sty) 183 | (/usr/local/texlive/2010/texmf-dist/tex/latex/oberdiek/hycolor.sty 184 | (/usr/local/texlive/2010/texmf-dist/tex/latex/oberdiek/xcolor-patch.sty)) 185 | (/usr/local/texlive/2010/texmf-dist/tex/latex/oberdiek/letltxmacro.sty) 186 | (/usr/local/texlive/2010/texmf-dist/tex/latex/hyperref/pd1enc.def) 187 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/intcalc.sty) 188 | (/usr/local/texlive/2010/texmf-dist/tex/latex/latexconfig/hyperref.cfg) 189 | (/usr/local/texlive/2010/texmf-dist/tex/latex/oberdiek/kvoptions.sty) 190 | Implicit mode ON; LaTeX internals redefined 191 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/bitset.sty 192 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/bigintcalc.sty)) 193 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/atbegshi.sty)) 194 | * hyperref using default driver hpdftex * 195 | (/usr/local/texlive/2010/texmf-dist/tex/latex/hyperref/hpdftex.def 196 | (/usr/local/texlive/2010/texmf-dist/tex/latex/oberdiek/atveryend.sty) 197 | (/usr/local/texlive/2010/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty 198 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/uniquecounter.sty))) 199 | 200 | Package hyperref Warning: Option `hyperindex' has already been used, 201 | (hyperref) setting the option has no effect on input line 342. 202 | 203 | 204 | Package hyperref Warning: Option `pagebackref' has already been used, 205 | (hyperref) setting the option has no effect on input line 342. 206 | 207 | ) (/usr/local/texlive/2010/texmf-dist/tex/latex/base/makeidx.sty) 208 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/inputenc.sty 209 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/utf8.def 210 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/t1enc.dfu) 211 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/ot1enc.dfu) 212 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/omsenc.dfu) 213 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/ts1enc.dfu)) 214 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/latin1.def)) 215 | Writing index file Rd2.idx 216 | (./Rd2.aux) (/usr/local/texlive/2010/texmf-dist/tex/latex/base/ts1cmr.fd) 217 | (/usr/local/texlive/2010/texmf-dist/tex/latex/psnfss/t1ptm.fd) 218 | (/usr/local/texlive/2010/texmf-dist/tex/context/base/supp-pdf.mkii 219 | [Loading MPS to PDF converter (version 2006.09.02).] 220 | ) (/usr/local/texlive/2010/texmf-dist/tex/latex/hyperref/nameref.sty 221 | (/usr/local/texlive/2010/texmf-dist/tex/latex/oberdiek/refcount.sty) 222 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/gettitlestring.sty)) 223 | (./Rd2.out) (./Rd2.out) 224 | (/usr/local/texlive/2010/texmf-dist/tex/latex/inconsolata/t1fi4.fd) 225 | (/usr/local/texlive/2010/texmf-dist/tex/latex/psnfss/t1phv.fd) (./Rd2.toc) 226 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/utf8.def) [1{/usr/local/texl 227 | ive/2010/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] 228 | Overfull \hbox (21.83638pt too wide) in paragraph at lines 49--51 229 | []\T1/ptm/m/n/10 Maintainer: Lab page: 231 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/utf8.def) 232 | Overfull \hbox (389.78088pt too wide) in paragraph at lines 79--79 233 | []\T1/fi4/m/n/10 manhattanVAAST(n.features=23000, sig.level=0.05, vaast.simple 234 | , title, sig.line = TRUE, axis.text = TRUE, custom.xlab = "index", sig.hjust = 235 | 0, sig.vjust = 0)[] 236 | [2] 237 | Underfull \vbox (badness 10000) has occurred while \output is active [3] 238 | (./Rd2.ind [4] 239 | 240 | LaTeX Font Warning: Font shape `T1/fi4/m/it' undefined 241 | (Font) using `T1/fi4/m/n' instead on input line 14. 242 | 243 | [5]) (./Rd2.aux) 244 | 245 | Package rerunfilecheck Warning: File `Rd2.out' has changed. 246 | (rerunfilecheck) Rerun to get outlines right 247 | (rerunfilecheck) or use package `bookmark'. 248 | 249 | 250 | LaTeX Font Warning: Some font shapes were not available, defaults substituted. 251 | 252 | ) 253 | (see the transcript file for additional information){/usr/local/texlive/2010/te 254 | xmf-dist/fonts/enc/dvips/base/8r.enc}{/usr/local/texlive/2010/texmf-dist/fonts/ 255 | enc/dvips/inconsolata/fi4-ec.enc}< 261 | /usr/local/texlive/2010/texmf-dist/fonts/type1/urw/times/utmri8a.pfb> 262 | Output written on Rd2.pdf (5 pages, 88461 bytes). 263 | Transcript written on Rd2.log. 264 | This is makeindex, version 2.15 [TeX Live 2010] (kpathsea + Thai support). 265 | Scanning input file ./Rd2.idx....done (6 entries accepted, 0 rejected). 266 | Sorting entries....done (17 comparisons). 267 | Generating output file ./Rd2.ind....done (17 lines written, 0 warnings). 268 | Output written in ./Rd2.ind. 269 | Transcript written in ./Rd2.ilg. 270 | This is pdfTeX, Version 3.1415926-1.40.11 (TeX Live 2010) 271 | restricted \write18 enabled. 272 | entering extended mode 273 | 274 | (/private/var/folders/A+/A+dnn3HhFK895KLHSyHdh++++TM/-Tmp-/RtmpQ51gw5/Rd2pdf5d3 275 | 3553/Rd2.tex 276 | LaTeX2e <2009/09/24> 277 | Babel and hyphenation patterns for english, dumylang, nohyphenation, ge 278 | rman-x-2009-06-19, ngerman-x-2009-06-19, ancientgreek, ibycus, arabic, armenian 279 | , basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danish, dutch, u 280 | kenglish, usenglishmax, esperanto, estonian, farsi, finnish, french, galician, 281 | german, ngerman, swissgerman, monogreek, greek, hungarian, icelandic, assamese, 282 | bengali, gujarati, hindi, kannada, malayalam, marathi, oriya, panjabi, tamil, 283 | telugu, indonesian, interlingua, irish, italian, kurmanji, lao, latin, latvian, 284 | lithuanian, mongolian, mongolianlmc, bokmal, nynorsk, polish, portuguese, roma 285 | nian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, turkish, 286 | turkmen, ukrainian, uppersorbian, welsh, loaded. 287 | 288 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/book.cls 289 | Document Class: book 2007/10/19 v1.4h Standard LaTeX document class 290 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/bk10.clo)) 291 | (/Library/Frameworks/R.framework/Resources/share/texmf/tex/latex/Rd.sty 292 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/ifthen.sty) 293 | (/usr/local/texlive/2010/texmf-dist/tex/latex/tools/longtable.sty) 294 | (/usr/local/texlive/2010/texmf-dist/tex/latex/tools/bm.sty) 295 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/alltt.sty) 296 | (/usr/local/texlive/2010/texmf-dist/tex/latex/tools/verbatim.sty) 297 | (/usr/local/texlive/2010/texmf-dist/tex/latex/url/url.sty) NOT loading ae 298 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/fontenc.sty 299 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/t1enc.def)) 300 | (/usr/local/texlive/2010/texmf-dist/tex/latex/psnfss/times.sty) 301 | NOT loading lmodern 302 | (/usr/local/texlive/2010/texmf-dist/tex/latex/inconsolata/inconsolata.sty 303 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/textcomp.sty 304 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/ts1enc.def)) 305 | (/usr/local/texlive/2010/texmf-dist/tex/latex/graphics/keyval.sty)) 306 | (/usr/local/texlive/2010/texmf-dist/tex/latex/graphics/color.sty 307 | (/usr/local/texlive/2010/texmf-dist/tex/latex/latexconfig/color.cfg) 308 | (/usr/local/texlive/2010/texmf-dist/tex/latex/pdftex-def/pdftex.def)) 309 | (/usr/local/texlive/2010/texmf-dist/tex/latex/hyperref/hyperref.sty 310 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/ltxcmds.sty) 311 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty 312 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/infwarerr.sty) 313 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/etexcmds.sty)) 314 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/pdfescape.sty 315 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty 316 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/ifluatex.sty))) 317 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/ifpdf.sty) 318 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/ifvtex.sty) 319 | (/usr/local/texlive/2010/texmf-dist/tex/generic/ifxetex/ifxetex.sty) 320 | (/usr/local/texlive/2010/texmf-dist/tex/latex/oberdiek/hycolor.sty 321 | (/usr/local/texlive/2010/texmf-dist/tex/latex/oberdiek/xcolor-patch.sty)) 322 | (/usr/local/texlive/2010/texmf-dist/tex/latex/oberdiek/letltxmacro.sty) 323 | (/usr/local/texlive/2010/texmf-dist/tex/latex/hyperref/pd1enc.def) 324 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/intcalc.sty) 325 | (/usr/local/texlive/2010/texmf-dist/tex/latex/latexconfig/hyperref.cfg) 326 | (/usr/local/texlive/2010/texmf-dist/tex/latex/oberdiek/kvoptions.sty) 327 | Implicit mode ON; LaTeX internals redefined 328 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/bitset.sty 329 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/bigintcalc.sty)) 330 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/atbegshi.sty)) 331 | * hyperref using default driver hpdftex * 332 | (/usr/local/texlive/2010/texmf-dist/tex/latex/hyperref/hpdftex.def 333 | (/usr/local/texlive/2010/texmf-dist/tex/latex/oberdiek/atveryend.sty) 334 | (/usr/local/texlive/2010/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty 335 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/uniquecounter.sty))) 336 | 337 | Package hyperref Warning: Option `hyperindex' has already been used, 338 | (hyperref) setting the option has no effect on input line 342. 339 | 340 | 341 | Package hyperref Warning: Option `pagebackref' has already been used, 342 | (hyperref) setting the option has no effect on input line 342. 343 | 344 | ) (/usr/local/texlive/2010/texmf-dist/tex/latex/base/makeidx.sty) 345 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/inputenc.sty 346 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/utf8.def 347 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/t1enc.dfu) 348 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/ot1enc.dfu) 349 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/omsenc.dfu) 350 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/ts1enc.dfu)) 351 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/latin1.def)) 352 | Writing index file Rd2.idx 353 | (./Rd2.aux) (/usr/local/texlive/2010/texmf-dist/tex/latex/base/ts1cmr.fd) 354 | (/usr/local/texlive/2010/texmf-dist/tex/latex/psnfss/t1ptm.fd) 355 | (/usr/local/texlive/2010/texmf-dist/tex/context/base/supp-pdf.mkii 356 | [Loading MPS to PDF converter (version 2006.09.02).] 357 | ) (/usr/local/texlive/2010/texmf-dist/tex/latex/hyperref/nameref.sty 358 | (/usr/local/texlive/2010/texmf-dist/tex/latex/oberdiek/refcount.sty) 359 | (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/gettitlestring.sty)) 360 | (./Rd2.out) (./Rd2.out) 361 | (/usr/local/texlive/2010/texmf-dist/tex/latex/inconsolata/t1fi4.fd) 362 | (/usr/local/texlive/2010/texmf-dist/tex/latex/psnfss/t1phv.fd) (./Rd2.toc) 363 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/utf8.def) 364 | Underfull \vbox (badness 10000) has occurred while \output is active [1{/usr/lo 365 | cal/texlive/2010/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] 366 | Overfull \hbox (21.83638pt too wide) in paragraph at lines 49--51 367 | []\T1/ptm/m/n/10 Maintainer: Lab page: 369 | (/usr/local/texlive/2010/texmf-dist/tex/latex/base/utf8.def) 370 | Overfull \hbox (389.78088pt too wide) in paragraph at lines 79--79 371 | []\T1/fi4/m/n/10 manhattanVAAST(n.features=23000, sig.level=0.05, vaast.simple 372 | , title, sig.line = TRUE, axis.text = TRUE, custom.xlab = "index", sig.hjust = 373 | 0, sig.vjust = 0)[] 374 | [2] [3] (./Rd2.ind [4] 375 | 376 | LaTeX Font Warning: Font shape `T1/fi4/m/it' undefined 377 | (Font) using `T1/fi4/m/n' instead on input line 14. 378 | 379 | [5]) (./Rd2.aux) 380 | 381 | LaTeX Font Warning: Some font shapes were not available, defaults substituted. 382 | 383 | ) 384 | (see the transcript file for additional information){/usr/local/texlive/2010/te 385 | xmf-dist/fonts/enc/dvips/base/8r.enc}{/usr/local/texlive/2010/texmf-dist/fonts/ 386 | enc/dvips/inconsolata/fi4-ec.enc}< 392 | /usr/local/texlive/2010/texmf-dist/fonts/type1/urw/times/utmri8a.pfb> 393 | Output written on Rd2.pdf (5 pages, 88766 bytes). 394 | Transcript written on Rd2.log. 395 | Saving output to 'manhattanVAAST-manual.pdf' ... 396 | Done 397 | You may want to clean up by 'rm -rf /var/folders/A+/A+dnn3HhFK895KLHSyHdh++++TM/-Tmp-//RtmpQ51gw5/Rd2pdf5d33553' 398 | -------------------------------------------------------------------------------- /manhattan_plot_VAAST_simple/manhattanVAAST.Rcheck/manhattanVAAST-Ex.R: -------------------------------------------------------------------------------- 1 | pkgname <- "manhattanVAAST" 2 | source(file.path(R.home("share"), "R", "examples-header.R")) 3 | options(warn = 1) 4 | library('manhattanVAAST') 5 | 6 | assign(".oldSearch", search(), pos = 'CheckExEnv') 7 | cleanEx() 8 | nameEx("manhattanVAAST") 9 | ### * manhattanVAAST 10 | 11 | flush(stderr()); flush(stdout()) 12 | 13 | ### Name: manhattanVAAST 14 | ### Title: a function to plot VAAST simple reports. 15 | ### Aliases: manhattanVAAST 16 | ### Keywords: ~kwd1 ~kwd2 17 | 18 | ### ** Examples 19 | 20 | ##---- Should be DIRECTLY executable !! ---- 21 | ##-- ==> Define data, use random, 22 | ##-- or do help(data=index) for the standard data sets. 23 | 24 | ## The function is currently defined as 25 | function (n.features, sig.level, vaast.simple, title, sig.line = TRUE, 26 | axis.text = TRUE, custom.xlab = "index", sig.hjust = 0, sig.vjust = 0) 27 | { 28 | dat <- read.table(vaast.simple, header = FALSE, skip = 1, 29 | sep = "\t", fill = TRUE) 30 | dat <- dat[dat$V4 > 0, ] 31 | dat <- dat[, 1:6] 32 | dat <- dat[grep(dat$V5, pattern = "chr"), ] 33 | pos.dat <- strsplit(as.character(dat$V5), split = ":|;", 34 | perl = TRUE) 35 | dat$seqid <- sapply(pos.dat, FUN = function(xx) { 36 | return(xx[[1]][1]) 37 | }) 38 | dat$pos <- as.numeric(as.character(sapply(pos.dat, FUN = function(xx) { 39 | return(xx[[2]][1]) 40 | }))) 41 | dat <- dat[order(dat$seqid, dat$pos), ] 42 | dat$index.vec <- cumsum(1:length(dat$pos)) 43 | dat$len.correction1 <- unlist(tapply(dat$pos, INDEX = dat$seqid, 44 | FUN = function(x) { 45 | c(max(x), rep(0, length(x) - 1)) 46 | }, simplify = TRUE)) 47 | dat$len.correction3 <- unlist(tapply(dat$pos, INDEX = dat$seqid, 48 | FUN = function(x) { 49 | rep(max(x), length(x)) 50 | }, simplify = TRUE)) 51 | dat <- dat[order(-dat$len.correction3, dat$seqid, dat$pos), 52 | ] 53 | dat$len.correction2 <- cumsum(dat$len.correction1) 54 | dat$relative.pos <- as.numeric(as.character(dat$len.correction2)) + 55 | as.numeric(as.character(dat$pos)) 56 | axis.name <- unique(dat$seqid) 57 | axis.name.pos.rel <- as.vector(tapply(dat$index, INDEX = dat$seqid, 58 | FUN = function(x) { 59 | middle <- (max(x) + min(x))/2 60 | })) 61 | axis.name.pos.real <- sort(as.vector(tapply(dat$relative.pos, 62 | INDEX = dat$seqid, FUN = function(x) { 63 | middle <- (max(x) + min(x))/2 64 | }))) 65 | plot(y = -log10(as.numeric(as.character(dat$V3))), x = dat$relative.pos, 66 | col = as.factor(dat$seqid), xaxt = "n", xlab = custom.xlab, 67 | pch = 20, ylab = "-log10(p-value)", main = title) 68 | if (sig.line == TRUE) { 69 | abline(h = -log10(sig.level/n.features), lty = 2, lwd = 3, 70 | col = "grey") 71 | text(x = (0.5 * max(dat$relative.pos)) + sig.hjust, y = 0.5 + 72 | -log10(sig.level/n.features) + sig.vjust, "genome-wide sig. level", 73 | cex = 1) 74 | } 75 | if (axis.text == TRUE) { 76 | axis(1, at = axis.name.pos.real, labels = axis.name, 77 | las = 2) 78 | } 79 | if (axis.text == FALSE) { 80 | axis(1, at = axis.name.pos.real, labels = FALSE, las = 2) 81 | } 82 | return(dat) 83 | } 84 | 85 | 86 | 87 | ### *