From noreply at r-forge.r-project.org Mon Jun 3 14:42:06 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 3 Jun 2013 14:42:06 +0200 (CEST) Subject: [Patchwork-commits] r170 - in pkg/TAPS: . R man Message-ID: <20130603124206.9CD7C185294@r-forge.r-project.org> Author: sebastian_d Date: 2013-06-03 14:42:06 +0200 (Mon, 03 Jun 2013) New Revision: 170 Modified: pkg/TAPS/DESCRIPTION pkg/TAPS/R/TAPS.r pkg/TAPS/man/TAPS_call.Rd pkg/TAPS/man/TAPS_plot.Rd Log: latest TAPS version update to hopefully help R-forge make it build correctly Modified: pkg/TAPS/DESCRIPTION =================================================================== --- pkg/TAPS/DESCRIPTION 2013-04-23 14:51:43 UTC (rev 169) +++ pkg/TAPS/DESCRIPTION 2013-06-03 12:42:06 UTC (rev 170) @@ -2,9 +2,10 @@ Type: Package Title: Tumor Abberation Prediction Suite Version: 1.0 -Date: 2013-02-11 -Author: Markus Rasmussen, Hanna Goransson-Kultima -Maintainer: Markus Rasmussen +Date: 2013-05-11 +Author: Markus Mayrhofer, Hanna Goransson-Kultima, Sebastian DiLorenzo +Maintainer: Sebastian DiLorenzo #Markus Mayrhofer Description: Performs a allele-specific copy number analysis of array data. License: GPL-2 -Depends: R (>= 2.10), DNAcopy, stats, fields, affxparser +Depends:R (>= 2.10), DNAcopy, fields, affxparser +#Imports: DNAcopy, fields, affxparser \ No newline at end of file Modified: pkg/TAPS/R/TAPS.r =================================================================== --- pkg/TAPS/R/TAPS.r 2013-04-23 14:51:43 UTC (rev 169) +++ pkg/TAPS/R/TAPS.r 2013-06-03 12:42:06 UTC (rev 170) @@ -1,8 +1,11 @@ - TAPS_plot <- function(directory=NULL,#xlim=c(-1,2),ylim=c(0,1), bin=400) { #Automatically check, and if needed install, packages stats and fields +#Load stats. It should be in all, at least semi-new, R distributions so we dont need to install.package it or +#pre-install it +library(stats) + #list.of.packages <- c("stats", "fields") #new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])] #if(length(new.packages)) install.packages(new.packages) @@ -30,6 +33,7 @@ for (i in 1:length(subs)) try( { setwd(subs[i]) name <- subs[i] + #if (length(grep('SampleData.txt',dir()))==0) save.txt(data.frame(Sample=name,cn2='',delta='',loh='',completed.analysis='no'),file='SampleData.txt') cat(' ..loading', subs[i]) if(length(grep("*.cyhd.cychp",dir()))==1) ##cyhd sample @@ -103,7 +107,10 @@ alf=alf[!is.na(alf$Value),] segments <- readSegments() ## segments if available (CBS recommended) - + + #Remove NA values that some samples give. + segments <- segments[!is.nan(segments$Value),] + cat(' ..processing') if (is.null(segments)) { ## segmentation using DNA-copy if needed (must then be installed) segments <- segment_DNAcopy(Log2) @@ -145,7 +152,8 @@ ### ### -TAPS_call <- function(directory=NULL,xlim=c(-1,1),ylim=c(0,1),minseg=1,maxCn=12) { +TAPS_call <- function(directory=NULL,#xlim=c(-1,1),ylim=c(0,1), + minseg=1,maxCn=12) { ## TAPS_call outputs the total and minor allele copy numbers of all segments as a text file, and as images for visual confirmation. ## sampleInfo_TAPS.txt must be present in each sample folder. If TAPS_plot could not make a good guess of the Log-R of copy number 2 ## and the Log-R difference to a deletion, you must interpret the scatter plots and edit sampleInfo_TAPS.txt. @@ -162,10 +170,17 @@ setwd(directory) #subs <- getSubdirs() - sampleData <- load.txt('SampleData.txt') + if (length(grep('SampleData.txt',dir()))==1) + { + sampleData <- load.txt('SampleData.txt') + } + else + { + sampleData <- load.txt('../SampleData.txt') + } subs=as.character(sampleData$Sample) #save.txt(sampleData,file='sampleData_old.csv') - + if (is.null(subs)) { subs=thisSubdir() setwd('..') @@ -181,6 +196,15 @@ alf <- readAlf(localDir) segments <- readSegments() + #Some samples throw NA values, we simply remove these. + Log2=Log2[!is.nan(Log2$Value),] + Log2=Log2[!is.na(Log2$Value),] + + alf=alf[!is.nan(alf$Value),] + alf=alf[!is.na(alf$Value),] + + segments <- segments[!is.nan(segments$Value),] + segments$Value <- segments$Value-median(Log2$Value) Log2$Value <- Log2$Value-median(Log2$Value) @@ -197,7 +221,7 @@ regions=allRegions$regions save(t,regions,file="regions_t.Rdata") - karyotype_check(regions$Chromosome,regions$Start,regions$End,regions$log2,regions$imba,regions$Cn,regions$mCn,t,ideogram=NULL,name=name,xlim=xlim,ylim=ylim) + karyotype_check(regions$Chromosome,regions$Start,regions$End,regions$log2,regions$imba,regions$Cn,regions$mCn,t,ideogram=NULL,name=name) karyotype_chromsCN(regions$Chromosome,regions$Start,regions$End,regions$log2, regions$imba,regions$Cn,regions$mCn,ideogram=NULL, @@ -271,7 +295,7 @@ segment_DNAcopy <- function(Log2) { ## If segmentation is required, DNAcopy is a good choice. Must be installed. #library(DNAcopy) - cat('Using DNAcopy to create segments:\n') + cat('..Using DNAcopy to create segments:\n') segs=NULL chroms=c(as.character(1:22),'X','Y') chroms=paste('chr',chroms,sep='') @@ -1082,7 +1106,7 @@ # } # } -karyotype_check <- function(chr,start,end,int,ai,Cn,mCn,t,ideogram=NULL,name='',xlim=c(-1.02,1.02),ylim=0:1) { +karyotype_check <- function(chr,start,end,int,ai,Cn,mCn,t,ideogram=NULL,name='') { #xlim=c(-1.02,1.02),ylim=0:1) { ## TAPS scatter plot of a full sample, used for visual quality control. png(paste(name,'.karyotype_check.png',sep=''),width=1300,height=1300) @@ -1127,12 +1151,12 @@ cex=c(size), cex.lab=2, mar=c(0.1,0.1,0.1,0.1), - main = "", - xlab = name, - ylab = "", - col = col, - xlim = xlim, - ylim = ylim) + main = "", + xlab = name, + ylab = "", + col = col, + xlim=c(-1,2),ylim=c(0,1)) + text(variants_data[,1],variants_data[,2], labels=variants, col='black', @@ -1493,65 +1517,17 @@ # Added TAPS plot functionality #------------------------------------------------------------ +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# -#Some "what is sent" information that I used to determine which objects and columns were needed to call OverviewPlow -#karyotype_check(regions$Chromosome,regions$Start,regions$End,regions$log2, -# regions$imba,regions$Cn,regions$mCn,t,ideogram=NULL,name=name, -# xlim=xlim,ylim=ylim) - - - - -#karyotype <- function(chr,start,end,int,ai,ideogram=NULL,name='',xlim=c(-1.02,1.02),ylim=0:1) - -#karyotype(regs$chr,regs$start,regs$end,regs$logs,regs$scores,ideogram=NULL,name=name,xlim=xlim,ylim=ylim) - -#karyotype What is sent What it is in the function -# regs$chr, chr -# regs$start, start -# regs$end, end -# regs$logs, int -# regs$scores, ai -# ideogram=NULL, NULL -# name=name, name -# xlim=c(-1,2), xlim -# ylim=c(0,1) ylim - -#karyotype_chroms <- function(chr,start,end,int,ai,ideogram=NULL, -# mchr,mpos,mval,schr,spos,sval, -# name='',xlim=c(-1.02,1.82),ylim=0:1) - - -#karyotype_chroms(regs$chr,regs$start,regs$end,regs$logs,regs$scores,ideogram=NULL, -# as.character(Log2$Chromosome),Log2$Start,Log2$Value,as.character(alf$Chromosome),alf$Start,alf$Value, -# name=name,xlim=xlim,ylim=ylim) - - -#karyotype_chroms What is sent What it is in function -# regs$chr, chr -# regs$start, start -# regs$end, end -# regs$logs, int -# regs$scores, ai -# ideogram=NULL, NULL -# as.character(Log2$Chromosome), mchr -# Log2$Start, mpos -# Log2$Value, mval -# as.character(alf$Chromosome), schr -# alf$Start, spos -# alf$Value, sval -# name=name, name -# xlim=c(-1,2), xlim -# ylim=c(0,1) ylim - - - -#Example call to OverviewPlot: -#OverviewPlot(regs$chr,regs$start,regs$end,regs$logs,regs$scores,ideogram=NULL, -# as.character(Log2$Chromosome),Log2$Start,Log2$Value,as.character(alf$Chromosome),alf$Start,alf$Value, -# name='wip',xlim=c(-1,2),ylim=c(0,1)) - OverviewPlot <- function(chr,start,end,int,ai,ideogram=NULL,mchr,mpos,mval,schr,spos,sval,name='',xlim=c(-1,2),ylim=c(0,1)) { ideogram=getIdeogram() @@ -1583,23 +1559,6 @@ #This details the margins (left,right,bottom,top) of all the screens. #See split.screen section of http://seananderson.ca/courses/11-multipanel/multipanel.pdf #for the most complete explanation. - # split.screen(as.matrix(data.frame(left=c(0.03,(0.97/8)+0.03,2*(0.97/8)+0.03,3*(0.97/8)+0.03,4*(0.97/8)+0.03,5*(0.97/8)+0.03,6*(0.97/8)+0.03,7*(0.97/8)+0.03, - # 0.03,(0.97/8)+0.03,2*(0.97/8)+0.03,3*(0.97/8)+0.03,4*(0.97/8)+0.03,5*(0.97/8)+0.03,6*(0.97/8)+0.03,7*(0.97/8)+0.03, - # 0.03,(0.97/8)+0.03,2*(0.97/8)+0.03,3*(0.97/8)+0.03,4*(0.97/8)+0.03,5*(0.97/8)+0.03,6*(0.97/8)+0.03,7*(0.97/8)+0.03), - # right=c((0.97/8)+0.03,2*(0.97/8)+0.03,3*(0.97/8)+0.03,4*(0.97/8)+0.03,5*(0.97/8)+0.03,6*(0.97/8)+0.03,7*(0.97/8)+0.03,8*(0.97/8)+0.03, - # (0.97/8)+0.03,2*(0.97/8)+0.03,3*(0.97/8)+0.03,4*(0.97/8)+0.03,5*(0.97/8)+0.03,6*(0.97/8)+0.03,7*(0.97/8)+0.03,8*(0.97/8)+0.03, - # (0.97/8)+0.03,2*(0.97/8)+0.03,3*(0.97/8)+0.03,4*(0.97/8)+0.03,5*(0.97/8)+0.03,6*(0.97/8)+0.03,7*(0.97/8)+0.03,8*(0.97/8)+0.03), - # bottom=c((0.8/3)*2+0.1,(0.8/3)*2+0.1,(0.8/3)*2+0.1,(0.8/3)*2+0.1,(0.8/3)*2+0.1,(0.8/3)*2+0.1,(0.8/3)*2+0.1,(0.8/3)*2+0.1, - # (0.8/3)+0.1,(0.8/3)+0.1,(0.8/3)+0.1,(0.8/3)+0.1,(0.8/3)+0.1,(0.8/3)+0.1,(0.8/3)+0.1,(0.8/3)+0.1, - # 0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1), - # top=c(0.9,0.9,0.9,0.9,0.9,0.9,0.9,0.9, - # (0.8/3)*2+0.1,(0.8/3)*2+0.1,(0.8/3)*2+0.1,(0.8/3)*2+0.1,(0.8/3)*2+0.1,(0.8/3)*2+0.1,(0.8/3)*2+0.1,(0.8/3)*2+0.1, - # (0.8/3)+0.1,(0.8/3)+0.1,(0.8/3)+0.1,(0.8/3)+0.1,(0.8/3)+0.1,(0.8/3)+0.1,(0.8/3)+0.1,(0.8/3)+0.1))),1) #screen 1 becomes screen 3 - 26 - # split.screen(as.matrix(data.frame(left=c(0.03,0.03,0.03), - # right=c(1,1,1), - # bottom=c(0.1,0.45,0.55), - # top=c(0.45,0.55,1))),2) #screen 2 become screen 27-29 - split.screen(as.matrix(data.frame(left=c(rep(seq(from=0.05,to=7*(0.9/8)+0.05,by=(0.9/8)),3)), right=c(rep(seq(from=(0.9/8)+0.05,to=8*(0.9/8)+0.05,by=(0.9/8)),3)), bottom=c(rep(2*(0.75/3)+0.15,8),rep((0.75/3)+0.15,8),rep(0.15,8)), @@ -1687,9 +1646,9 @@ } #If we are one of the chromosomes plotted to the left edge or bottom, add axis - if(c %in% c(1,9,17)) axis(side=2,cex.axis=0.6,at=seq(from=0,to=0.8,by=0.2)) + if(c %in% c(1,9,17)) axis(side=2,cex.axis=0.6,tck=-0.05,at=seq(from=0,to=0.8,by=0.2),las=1) if(c %in% c(seq(from=17,to=24,by=1))) axis(side=1,cex.axis=0.6,at=seq(from=-0.5,to=1,by=0.5)) - if(c %in% c(8,16,24)) axis(side=4,cex.axis=0.6,at=seq(from=0,to=0.8,by=0.2)) + if(c %in% c(8,16,24)) axis(side=4,cex.axis=0.6,tck=-0.05,at=seq(from=0,to=0.8,by=0.2),las=1) #Add titles with sample name (name of folder containing sample) and date if(c==4) @@ -1729,8 +1688,21 @@ { this <- ideogram[ideogram$c==c,] ix <- chr==this$chr - mix <- mchr==this$chr & mval>=(-2) + mix <- mchr==this$chr #& mval>=(-2) six <- schr==this$chr + + #Predefine ymin ymax and sequence between them + ymin=floor(min(int))-0.5 + if(ymin > -1) + { + ymin = -1 + } + ymax=ceiling(max(int))+0.5 + if(ymax < 1) + { + ymax = 1 + } + seqminmax=seq(ymin,ymax,by=0.5) if(c>1) { @@ -1753,10 +1725,11 @@ } #Only plot mval higher than -2 - ix=mval>=(-2) - mpos = mpos[ix] - mval = mval[ix] + #ix=mval>=(-2) + #mpos = mpos[ix] + #mval = mval[ix] + #Remove every third value to make plotting more sparse in this overview. (saves space and time) ix = seq(3,to=length(mpos),by=3) mpos = mpos[-ix] mval = mval [-ix] @@ -1771,13 +1744,13 @@ col = '#00000003', xaxt="n", axes=F, - ylim = c(-2,1.5), + ylim = c(ymin,ymax), xlim = c(0,max(mpos)) ) #Add axis to the left & right of signal - axis(side=2,at=seq(from=-2,to=1.5,by=0.5),cex.axis=0.6,pos=0) - axis(side=4,at=seq(from=-2,to=1.5,by=0.5),cex.axis=0.6,pos=max(mpos)) + axis(side=2,tck=-0.025,at=seqminmax,cex.axis=0.6,pos=0,las=1) + axis(side=4,tck=-0.025,at=seqminmax,cex.axis=0.6,pos=max(mpos),las=1) mtext("logRatio",side=2,line=-0.8) #Add colored segment information for each chromosome, red to blue gradient. @@ -1791,6 +1764,8 @@ col=rep('#000000',sum(ix)) col[pos[ix] < this$mid] <- colors_p(sum(pos[ix] < this$mid)) col[pos[ix] > this$mid] <- colors_q(sum(pos[ix] > this$mid)) + + #Add segments segments(x0=start[ix],x1=end[ix], y0=int[ix],y1=int[ix], col=col, @@ -1865,9 +1840,9 @@ ) #Add axis to the left,right and below of AI. The below axis is the chromosome numbers 1-24. - axis(side=2,at=seq(from=0,to=1,by=0.2),cex.axis=0.6,pos=0) + axis(side=2,tck=-0.04,at=seq(from=0,to=1,by=0.2),cex.axis=0.6,pos=0,las=1) axis(side=1,at=pre,labels=c(seq(from="1",to="22"),"X","Y"),cex.axis=0.55) - axis(side=4,at=seq(from=0,to=1,by=0.2),cex.axis=0.6,pos=max(mpos)) + axis(side=4,tck=-0.04,at=seq(from=0,to=1,by=0.2),cex.axis=0.6,pos=max(mpos),las=1) mtext("Allele frequency",side=2,line=-0.8) mtext("Chromosome numbers",side=1,line=1.5,adj=0.4) @@ -1887,6 +1862,16 @@ } +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# + #Function for generating individual plots for TAPS_call. Gives whole genome, logRatio, cytoband and allele frequency. karyotype_chroms <- function(chr,start,end,int,ai,ideogram=NULL,mchr,mpos,mval,schr,spos,sval,name='',xlim=c(-1.02,1.82),ylim=0:1) { @@ -2013,7 +1998,7 @@ } #Insert Y and X axis - axis(side=2,cex.axis=0.6,tck=0.963,col.ticks='#808080',at=seq(from=0,to=1,by=0.2)) + axis(side=2,cex.axis=0.6,tck=0.963,col.ticks='#808080',at=seq(from=0,to=1,by=0.2),las=1) axis(side=1,cex.axis=0.6,tck=0.963,col.ticks='#808080',at=seq(from=-1,to=1.5,by=0.1)) #Titles,date/time and axis labels @@ -2035,8 +2020,21 @@ par(mgp =c(0.5,0.25,0)) #Select the correct chromosome and remove stuff lower than -1 - mix <- mchr==this$chr & mval>(-1) + mix <- mchr==this$chr #& mval>(-1) + #Predefine ymin ymax and sequence between them + ymin=floor(min(int[ix]))-0.5 + if(ymin > -1) + { + ymin = -1 + } + ymax=ceiling(max(int[ix]))+0.5 + if(ymax < 1) + { + ymax = 1 + } + seqminmax=seq(ymin,ymax,by=0.5) + #Create an index of colors relating to the positions and lengths on this chromosome col=rep('#000000',sum(ix)) col[pos[ix] < this$mid] <- colors_p(sum(pos[ix] < this$mid)) @@ -2052,7 +2050,7 @@ axes=F, col = '#00000005', xlim = c(0,this$length), - ylim = c(-1,1.5)) + ylim = c(ymin,ymax)) #Add colored segments based on the logRatio data segments(x0=start[ix],x1=end[ix], @@ -2061,12 +2059,14 @@ lwd=4) #Add X and Y axis. The (side=4) axis is just a black line showing where the data ends - axis(side=2,tck=0.926,col.ticks='#808080',at=seq(from=-1,to=1.5,by=0.5), - labels=c("-1","-.5","0",".5","1","1.5"),cex.axis=0.6,pos=0) - axis(side=4,tck=0,pos=this$length,at=seq(from=-1,to=1.5,by=0.5), - labels=c("-1","-.5","0",".5","1","1.5"),cex.axis=0.6) + axis(side=2,tck=0.926,col.ticks='#808080',at=seqminmax, #seq(from=-1,to=1.5,by=0.5), + #labels=c("-1","-.5","0",".5","1","1.5"), + cex.axis=0.6,pos=0,las=1) + axis(side=4,tck=0,pos=this$length,at=seqminmax, + #labels=c("-1","-.5","0",".5","1","1.5"), + cex.axis=0.6,las=1) axis(side=1,tck=0.926,col.ticks='#808080',at=seq(5e6,this$length,by=5e6), - labels=FALSE,cex.axis=0.6,pos=-1) + labels=FALSE,cex.axis=0.6,pos=ymin) #Add Y axis label mtext("logRatio",side=2,line=-0.8) @@ -2141,8 +2141,8 @@ ylim = c(0,1)) #Add X and Y axis as well as a line to the rightmost of the data (side=4) - axis(side=2,tck=0.926,col.ticks='#808080',at=seq(from=0,to=1,by=0.2),cex.axis=0.6,pos=0) - axis(side=4,tck=0,at=seq(from=0,to=1,by=0.2),cex.axis=0.6,pos=this$length) + axis(side=2,tck=0.926,col.ticks='#808080',at=seq(from=0,to=1,by=0.2),cex.axis=0.6,pos=0,las=1) + axis(side=4,tck=0,at=seq(from=0,to=1,by=0.2),cex.axis=0.6,pos=this$length,las=1) axis(side=1,tck=0.925,col.ticks='#808080',at=seq(5e6,this$length,by=5e6), labels=paste(seq(5,round(this$length/1e6),5),'',sep=''),cex.axis=0.6,pos=0) @@ -2156,7 +2156,17 @@ } } +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# + karyotype_chromsCN <- function(chr,start,end,int,ai,Cn,mCn,ideogram=NULL,mchr,mpos,mval,schr,spos,sval,t,name='',xlim=c(-1.02,1.82),ylim=0:1, maxCn=8) { @@ -2296,7 +2306,7 @@ } #Insert Y and X axis - axis(side=2,cex.axis=0.6,tck=0.963,col.ticks='#808080',at=seq(from=0,to=1,by=0.2)) + axis(side=2,cex.axis=0.6,tck=0.963,col.ticks='#808080',at=seq(from=0,to=1,by=0.2),las=1) axis(side=1,cex.axis=0.6,tck=0.963,col.ticks='#808080',at=seq(from=-1,to=1.5,by=0.1)) #Add cn and mcn labels @@ -2357,7 +2367,7 @@ lwd=5) #Add Y axis - axis(side=2,tck=0.926,col.ticks='#808080',at=seq(0,8,by=1),cex.axis=0.6,pos=0) + axis(side=2,tck=0.926,col.ticks='#808080',at=seq(0,8,by=1),cex.axis=0.6,pos=0,las=1) axis(side=4,labels=F,tck=0,pos=this$length) #Add Y label and date/time title @@ -2376,8 +2386,21 @@ par(mgp =c(0.5,0.25,0)) #Select the correct chromosome and remove stuff lower than -1 - mix <- mchr==this$chr & mval>(-1) + mix <- mchr==this$chr #& mval>(-1) + #Predefine ymin ymax and sequence between them + ymin=floor(min(int[ix]))-0.5 + if(ymin > -1) + { + ymin = -1 + } + ymax=ceiling(max(int[ix]))+0.5 + if(ymax < 1) + { + ymax = 1 + } + seqminmax=seq(ymin,ymax,by=0.5) + #Create an index of colors relating to the positions and lengths on this chromosome col=rep('#000000',sum(ix)) col[pos[ix] < this$mid] <- colors_p(sum(pos[ix] < this$mid)) @@ -2393,7 +2416,7 @@ axes=F, col = '#00000005', xlim = c(0,this$length), - ylim = c(-1,1.5)) + ylim = c(ymin,ymax)) #Add colored segments based on the logRatio data segments(x0=start[ix],x1=end[ix], @@ -2402,11 +2425,12 @@ lwd=4) #Add X and Y axis. The (side=4) axis is just a black line showing where the data ends - axis(side=2,tck=0.926,col.ticks='#808080',at=seq(from=-1,to=1.5,by=0.5), - labels=c("-1","-.5","0",".5","1","1.5"),cex.axis=0.6,pos=0) + axis(side=2,tck=0.926,col.ticks='#808080',at=seqminmax, #seq(from=-1,to=1.5,by=0.5), + #labels=c("-1","-.5","0",".5","1","1.5"), + cex.axis=0.6,pos=0,las=1) axis(side=4,labels=F,tck=0,pos=this$length) axis(side=1,tck=0.926,col.ticks='#808080',at=seq(5e6,this$length,by=5e6), - labels=FALSE,cex.axis=0.6,pos=-1) + labels=FALSE,cex.axis=0.6,pos=ymin) #Add Y axis label mtext("logRatio",side=2,line=0.3) @@ -2482,7 +2506,7 @@ ylim = c(0,1)) #Add X and Y axis as well as a line to the rightmost of the data (side=4) - axis(side=2,tck=0.926,col.ticks='#808080',at=seq(from=0,to=1,by=0.2),cex.axis=0.6,pos=0) + axis(side=2,tck=0.926,col.ticks='#808080',at=seq(from=0,to=1,by=0.2),cex.axis=0.6,pos=0,las=1) axis(side=4,labels=F,tck=0,pos=this$length) axis(side=1,tck=0.925,col.ticks='#808080',at=seq(5e6,this$length,by=5e6), labels=paste(seq(5,round(this$length/1e6),5),'',sep=''),cex.axis=0.6,pos=0) @@ -2497,13 +2521,16 @@ } } +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------------------------------------# - - - - - - #------------------------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------------------------ #TAPS_region() ; a function for zooming in on a specific region and showing the regions genes. @@ -2511,8 +2538,6 @@ #------------------------------------------------------------------------------------------------------ - -#Plot function that returns specifics on a region TAPS_region <- function(directory=NULL,chr,region,hg18=F) { if (is.null(directory)) @@ -2526,510 +2551,575 @@ #Set working directory and make that directorys name the samplename. If it is too long, shorten it. setwd(directory) - name = thisSubdir() - if(nchar(name)>12) - { - name = substring(name,1,12) + subs <- getSubdirs() + if (is.null(subs)) + { ## check samples = subdirectories or a single sample = current directory + subs=thisSubdir() + setwd('..') } - #From TAPS_plot(): - #save(regs,Log2,alf,segments,file="TAPS_plot_output.Rdata") + #store chr value in nchr because i made the newbie mistake of having a second variable also + #named chr. + nchr = chr - #Check if TAPS_plot_output.Rdata exists. It must for the plot function to run. - #In this file are the objects needed to plot. - if(file.exists("TAPS_plot_output.Rdata")==F) + #Loop over all subdirectories, should they exist. + for (i in 1:length(subs)) try( { - cat("TAPS_region could not find a TAPS_plot_output.Rdata file in the sample directory. \n - You must run TAPS_plot before TAPS_region. \n") - } - else - { - load("TAPS_plot_output.Rdata") - } + setwd(subs[i]) + name <- subs[i] + cat(' ..plotting', subs[i],"\n") - #If chr has been given as character - if(is.character(chr) == T) - { - #If chr is longer than 2 characters ("chr1" but not "12") - #take out the number and convert it to numeric - if(nchar(chr)>2) + if(nchar(name)>12) { - c = strsplit(chr,"chr") - c = as.numeric(c[[1]][2]) + name = substring(name,1,12) } - #chr has been given as character but without "chr" infront. Convert to numeric. + + #From TAPS_plot(): + #save(regs,Log2,alf,segments,file="TAPS_plot_output.Rdata") + + #Check if TAPS_plot_output.Rdata exists. It must for the plot function to run. + #In this file are the objects needed to plot. + if(file.exists("TAPS_plot_output.Rdata")==F) + { + cat("TAPS_region could not find a TAPS_plot_output.Rdata file in the sample directory. \n + You must run TAPS_plot before TAPS_region. \n") + } else { - c = as.numeric(chr) + load("TAPS_plot_output.Rdata") } - } - #else chr has been given as a numeric and can be used directly. + + #If nchr has been given as character + if(is.character(nchr) == T) + { + #If chr is longer than 2 characters ("chr1" but not "12") + #take out the number and convert it to numeric + if(nchar(nchr)>2) + { + c = strsplit(nchr,"chr") + c = as.numeric(c[[1]][2]) + } + #chr has been given as character but without "chr" infront. Convert to numeric. + else + { + c = as.numeric(nchr) + } + } + #else chr has been given as a numeric and can be used directly. + else + { + c = nchr + } + + #Rename parameters of TAPS_plot_output so we can re-use other plots as template. + chr =regs$chr + start = regs$start + end = regs$end + int = regs$logs + ai = regs$scores + ideogram=NULL + mchr = as.character(Log2$Chromosome) + mpos = Log2$Start + mval =Log2$Value + schr = as.character(alf$Chromosome) + spos = alf$Start + sval =alf$Value + xlim=c(-1,2) + ylim=c(0,1) + + #check if hg18 is true + #then load hg18 knownGene list + if(hg18==T) + { + kg = knownGene_hg18 + } else { - c = chr + kg = knownGene } - #Rename parameters of TAPS_plot_output so we can re-use other plots as template. - chr =regs$chr - start = regs$start - end = regs$end - int = regs$logs - ai = regs$scores - ideogram=NULL - mchr = as.character(Log2$Chromosome) - mpos = Log2$Start - mval =Log2$Value - schr = as.character(alf$Chromosome) - spos = alf$Start - sval =alf$Value - xlim=c(-1,2) - ylim=c(0,1) - #check if hg18 is true - #then load hg18 knownGene list - if(hg18==T) - { - kg = knownGene_hg18 - } - else - { - kg = knownGene - } + # + #Here is where pretty normal plotting procedure starts + # + #Get ideogram + ideogram=getIdeogram() - # - #Here is where pretty normal plotting procedure starts - # + #Set color gradient for p and q arm of chromosome + colors_p <- colorRampPalette(c("#6600FF","#9900CC"),space="rgb") + colors_q <- colorRampPalette(c("#CC0099","#CC0000"),space="rgb") - #Get ideogram - ideogram=getIdeogram() + #filter the data (remove NA) and set some standard parameters + ai[is.na(ai)]=0 + aix=ai!=0 + chr=chr[aix] + start=start[aix] + end=end[aix] + int=int[aix] + ai=ai[aix] + pos <- (start+end)/2 + length=end-start - #Set color gradient for p and q arm of chromosome - colors_p <- colorRampPalette(c("#6600FF","#9900CC"),space="rgb") - colors_q <- colorRampPalette(c("#CC0099","#CC0000"),space="rgb") + #Set sizes for circles in whole genome plot + size=rep(1,length(chr)) + size[length>2000000]=2 + size[length>5000000]=3 + size[length>10000000]=4 - #filter the data (remove NA) and set some standard parameters - ai[is.na(ai)]=0 - aix=ai!=0 - chr=chr[aix] - start=start[aix] - end=end[aix] - int=int[aix] - ai=ai[aix] - pos <- (start+end)/2 - length=end-start + #Select the chromosome + this <- ideogram[ideogram$c==c,] - #Set sizes for circles in whole genome plot - size=rep(1,length(chr)) - size[length>2000000]=2 - size[length>5000000]=3 - size[length>10000000]=4 + #Extract regions start an stop + #region inputted in form start:stop + Rstart = min(region) + Rend = max(region) + + #Initialize jpeg + jpeg(paste(name,'_',this$chr,'_region_',Rstart,"-",Rend,'.jpeg',sep=''),width=11.7,height=8.3,units="in",res=300) + + #split plot into desired formation + split.screen(as.matrix(data.frame(left=c(rep(0.05,4),rep(0.47,3)), + right=c(0.45,rep(1,6)), + bottom=c(0.50,0.05,0.2,0.3,0.50,0.70,0.75), + top = c(0.95,0.2,0.3,0.45,0.70,0.75,0.95)))) #screen 1-5 - #Select the chromosome - this <- ideogram[ideogram$c==c,] - #Extract regions start an stop - #region inputted in form start:stop - Rstart = min(region) - Rend = max(region) - - #Initialize jpeg - jpeg(paste(name,'_',this$chr,'_region_',Rstart,"-",Rend,'.jpeg',sep=''),width=11.7,height=8.3,units="in",res=300) - - #split plot into desired formation - split.screen(as.matrix(data.frame(left=c(rep(0.05,4),rep(0.47,3)), - right=c(0.45,rep(1,6)), - bottom=c(0.50,0.05,0.2,0.3,0.50,0.70,0.75), - top = c(0.95,0.2,0.3,0.45,0.70,0.75,0.95)))) #screen 1-5 + #Screen configuration overview + #------------------------------------------------------------- + #------------------------------------------------------------- + # | | + # | 7 | + # | | + # |------------------------------| + # 1 | 6 | + # |------------------------------| + # | | + # | 5 | + # | | + #-----------------------------|------------------------------| [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/patchwork -r 170 From noreply at r-forge.r-project.org Wed Jun 5 14:18:30 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 5 Jun 2013 14:18:30 +0200 (CEST) Subject: [Patchwork-commits] r171 - in pkg: patchwork patchwork/R patchworkCG/man Message-ID: <20130605121830.CBB581851C7@r-forge.r-project.org> Author: sebastian_d Date: 2013-06-05 14:18:30 +0200 (Wed, 05 Jun 2013) New Revision: 171 Modified: pkg/patchwork/DESCRIPTION pkg/patchwork/R/patchwork.alleledata.r pkg/patchworkCG/man/patchwork.CG.plot.Rd Log: update that should fix gooch bugg Modified: pkg/patchwork/DESCRIPTION =================================================================== --- pkg/patchwork/DESCRIPTION 2013-06-03 12:42:06 UTC (rev 170) +++ pkg/patchwork/DESCRIPTION 2013-06-05 12:18:30 UTC (rev 171) @@ -3,9 +3,9 @@ Title: Allele-specific Copy Number Analysis of whole genome data Version: 2.2 Date: 2012-30-08 -Author: Markus Rasmussen, Sebastian DiLorenzo -Maintainer: Markus Rasmussen -Description: Performs a copy number analysis of whole genome data. +Author: Markus Mayrhofer, Sebastian DiLorenzo +Maintainer: Markus Mayrhofer +Description: Performs a allele-specific copy number analysis of whole genome data. License: GPL-2 Imports: patchworkData Depends: DNAcopy Modified: pkg/patchwork/R/patchwork.alleledata.r =================================================================== --- pkg/patchwork/R/patchwork.alleledata.r 2013-06-03 12:42:06 UTC (rev 170) +++ pkg/patchwork/R/patchwork.alleledata.r 2013-06-05 12:18:30 UTC (rev 171) @@ -19,16 +19,17 @@ #Copy perl information from package install location system(paste("cp -r ",packagepath,"/perl .perl",sep="")) - if (is.null(vcf)==F) + if(is.null(vcf)) { + #old samtools pileup -vcf used. + #cat("pileup used \n") + system(paste("cat ",Pileup," | perl .perl/pile2alleles.pl > ",getwd(),"/pile.alleles",sep="")) + } else + { #mpileup and bcftools used. read the pileup and vcf. + #cat("mpileup used \n") system(paste("perl .perl/mpile2alleles.pl ",Pileup," ",vcf," >",getwd(),"/pile.alleles",sep="")) } - else - { - #old samtools pileup -vcf used. - system(paste("cat ",Pileup," | perl .perl/pile2alleles.pl > ",getwd(),"/pile.alleles",sep="")) - } #Cleanup system("rm -r .perl") @@ -48,7 +49,10 @@ #Force compatability between naming of chromosomes to our chromosome names #from ideogram file. chr1...chr22,chrX,chrY data(ideogram,package="patchworkData") - alf = alf[-grep("M",alf$achr),] + if(length(grep("M",alf$achr))!=0) + { + alf = alf[-grep("M",alf$achr),] + } alf$achr = as.character(alf$achr) x_x = strsplit(alf$achr[1],"chr") @@ -81,8 +85,7 @@ if (as.numeric(hgcheck[[1]][2]) <= 10000) { data(commonSnpsHG18,package="patchworkData") - } - else + } else { data(commonSnps132,package="patchworkData") } Modified: pkg/patchworkCG/man/patchwork.CG.plot.Rd =================================================================== --- pkg/patchworkCG/man/patchwork.CG.plot.Rd 2013-06-03 12:42:06 UTC (rev 170) +++ pkg/patchworkCG/man/patchwork.CG.plot.Rd 2013-06-05 12:18:30 UTC (rev 171) @@ -22,7 +22,8 @@ \arguments{ \item{path}{ - Path to the ASM folder. One of the subfolders of your completegenomics directory. + Path to the ASM folder. One of the subfolders of your completegenomics directory. Should be given as a string. + Ex. path="path/to/ASM". } \item{name}{ Default is 'CG_sample'. The name you wish associated with the plots that will be generated. From noreply at r-forge.r-project.org Wed Jun 5 16:12:24 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 5 Jun 2013 16:12:24 +0200 (CEST) Subject: [Patchwork-commits] r172 - pkg/patchwork/R Message-ID: <20130605141224.CD89618429E@r-forge.r-project.org> Author: sebastian_d Date: 2013-06-05 16:12:24 +0200 (Wed, 05 Jun 2013) New Revision: 172 Modified: pkg/patchwork/R/patchwork.alleledata.r Log: fix to choosing correct DBSNP list for different chromosome naming conventions. (chr1 or 1) Modified: pkg/patchwork/R/patchwork.alleledata.r =================================================================== --- pkg/patchwork/R/patchwork.alleledata.r 2013-06-05 12:18:30 UTC (rev 171) +++ pkg/patchwork/R/patchwork.alleledata.r 2013-06-05 14:12:24 UTC (rev 172) @@ -74,14 +74,14 @@ hgcheck = strsplit(line,"\t") #Sometimes chr1 isnt first in the pileup file, traverse until you get to chr1 to see if hg18 or hg19 should be applied. - while(hgcheck[[1]][1] != "chr1") + while((hgcheck[[1]][1] != "chr1") || (hgcheck[[1]][1] != "1")) { line = readLines(con,1) hgcheck = strsplit(line,"\t") } close(con) - + #Check pos to see which Snps should be used, hg18 or hg19 if (as.numeric(hgcheck[[1]][2]) <= 10000) { data(commonSnpsHG18,package="patchworkData") From noreply at r-forge.r-project.org Wed Jun 12 15:31:03 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 12 Jun 2013 15:31:03 +0200 (CEST) Subject: [Patchwork-commits] r173 - in pkg: TAPS patchwork patchwork/inst/perl Message-ID: <20130612133103.DCA83184B6F@r-forge.r-project.org> Author: sebastian_d Date: 2013-06-12 15:31:03 +0200 (Wed, 12 Jun 2013) New Revision: 173 Modified: pkg/TAPS/DESCRIPTION pkg/patchwork/DESCRIPTION pkg/patchwork/NAMESPACE pkg/patchwork/inst/perl/mpile2alleles.pl Log: Removed dependencies from description because Rforge cant handle them at the moment Modified: pkg/TAPS/DESCRIPTION =================================================================== --- pkg/TAPS/DESCRIPTION 2013-06-05 14:12:24 UTC (rev 172) +++ pkg/TAPS/DESCRIPTION 2013-06-12 13:31:03 UTC (rev 173) @@ -7,5 +7,5 @@ Maintainer: Sebastian DiLorenzo #Markus Mayrhofer Description: Performs a allele-specific copy number analysis of array data. License: GPL-2 -Depends:R (>= 2.10), DNAcopy, fields, affxparser +Depends:R (>= 2.10) #Imports: DNAcopy, fields, affxparser \ No newline at end of file Modified: pkg/patchwork/DESCRIPTION =================================================================== --- pkg/patchwork/DESCRIPTION 2013-06-05 14:12:24 UTC (rev 172) +++ pkg/patchwork/DESCRIPTION 2013-06-12 13:31:03 UTC (rev 173) @@ -7,5 +7,5 @@ Maintainer: Markus Mayrhofer Description: Performs a allele-specific copy number analysis of whole genome data. License: GPL-2 -Imports: patchworkData -Depends: DNAcopy +#Imports: patchworkData +#Depends: DNAcopy Modified: pkg/patchwork/NAMESPACE =================================================================== --- pkg/patchwork/NAMESPACE 2013-06-05 14:12:24 UTC (rev 172) +++ pkg/patchwork/NAMESPACE 2013-06-12 13:31:03 UTC (rev 173) @@ -1,4 +1,4 @@ -import(patchworkData) +#import(patchworkData) export(karyotype_check, karyotype_chroms, Modified: pkg/patchwork/inst/perl/mpile2alleles.pl =================================================================== --- pkg/patchwork/inst/perl/mpile2alleles.pl 2013-06-05 14:12:24 UTC (rev 172) +++ pkg/patchwork/inst/perl/mpile2alleles.pl 2013-06-12 13:31:03 UTC (rev 173) @@ -54,7 +54,6 @@ my ($chr, $pos, $ref, $depth, $baseString) = (split /\t/, $_)[0,1,2,3,4]; #If the position and chromosome match between pileup and vcf - # add if smaller than if ($vchr eq $chr && $vpos == $pos) { From noreply at r-forge.r-project.org Wed Jun 12 16:26:18 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 12 Jun 2013 16:26:18 +0200 (CEST) Subject: [Patchwork-commits] r174 - in .git: . logs logs/refs/heads logs/refs/remotes/origin refs/heads refs/remotes/origin Message-ID: <20130612142618.3D67818577F@r-forge.r-project.org> Author: sebastian_d Date: 2013-06-12 16:26:17 +0200 (Wed, 12 Jun 2013) New Revision: 174 Removed: .git/objects/ Modified: .git/ .git/COMMIT_EDITMSG .git/index .git/logs/HEAD .git/logs/refs/heads/master .git/logs/refs/remotes/origin/master .git/refs/heads/master .git/refs/remotes/origin/master Log: trying to remove some git objects from status Property changes on: .git ___________________________________________________________________ Modified: svn:ignore - . + objects Modified: .git/COMMIT_EDITMSG =================================================================== --- .git/COMMIT_EDITMSG 2013-06-12 13:31:03 UTC (rev 173) +++ .git/COMMIT_EDITMSG 2013-06-12 14:26:17 UTC (rev 174) @@ -1 +1 @@ -Added patchwork messaging to know which file is being used for allele data generation +updates to fix gooch bugg Modified: .git/index =================================================================== (Binary files differ) Modified: .git/logs/HEAD =================================================================== --- .git/logs/HEAD 2013-06-12 13:31:03 UTC (rev 173) +++ .git/logs/HEAD 2013-06-12 14:26:17 UTC (rev 174) @@ -38,3 +38,8 @@ 22eb0c8de456d9ed783868a3db491b52008fb116 028901af11a1b01a4147feab3f19214457984911 Sebastian DiLorenzo 1363350024 +0100 pull : Fast-forward 028901af11a1b01a4147feab3f19214457984911 aa2927bca2c8a8dcd8482384ed8ed97995508514 Sebastian DiLorenzo 1363604552 +0100 commit: fixed an issue where hg18 common snps list was not being used when it should have been aa2927bca2c8a8dcd8482384ed8ed97995508514 f25144d2475776c2cec713208516fe1072862311 Sebastian DiLorenzo 1363613325 +0100 commit: Added patchwork messaging to know which file is being used for allele data generation +f25144d2475776c2cec713208516fe1072862311 e43d6d23579d2fc2b6590271f8db30a1afcd9a25 Sebastian DiLorenzo 1366641612 +0200 commit: Initial add of TAPS +e43d6d23579d2fc2b6590271f8db30a1afcd9a25 ac162be51fdf83fec9291a9caa7d90fe8884cafd Sebastian DiLorenzo 1369816487 +0200 commit: Buggfix where patchwork.alleledata would return an emtpy array. +ac162be51fdf83fec9291a9caa7d90fe8884cafd 6f84921e7c20baa037383bd5abbe2bbbd9ccf494 Sebastian DiLorenzo 1369817275 +0200 commit: Buggfix where patchwork.alleledata would return an emtpy array. +6f84921e7c20baa037383bd5abbe2bbbd9ccf494 eec89ae45e1cadef3ec00c7ad9f556b9c5c86789 Sebastian DiLorenzo 1370248828 +0200 commit: updating TAPS +eec89ae45e1cadef3ec00c7ad9f556b9c5c86789 cb78a64920a2a019a496e6ec35bd383e34b3dff7 Sebastian DiLorenzo 1370434914 +0200 commit: updates to fix gooch bugg Modified: .git/logs/refs/heads/master =================================================================== --- .git/logs/refs/heads/master 2013-06-12 13:31:03 UTC (rev 173) +++ .git/logs/refs/heads/master 2013-06-12 14:26:17 UTC (rev 174) @@ -38,3 +38,8 @@ 22eb0c8de456d9ed783868a3db491b52008fb116 028901af11a1b01a4147feab3f19214457984911 Sebastian DiLorenzo 1363350024 +0100 pull : Fast-forward 028901af11a1b01a4147feab3f19214457984911 aa2927bca2c8a8dcd8482384ed8ed97995508514 Sebastian DiLorenzo 1363604552 +0100 commit: fixed an issue where hg18 common snps list was not being used when it should have been aa2927bca2c8a8dcd8482384ed8ed97995508514 f25144d2475776c2cec713208516fe1072862311 Sebastian DiLorenzo 1363613325 +0100 commit: Added patchwork messaging to know which file is being used for allele data generation +f25144d2475776c2cec713208516fe1072862311 e43d6d23579d2fc2b6590271f8db30a1afcd9a25 Sebastian DiLorenzo 1366641612 +0200 commit: Initial add of TAPS +e43d6d23579d2fc2b6590271f8db30a1afcd9a25 ac162be51fdf83fec9291a9caa7d90fe8884cafd Sebastian DiLorenzo 1369816487 +0200 commit: Buggfix where patchwork.alleledata would return an emtpy array. +ac162be51fdf83fec9291a9caa7d90fe8884cafd 6f84921e7c20baa037383bd5abbe2bbbd9ccf494 Sebastian DiLorenzo 1369817275 +0200 commit: Buggfix where patchwork.alleledata would return an emtpy array. +6f84921e7c20baa037383bd5abbe2bbbd9ccf494 eec89ae45e1cadef3ec00c7ad9f556b9c5c86789 Sebastian DiLorenzo 1370248828 +0200 commit: updating TAPS +eec89ae45e1cadef3ec00c7ad9f556b9c5c86789 cb78a64920a2a019a496e6ec35bd383e34b3dff7 Sebastian DiLorenzo 1370434914 +0200 commit: updates to fix gooch bugg Modified: .git/logs/refs/remotes/origin/master =================================================================== --- .git/logs/refs/remotes/origin/master 2013-06-12 13:31:03 UTC (rev 173) +++ .git/logs/refs/remotes/origin/master 2013-06-12 14:26:17 UTC (rev 174) @@ -38,3 +38,7 @@ 22eb0c8de456d9ed783868a3db491b52008fb116 028901af11a1b01a4147feab3f19214457984911 Sebastian DiLorenzo 1363350024 +0100 pull : fast-forward 028901af11a1b01a4147feab3f19214457984911 aa2927bca2c8a8dcd8482384ed8ed97995508514 Sebastian DiLorenzo 1363604601 +0100 update by push aa2927bca2c8a8dcd8482384ed8ed97995508514 f25144d2475776c2cec713208516fe1072862311 Sebastian DiLorenzo 1363613338 +0100 update by push +f25144d2475776c2cec713208516fe1072862311 e43d6d23579d2fc2b6590271f8db30a1afcd9a25 Sebastian DiLorenzo 1366641634 +0200 update by push +e43d6d23579d2fc2b6590271f8db30a1afcd9a25 6f84921e7c20baa037383bd5abbe2bbbd9ccf494 Sebastian DiLorenzo 1369817296 +0200 update by push +6f84921e7c20baa037383bd5abbe2bbbd9ccf494 eec89ae45e1cadef3ec00c7ad9f556b9c5c86789 Sebastian DiLorenzo 1370248841 +0200 update by push +eec89ae45e1cadef3ec00c7ad9f556b9c5c86789 cb78a64920a2a019a496e6ec35bd383e34b3dff7 Sebastian DiLorenzo 1370434931 +0200 update by push Modified: .git/refs/heads/master =================================================================== --- .git/refs/heads/master 2013-06-12 13:31:03 UTC (rev 173) +++ .git/refs/heads/master 2013-06-12 14:26:17 UTC (rev 174) @@ -1 +1 @@ -f25144d2475776c2cec713208516fe1072862311 +cb78a64920a2a019a496e6ec35bd383e34b3dff7 Modified: .git/refs/remotes/origin/master =================================================================== --- .git/refs/remotes/origin/master 2013-06-12 13:31:03 UTC (rev 173) +++ .git/refs/remotes/origin/master 2013-06-12 14:26:17 UTC (rev 174) @@ -1 +1 @@ -f25144d2475776c2cec713208516fe1072862311 +cb78a64920a2a019a496e6ec35bd383e34b3dff7 From noreply at r-forge.r-project.org Tue Jun 18 16:42:46 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 18 Jun 2013 16:42:46 +0200 (CEST) Subject: [Patchwork-commits] r175 - / .git .git/logs .git/logs/refs/heads .git/logs/refs/remotes/origin .git/refs/heads .git/refs/remotes/origin pkg/TAPS/R www www/css/img Message-ID: <20130618144246.8898B1856D3@r-forge.r-project.org> Author: sebastian_d Date: 2013-06-18 16:42:45 +0200 (Tue, 18 Jun 2013) New Revision: 175 Added: www/AI_ALR.php www/TAPS_exec.php www/TAPS_inst.php www/TAPS_requ.php www/TAPS_resu.php www/css/img/TAPS_AI_ALR.jpeg www/css/img/TAPS_call_help.png www/css/img/TAPS_check2.png www/css/img/TAPS_chromosomal2.jpg www/css/img/TAPS_chromosomalCN.jpg www/css/img/TAPS_overview2.jpg www/css/img/flowchartTAPS.jpg Modified: .git/COMMIT_EDITMSG .git/index .git/logs/HEAD .git/logs/refs/heads/master .git/logs/refs/remotes/origin/master .git/refs/heads/master .git/refs/remotes/origin/master / pkg/TAPS/R/TAPS.r www/AI_Cov.php www/changelog.php www/index.php www/intro.php www/pw_exec.php www/pw_inst.php www/pw_resu.php Log: substantial changes to homepage including adding TAPS guide. Some changes to TAPS Property changes on: ___________________________________________________________________ Modified: svn:ignore - .git + .git/objects Modified: .git/COMMIT_EDITMSG =================================================================== --- .git/COMMIT_EDITMSG 2013-06-12 14:26:17 UTC (rev 174) +++ .git/COMMIT_EDITMSG 2013-06-18 14:42:45 UTC (rev 175) @@ -1 +1 @@ -updates to fix gooch bugg +Substantial changes to homepage which now incudes TAPS tutorial as well as some changes to TAPS Modified: .git/index =================================================================== (Binary files differ) Modified: .git/logs/HEAD =================================================================== --- .git/logs/HEAD 2013-06-12 14:26:17 UTC (rev 174) +++ .git/logs/HEAD 2013-06-18 14:42:45 UTC (rev 175) @@ -43,3 +43,7 @@ ac162be51fdf83fec9291a9caa7d90fe8884cafd 6f84921e7c20baa037383bd5abbe2bbbd9ccf494 Sebastian DiLorenzo 1369817275 +0200 commit: Buggfix where patchwork.alleledata would return an emtpy array. 6f84921e7c20baa037383bd5abbe2bbbd9ccf494 eec89ae45e1cadef3ec00c7ad9f556b9c5c86789 Sebastian DiLorenzo 1370248828 +0200 commit: updating TAPS eec89ae45e1cadef3ec00c7ad9f556b9c5c86789 cb78a64920a2a019a496e6ec35bd383e34b3dff7 Sebastian DiLorenzo 1370434914 +0200 commit: updates to fix gooch bugg +cb78a64920a2a019a496e6ec35bd383e34b3dff7 5eeba51632467a2cf6300bb53b26c98e0a03d735 Sebastian DiLorenzo 1371209333 +0200 pull : Fast-forward +5eeba51632467a2cf6300bb53b26c98e0a03d735 b6c91dc80295b120969877f8e582708fb89038cc Sebastian DiLorenzo 1371462080 +0200 commit: some changes to TAPS +b6c91dc80295b120969877f8e582708fb89038cc 532c860ab5cdbc3cbfd3537ef8fe60f35d4935de Sebastian DiLorenzo 1371462084 +0200 pull : Merge made by recursive. +532c860ab5cdbc3cbfd3537ef8fe60f35d4935de 8fa9d868a51e8b4bdee100d16c6219d2541df0a6 Sebastian DiLorenzo 1371566516 +0200 commit: Substantial changes to homepage which now incudes TAPS tutorial as well as some changes to TAPS Modified: .git/logs/refs/heads/master =================================================================== --- .git/logs/refs/heads/master 2013-06-12 14:26:17 UTC (rev 174) +++ .git/logs/refs/heads/master 2013-06-18 14:42:45 UTC (rev 175) @@ -43,3 +43,7 @@ ac162be51fdf83fec9291a9caa7d90fe8884cafd 6f84921e7c20baa037383bd5abbe2bbbd9ccf494 Sebastian DiLorenzo 1369817275 +0200 commit: Buggfix where patchwork.alleledata would return an emtpy array. 6f84921e7c20baa037383bd5abbe2bbbd9ccf494 eec89ae45e1cadef3ec00c7ad9f556b9c5c86789 Sebastian DiLorenzo 1370248828 +0200 commit: updating TAPS eec89ae45e1cadef3ec00c7ad9f556b9c5c86789 cb78a64920a2a019a496e6ec35bd383e34b3dff7 Sebastian DiLorenzo 1370434914 +0200 commit: updates to fix gooch bugg +cb78a64920a2a019a496e6ec35bd383e34b3dff7 5eeba51632467a2cf6300bb53b26c98e0a03d735 Sebastian DiLorenzo 1371209333 +0200 pull : Fast-forward +5eeba51632467a2cf6300bb53b26c98e0a03d735 b6c91dc80295b120969877f8e582708fb89038cc Sebastian DiLorenzo 1371462080 +0200 commit: some changes to TAPS +b6c91dc80295b120969877f8e582708fb89038cc 532c860ab5cdbc3cbfd3537ef8fe60f35d4935de Sebastian DiLorenzo 1371462084 +0200 pull : Merge made by recursive. +532c860ab5cdbc3cbfd3537ef8fe60f35d4935de 8fa9d868a51e8b4bdee100d16c6219d2541df0a6 Sebastian DiLorenzo 1371566516 +0200 commit: Substantial changes to homepage which now incudes TAPS tutorial as well as some changes to TAPS Modified: .git/logs/refs/remotes/origin/master =================================================================== --- .git/logs/refs/remotes/origin/master 2013-06-12 14:26:17 UTC (rev 174) +++ .git/logs/refs/remotes/origin/master 2013-06-18 14:42:45 UTC (rev 175) @@ -42,3 +42,6 @@ e43d6d23579d2fc2b6590271f8db30a1afcd9a25 6f84921e7c20baa037383bd5abbe2bbbd9ccf494 Sebastian DiLorenzo 1369817296 +0200 update by push 6f84921e7c20baa037383bd5abbe2bbbd9ccf494 eec89ae45e1cadef3ec00c7ad9f556b9c5c86789 Sebastian DiLorenzo 1370248841 +0200 update by push eec89ae45e1cadef3ec00c7ad9f556b9c5c86789 cb78a64920a2a019a496e6ec35bd383e34b3dff7 Sebastian DiLorenzo 1370434931 +0200 update by push +cb78a64920a2a019a496e6ec35bd383e34b3dff7 5eeba51632467a2cf6300bb53b26c98e0a03d735 Sebastian DiLorenzo 1371209333 +0200 pull : fast-forward +5eeba51632467a2cf6300bb53b26c98e0a03d735 6eb4b7b50b8a1e1e97b2abc30404fa09d78e029e Sebastian DiLorenzo 1371461678 +0200 pull : fast-forward +6eb4b7b50b8a1e1e97b2abc30404fa09d78e029e 8fa9d868a51e8b4bdee100d16c6219d2541df0a6 Sebastian DiLorenzo 1371566540 +0200 update by push Modified: .git/refs/heads/master =================================================================== --- .git/refs/heads/master 2013-06-12 14:26:17 UTC (rev 174) +++ .git/refs/heads/master 2013-06-18 14:42:45 UTC (rev 175) @@ -1 +1 @@ -cb78a64920a2a019a496e6ec35bd383e34b3dff7 +8fa9d868a51e8b4bdee100d16c6219d2541df0a6 Modified: .git/refs/remotes/origin/master =================================================================== --- .git/refs/remotes/origin/master 2013-06-12 14:26:17 UTC (rev 174) +++ .git/refs/remotes/origin/master 2013-06-18 14:42:45 UTC (rev 175) @@ -1 +1 @@ -cb78a64920a2a019a496e6ec35bd383e34b3dff7 +8fa9d868a51e8b4bdee100d16c6219d2541df0a6 Modified: pkg/TAPS/R/TAPS.r =================================================================== --- pkg/TAPS/R/TAPS.r 2013-06-12 14:26:17 UTC (rev 174) +++ pkg/TAPS/R/TAPS.r 2013-06-18 14:42:45 UTC (rev 175) @@ -1,3180 +1,3274 @@ -TAPS_plot <- function(directory=NULL,#xlim=c(-1,2),ylim=c(0,1), - bin=400) { -#Automatically check, and if needed install, packages stats and fields - -#Load stats. It should be in all, at least semi-new, R distributions so we dont need to install.package it or -#pre-install it -library(stats) - -#list.of.packages <- c("stats", "fields") -#new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])] -#if(length(new.packages)) install.packages(new.packages) - -if (is.null(directory)) - { - cat("No directory supplied, using working directory.") - directory = "." - #cat("You have not assigned a directory containing one or more folders of samples for TAPS_plot to execute. \n") - #cat("Example: \"/user/mysamples/\" or, to run it in your current working directory, \".\" \n") - #directory = readline("Please supply such a directory now: ") - } - -## This function takes a directory as input, then builds short-segment TAPS scatter plots for each sample (subdirectory) in the directory. - setwd(directory) - subs <- getSubdirs() - if (is.null(subs)) { ## check samples = subdirectories or a single sample = current directory - subs=thisSubdir() - setwd('..') - } - - # create SampleData file if there is none. - if (length(grep('SampleData.txt',dir()))==0) save.txt(data.frame(Sample=subs,cn2='',delta='',loh='',completed.analysis='no'),file='SampleData.txt') - - for (i in 1:length(subs)) try( { - setwd(subs[i]) - name <- subs[i] - #if (length(grep('SampleData.txt',dir()))==0) save.txt(data.frame(Sample=name,cn2='',delta='',loh='',completed.analysis='no'),file='SampleData.txt') - cat(' ..loading', subs[i]) - - if(length(grep("*.cyhd.cychp",dir()))==1) ##cyhd sample - { - ##read CYCHP file from ChAS with logratio info## - ################################################ - library(affxparser) - - name=list.files(".",pattern="*.cychp") - temp=readCcg(name) - tempLog2=temp$dataGroups$ProbeSets$dataSets$CopyNumber$table[,1:4] - #Value=NULL - Start=tempLog2$Position - End=tempLog2$Position - Value=tempLog2$Log2Ratio - tempChr=tempLog2$Chromosome - nrows=dim(tempLog2)[1] - Chromosome=rep(NA,nrows) - for (i in 1:nrows) { - Chromosome[i]=paste('chr', tempChr[i], sep="") - } - - - Log2=as.data.frame(cbind(Chromosome, Start, End, Value)) - - colnames(Log2)=c("Chromosome","Start","End","Value") - - Log2$Chromosome = as.character(Log2$Chromosome) - Log2$Chromosome[Log2$Chromosome=="chr24"] = "chrX" - Log2$Chromosome[Log2$Chromosome=="chr25"] = "chrY" - Log2$Chromosome = as.factor(Log2$Chromosome) - - Log2$Start = as.integer(as.character(Log2$Start)) - Log2$End = as.integer(as.character(Log2$End)) - Log2$Value = as.numeric(as.character(Log2$Value)) - - ##read txt file from ChAS with snp info## - ######################################### - - name=list.files(".",pattern="*.cyhd.txt") - tempalf=read.table(file=name, header=FALSE, sep="\t", skip=12) - SignalA=tempalf$V4 - SignalB=tempalf$V5 - tempChr=tempalf$V8 - Start=tempalf$V9 - End=tempalf$V9 - Chromosome=Value=rep(NA,nrows) - nrows=dim(tempalf)[1] - for (i in 1:nrows) { - Value[i]=SignalB[i]/(SignalB[i]+SignalA[i]) - Chromosome[i]=paste('chr', tempChr[i], sep="") - } - - alf=as.data.frame(cbind(Chromosome, Start, End, Value)) - - colnames(alf)=c("Chromosome","Start","End","Value") - - alf$Start = as.integer(as.character(alf$Start)) - alf$End = as.integer(as.character(alf$End)) - alf$Value = as.numeric(as.character(alf$Value)) - } - else - { - Log2 <- readLog2() ## Log-R - alf <- readAlf() ## Allele Frequency - } - - Log2=Log2[!is.nan(Log2$Value),] - Log2=Log2[!is.na(Log2$Value),] - alf=alf[!is.nan(alf$Value),] - alf=alf[!is.na(alf$Value),] - - segments <- readSegments() ## segments if available (CBS recommended) - - #Remove NA values that some samples give. - segments <- segments[!is.nan(segments$Value),] - - cat(' ..processing') - if (is.null(segments)) { ## segmentation using DNA-copy if needed (must then be installed) - segments <- segment_DNAcopy(Log2) - save.txt(segments,'_segments.txt') - } - - segments$Value <- segments$Value-median(Log2$Value) ## Median-centering - Log2$Value <- Log2$Value-median(Log2$Value) ## Median-centering - - - allRegions <- makeRegions(Log2, alf, segments) ## Calculates necessary data for segments (all functions are in this file) - save(allRegions,file='allRegions.Rdata') - regs <- regsFromSegs(Log2,alf,segments,bin=bin,min=5) ## Calculates the same data for shortened segments, very useful for visualization - save(regs,file='shortRegions.Rdata') - - #Save for TAPS_region() - save(regs,Log2,alf,segments,file="TAPS_plot_output.Rdata") - - #Clear warnings generated previously so hopefully I can see what is actually causing the program to fail. - #assign("last.warning", NULL, envir = baseenv()) - - cat('..plotting.\n') - - OverviewPlot(regs$chr,regs$start,regs$end,regs$logs,regs$scores,ideogram=NULL, - as.character(Log2$Chromosome),Log2$Start,Log2$Value,as.character(alf$Chromosome),alf$Start,alf$Value, - name=name,xlim=c(-1,1.5),ylim=c(0,1)) - - ## Chromosome-wise plots for manual analysis - regions=allRegions$regions - - karyotype_chroms(regs$chr,regs$start,regs$end,regs$logs,regs$scores,ideogram=NULL, - as.character(Log2$Chromosome),Log2$Start,Log2$Value,as.character(alf$Chromosome),alf$Start, - alf$Value,name=name,xlim=c(-1,2),ylim=c(0,1)) - - cat('..done\n') - setwd('..') - }, silent=T) -} -### - -### -TAPS_call <- function(directory=NULL,#xlim=c(-1,1),ylim=c(0,1), - minseg=1,maxCn=12) { -## TAPS_call outputs the total and minor allele copy numbers of all segments as a text file, and as images for visual confirmation. -## sampleInfo_TAPS.txt must be present in each sample folder. If TAPS_plot could not make a good guess of the Log-R of copy number 2 -## and the Log-R difference to a deletion, you must interpret the scatter plots and edit sampleInfo_TAPS.txt. - if (is.null(directory)) - { - cat("No directory supplied, using working directory.") - directory = "." - #cat("You have not assigned a directory containing one or more folders of samples for TAPS_call to execute. \n") - #cat("Example: \"/user/mysamples/\" or, to run it in your current working directory, \".\" \n") - #directory = readline("Please supply such a directory now: ") - } - - - setwd(directory) - #subs <- getSubdirs() - - if (length(grep('SampleData.txt',dir()))==1) - { - sampleData <- load.txt('SampleData.txt') - } - else - { - sampleData <- load.txt('../SampleData.txt') - } - subs=as.character(sampleData$Sample) - #save.txt(sampleData,file='sampleData_old.csv') - - if (is.null(subs)) { - subs=thisSubdir() - setwd('..') - } - for (i in 1:length(subs)) if (sampleData$completed.analysis[i]=='no') { - setwd(subs[i]) - name <- subs[i] - sampleInfo <- sampleData[sampleData$Sample==subs[i],] - if (nrow(sampleInfo)==1) { - - cat(' ..loading', subs[i]) - Log2 <- readLog2() - alf <- readAlf(localDir) - segments <- readSegments() - - #Some samples throw NA values, we simply remove these. - Log2=Log2[!is.nan(Log2$Value),] - Log2=Log2[!is.na(Log2$Value),] - - alf=alf[!is.nan(alf$Value),] - alf=alf[!is.na(alf$Value),] - - segments <- segments[!is.nan(segments$Value),] - - segments$Value <- segments$Value-median(Log2$Value) - Log2$Value <- Log2$Value-median(Log2$Value) - - cat(' ..processing.\n') - - load('allRegions.Rdata') ## These were prepared in TAPS_plot - #allRegions <- makeRegions(Log2, alf, segments) - - t <- findCNs(Log2,alf,allRegions,dmin=0.9,maxCn=maxCn,ceiling=1,sampleInfo=sampleInfo) ## estimates the Log-R and Allelic Imbalance Ration of all variants up to maxCn - - u <- setCNs(allRegions,t$int,t$ai,maxCn) ## Assigns copy number variant for all segments - allRegions$regions <- u$regions - save.txt(u$regions,file=paste(name,'_segmentCN.txt',sep='')) ## adjacent segments with idendical copy number are merged (except over centromere) and all are saved to a text file - regions=allRegions$regions - save(t,regions,file="regions_t.Rdata") - - karyotype_check(regions$Chromosome,regions$Start,regions$End,regions$log2,regions$imba,regions$Cn,regions$mCn,t,ideogram=NULL,name=name) - - karyotype_chromsCN(regions$Chromosome,regions$Start,regions$End,regions$log2, - regions$imba,regions$Cn,regions$mCn,ideogram=NULL, - Log2$Chromosome,Log2$Start,Log2$Value,alf$Chromosome, - alf$Start,alf$Value,t,name=name,xlim=c(-1,1),ylim=c(0,1)) - - cat('..done\n') - sampleData$completed.analysis[i] <- '' - } else cat('Skipped',name,'\n') - - setwd('..') - } - save.txt(sampleData,file='SampleData_new.csv') -} -### -regsFromSegs <- function (Log2,alf, segments, bin=200,min=1) { -## This function builds short segments and calcualtes their average Log-R and Allelic Imbalance Ratio. - rownames(Log2)=1:nrows(Log2) - rownames(alf)=1:nrows(alf) - regs=list('chr'=NULL,'start'=NULL,'end'=NULL,'logs'=NULL,'scores'=NULL,'het'=NULL,'hom'=NULL,'probes'=NULL,'snps'=NULL,'key1'=rep(NA,nrow(Log2)),'key2'=rep(NA,nrow(alf))) - n=nrow(segments) - s_check=NULL -for (c in 1:n) { ## for every segment - tlog=Log2[Log2$Chromosome==segments$Chromosome[c],] ## Log-R on this chromosome - talf=alf[alf$Chromosome==segments$Chromosome[c],] ## Allele Freq on this chromosome - tlog=tlog[(tlog$Start>=segments$Start[c])&(tlog$Start=segments$Start[c])&(talf$Start=s_)&(talf$Start<=e_),] ## get the Log-R values - thislog=tlog[(tlog$Start>=s_)&(tlog$Start<=e_),] ## and the allele frequency - regs$key1[as.integer(rownames(thislog))]=length(regs$chr) ## store their positions for fast access during plotting - regs$key2[as.integer(rownames(thisalf))]=length(regs$chr) ## --"-- - regs$logs=c( regs$logs, mean(thislog$Value) ) ## store average log ratio of this segment - regs$probes=c(regs$probes,nrow(thislog)) ## store number of probes - regs$snps=c(regs$snps,nrow(thisalf)) ## store number of bi-allelic probes (SNPs) - #regs$or_seg=c(regs$or_seg,c) - regs$start=c(regs$start,s_) ## store start and end positions - regs$end=c(regs$end,e_) - - if (nrow(thisalf)>min) { ## Time to calculate Allelic Imbalance Ratio (if enough SNPs) - t1=sort( abs(thisalf$Value-0.5) ) ## distance from middle (het) in the allele freq pattern, ascending - if (length(unique(t1))>3) { ## do not attempt clustering with too few snps - xx=NULL - try(xx <- kmeans(t1, 2),silent=T) ## Attempt k-means (Hartigan-Wong: has proven very stable) - if (!is.null(xx)) if (min(xx$size) > 0.05*max(xx$size)) { ## On some occations data quality is poor, requiring 5%+ heterozygous SNPs avoids most such cases. - xx=xx$centers - } else xx=NA - } else xx=NA - } else xx=NA - #try (if (is.na(xx)) xx=0:1, silent=T) - try (if (length(xx)==0) xx=0:1, silent=T) - regs$scores=c(regs$scores, min(xx)/max(xx) ) ## Allelic Imbalance Ratio = inner / outer cluster. - regs$het=c(regs$het, min(xx)) ## $het and $hom are no longer in use. - regs$hom=c(regs$hom, max(xx)) - } -} -return (regs) -} -### -segment_DNAcopy <- function(Log2) { -## If segmentation is required, DNAcopy is a good choice. Must be installed. - #library(DNAcopy) - cat('..Using DNAcopy to create segments:\n') - segs=NULL - chroms=c(as.character(1:22),'X','Y') - chroms=paste('chr',chroms,sep='') - for (c in 1:24) { # segment chromosome - tlog=Log2[Log2$Chromosome==chroms[c],] ## Log-R of this chromosome - if (nrow(tlog)>0) { ## (ChrY may be absent) - cnaObject=segment(smooth.CNA(CNA(tlog$Value, rep(c,nrow(tlog)), tlog$Start, data.type='logratio',sampleid=paste('chr',c))), undo.splits='sdundo', undo.SD=1) ## Segments this chromosome - segs=rbind(segs,cnaObject$output) ## Add result to data frame - } - } - colnames(segs)=c('x','Chromosome','Start','End','Markers','Value') - segs$Chromosome=chrom_ucsc(segs$Chromosome) ## Adjust chromosome names to standard - return(segs[,2:6]) -} -### -readLog2 <- function() { -## This function reads Log-ratio from the file "probes.txt" which must be present in the current directory. - Log2=NULL - try( Log2 <- read.csv(file='probes.txt',header=T,sep='\t'), silent=T) - if (!is.null(Log2)) cat(' ..found probes.txt') - if (is.null(Log2)) { - try( Log2 <- read.csv(file='_probes.txt',header=T,sep='\t'), silent=T) - if (!is.null(Log2)) cat(' ..found _probes.txt') - } -## This code was used if Log-R must be read from .CNCHP file (Affymetrix Genotyping Console or APT). NOT currently supported downstream as .CNCHP is lacks allele-specific information for Affy 250k/500k - # if (is.null(Log2)) { - # dir=dir() - # ix=grep('cnchp',dir,ignore.case=TRUE) - # if (length(ix)==1) - # cat(' ..found',dir[ix]) - # library(affxparser) - # temp=readCcg(dir[ix]) - # temp=temp$dataGroups$MultiData$dataSets$CopyNumber$table - # temp$Chromosome[temp$Chromosome==24]=23 # strange numbers in cnchp - # temp$Chromosome[temp$Chromosome==25]=24 - # Log2 = data.frame('Chromosome'=chrom_ucsc(temp$Chromosome), 'Start'=temp$Position, 'End'=temp$Position, 'Value'=temp$Log2Ratio) - # save.txt(Log2, file='_probes.txt') - # cat(' ..wrote _probes.txt') - # adif=NULL - # try( - # adif <- temp$Allele, - # silent=T - # ) - # if (!is.null(adif)) { - # ix= !is.nan(adif) - # alf=data.frame('Chromosome'=chrom_ucsc(temp$Chromosome[ix]), 'Start'=temp$Position[ix], 'End'=temp$Position[ix], 'Value'=0.5+adif[ix]) - # save.txt(alf, file='_snps.txt') - # cat(' ..wrote _snps.txt') - # } - # } - return (Log2) -} -### -readAlf <- function(localDir=NULL) { -## This funciton reads allele frequency [B/(A+B)] from the file 'snps.txt', which must be present in the current directory. - alf=NULL - try( alf <- read.csv(file='snps.txt',header=T,sep='\t'), silent=T) - if (!is.null(alf)) cat(' ..found snps.txt') - if (is.null(alf)) { - try( alf <- read.csv(file='_snps.txt',header=T,sep='\t'), silent=T) - if (!is.null(alf)) cat(' ..found _snps.txt') - } - #alf=alf[alf$Value!=0.5,] - return (alf) -} -### -readSegments <- function() { -## This function reads segment information in 'segments.txt' which must be present in the current folder. -## The author recommends SNP-rank segmentation (NEXUS) or another CBS such as that in DNACopy. -## Using a HMM is not recommended unless you have a homogenous, diploid sample. (And then there is more user-friendly software anyway.) - segments=NULL - try( segments <- read.csv(file='segments.txt',header=T,sep='\t'),silent=T) - if (!is.null(segments)) cat(' ..found segments.txt') - if (is.null(segments)) { - try( segments <- read.csv(file='_segments.txt',header=T,sep='\t'),silent=T) - if (!is.null(segments)) cat(' ..found _segments.txt') - } - return (segments) -} -### -makeRegions <- function(Log2, alf, segments,dataType='Nexus') { -## makeRegions is similar to "regsfromsegs" except regions are not subdivided before calculation of mean Log-R and Allelic Imbalance Ratio. -regions=segments -regions$Chromosome=as.character(segments$Chromosome) ## Chromosome -regions$lengthMB=round((regions$End-regions$Start)/1000000,3) ## length in megabases -regions$probes=0 ## # of probes -regions$snps=0 ## # of bi-allelic probes (SNPs) -#regions$log2=round(regions$Value,4) -regions$imba=NA ## Allelic Imbalance Ratio -regionIx=NULL ## Not currently used -for (i in 1:nrows(regions)) { - log2temp=which(equals(Log2$Chromosome,regions$Chromosome[i])) ## index of Log-R (current chrom) - alftemp=which(equals(alf$Chromosome,regions$Chromosome[i])) ## index of Allele frequency (current chrom) - - log2temp=log2temp [Log2$Start[log2temp]>=regions$Start[i] & Log2$Start[log2temp]=regions$Start[i] & alf$Start[alftemp]3) { ## Prepare to calculate Allelic Imbalance Ratio - if (dataType=="Nexus") t1=sort( abs(alftemp-0.5) ) ## distance from middle (het), ascending - if (dataType=="CNCHP") t1=sort( abs(alftemp)-0 ) ## This is not currently in use, was intended for analysis of SNP6 .CNCHP data. - if (length(unique(t1))>5) { ## Avoid calculating Allelic Imbalance Ratio unless there are several different values to cluster - xx=NA - xx=try(kmeans(t1, 2), silent=T) ## This part is nearly identical to that of 'regsfromsegs()' - try( if (min(xx$size) > 0.05*max(xx$size)) { - xx=xx$centers - } else xx=NA, silent=T) - } else xx=NA - try(regions$imba[i] <- round( min(xx)/max(xx) ,2), silent=T) - } -} -return(list('regions'=regions,'regionIx'=regionIx)) -} -### -equals <- function(a,b) { -## a helper function in case factors are compared -a <- as.character(a) -b <- as.character(b) -return (a==b) -} -### -nrows <- function(data) dim(data)[1] ## don't ask me about this one. -### -load.txt <- function(file) { ## just to be rid of "sep" - read.csv(file,sep='\t') -} -### -save.txt <- function(data,file='temp', row.names=F, col.names=T, append=F) { ## simplified for convenience - write.table(data,file=file,sep='\t',quote=F,row.names=row.names, col.names=col.names, append=append) -} -### -deChrom_ucsc <- function(data) { -## chroms in 1:24 and chr1:chrY format conversion -if (length(data)==0) return (data) -keep_index=NULL -CHR=rep(0,length(data)) -existing=unique(data) -for (i in 1:length(existing)) { - temp=strsplit(as.character(existing[i]),'_') - temp=strsplit(temp[[1]],'chr')[[1]][2] - if (temp=='X') temp='23' - if (temp=='_X') temp='23' - if (temp=='Y') temp='24' - CHR[data==existing[i]]=as.integer(temp) -} -return (CHR) -} -### -chrom_ucsc <- function(data) { -## same as above, backwards - n=length(data) - out=rep("",n) - for (i in 1:n) { - temp=as.character(data[i]) - if (temp=='23') temp='X' - if (temp=='24') temp='Y' - out[i]=paste('chr',temp, sep='') - } - return(out) -} -### -subplot <- function(x, y) viewport(layout.pos.col=x, layout.pos.row=y) ## for subplots -vplayout <- function(x, y) { - grid.newpage() - pushViewport(viewport(layout=grid.layout(y,x))) -} -### -getSubdirs <- function() { -## Reach for the subdirectories of current directory. - dir=dir() - here=getwd() - n=length(dir) - subdir=F - dir_ix=rep(FALSE,n) - for (i in 1:n) { - try(setwd(dir[i]), silent=T) - if (getwd()!=here) { # in another directory - setwd('..') - subdir=T - dir_ix[i]=T - } - } - if (subdir) return (dir[dir_ix]) - return (NULL) -} -### -thisSubdir <- function() { -## get the name of this subdirectory - here=getwd() - here=strsplit(here,'/')[[1]] - here=here[length(here)] - return(here) -} -### -mySorter <- function(data) { -## sort data on $Chromosome and $Start - temp=data[order(data$Start),] - t=deChrom_ucsc(temp$Chromosome) - temp=temp[!is.na(t),] - t=t[!is.na(t)] - temp=temp[order(t),] - return (temp) -} -### -probesInRegions <- function(regions,probes) { -## This function is not in use. - rchr=as.character(regions$Chromosome) - pchr=as.character(probes$Chr) - nprobes=0 - - for (i in 1:length(rchr)) { - t=strsplit(rchr[i],'chr')[[1]][2] - here=probes[(t==pchr),] #finding probe subset on this chr - matching=(here$Position>=regions$Start[i]) & (here$Position<=regions$End[i]) - nprobes[i]=sum(matching) - } - return(nprobes) -} -### -getOverlap <- function(s1,e1,s2,e2) { ## This is not currently used anywhere - it is destined for group studies and pileups. - return(max((min(e1,e2)-max(s1,s2)),0)) -} -### -weightedMedian <- function(data,weights) { - try( if (length(weights)==0) return (NULL), silent=T) - try( return (median(rep(data,weights),na.rm=T)), silent=T) - return (NULL) -} -weightedMean <- function(data,weights) { - if (length(weights)==0) return (NULL) - return (mean(rep(data,weights),na.rm=T)) -} -### -myMeans <- function(data,k) { ## Not currently used - best <- 0 - clus <- list() - for (i in 1:10) { - clus[[1]] <- kmeans(data,k) - var <- var(clus[[1]]$centers) - if (var>best) { - ix <- i - best <- var - } - } - return (clus[[ix]]) -} -is.even <- function(data) { - return (trunc(data/2)*2 == data) -} -is.odd <- function(data) { - return (trunc(data/2)*2 != data) -} -neighbour <- function(data) { - n <- length(data) - dif <- data[2:n]-data[1:(n-1)] - return (mean(dif)) -} -is.autosome <- function(vector) { - temp <- deChrom_ucsc(vector) - return (temp<23) -} - -## -### -findCNs <- function(Log2,alf,allRegions,name=thisSubdir(),dmin=0.9,maxCn=10,ceiling=1,sampleInfo=NULL) { -## This function takes an estimate of the Log-R of copy number two (shift) and the difference in log-R between copy numbers 2 and 1 (delta) -## (3 and 2 works too). Then, the Log-R and Allelic Imbalance Ratio of all possible copy number variants up to maxCn are estimated from -## the Log-R and Allelic Imbalance Ratio of all the segments. This function will NOT be useful unless there is already a solid estimate -## of 'shift' and 'delta'. See the previous function. - - shift=sampleInfo$cn2 - delta=sampleInfo$delta - - tix=NULL #temporary index - int=NULL ## contains Log-R estimate of each (total) copy number - ai=NULL ## contains Allelic Imbalance Ratio estimate of each copy number variant. - regions <- allRegions$regions - regions <- regions[(is.autosome(regions$Chromosome)®ions$lengthMB>1)&(!is.na(regions$imba)),] ## will use these regions - - ## likely cn2 regions sit within delta/3 from shift. - expectedAt <- shift - tix$cn2 <- abs(regions$log2 - expectedAt) < (delta/3) ## index of likely cn2 regions - temp <- regions[tix$cn2,] ## cn2 regions - med <- weightedMedian(temp$log2,temp$probes) ## improved value of Log-R at cn2 (returns NULL if theres nothing there) - int$cn2 <- ifelse(!is.null(med),med,expectedAt) ## saved to int. - - ## likely cn1 regions sit at about cn2 - delta: - d <- delta ## the (Log-R) distance to cn1 - expectedAt <- int$cn2-d ## cn1 is expected here - tix$cn1 <- abs(regions$log2 - expectedAt) < (d/3) ## index of likely cn1 regions - temp <- regions[tix$cn1,] - med <- weightedMedian(temp$log2,temp$probes) - int$cn1 <- ifelse(!is.null(med),med,expectedAt) - - ## likely cn0 regions sit below cn1 - delta: - d <- int$cn2-int$cn1 - expectedAt <- int$cn1-d - tix$cn0 <- regions$log2 < expectedAt - temp <- regions[tix$cn0,] - med <- weightedMedian(temp$log2,temp$probes) - int$cn0 <- ifelse(!is.null(med),med,expectedAt) - - ## likely cn3 regions sit at about cn2+delta*dmin (dmin is about 0.9, the factor by which the distance between consecutive copy numbers diminish) - d <- delta*dmin - expectedAt <- int$cn2+d - tix$cn3 <- abs(regions$log2 - expectedAt) < (d/3) - temp <- regions[tix$cn3,] - med <- weightedMedian(temp$log2,temp$probes) - int$cn3 <- ifelse(!is.null(med),med,expectedAt) - - ## cn4 follows at ... - d <- dmin*(int$cn3-int$cn2) - expectedAt <- int$cn3+d - tix$cn4 <- abs(regions$log2 - expectedAt) < (d/4) - temp <- regions[tix$cn4,] - med <- weightedMedian(temp$log2,temp$probes) - int$cn4 <- ifelse(!is.null(med),med,expectedAt) - - ## generalized for higher cns - for (cn in 5:maxCn) { - thisCn <- paste('cn',cn,sep='') - prevCn <- paste('cn',cn-1,sep='') - pprevCn <- paste('cn',cn-2,sep='') - d <- dmin*(int[prevCn][[1]]-int[pprevCn][[1]]) - expectedAt <- int[prevCn][[1]]+d - tix[[thisCn]] <- abs(regions$log2 - expectedAt) < (d/5) - temp <- regions[tix[thisCn][[1]],] - med <- weightedMedian(temp$log2,temp$probes) - int[thisCn] <- ifelse(!is.null(med),med,expectedAt) - } - - - ## at cn2, find the variant clusters (normal and CNNLOH) - ix <- (abs(regions$log2 - int$cn2) < 0.2*(int$cn3-int$cn2) ) # taking only closely-matching segments - data <- regions[ix,] - data <- data[!is.na(data$imba),] # ...with a calculated allelic imbalance. - - ix <- (abs(regions$log2 - int$cn3) < 0.2*(int$cn4-int$cn3) ) - data3 <- regions[ix,] - data3 <- data[!is.na(data$imba),] - expectedAt <- 0.1 - ix <- data$imba Author: sebastian_d Date: 2013-06-19 11:09:55 +0200 (Wed, 19 Jun 2013) New Revision: 176 Modified: .git/COMMIT_EDITMSG .git/index .git/logs/HEAD .git/logs/refs/heads/master .git/logs/refs/remotes/origin/master .git/refs/heads/master .git/refs/remotes/origin/master pkg/TAPS/R/TAPS.r www/TAPS_inst.php Log: Fix for library loading in TAPS Modified: .git/COMMIT_EDITMSG =================================================================== --- .git/COMMIT_EDITMSG 2013-06-18 14:42:45 UTC (rev 175) +++ .git/COMMIT_EDITMSG 2013-06-19 09:09:55 UTC (rev 176) @@ -1 +1 @@ -Substantial changes to homepage which now incudes TAPS tutorial as well as some changes to TAPS +Fix for library loading in TAPS Modified: .git/index =================================================================== (Binary files differ) Modified: .git/logs/HEAD =================================================================== --- .git/logs/HEAD 2013-06-18 14:42:45 UTC (rev 175) +++ .git/logs/HEAD 2013-06-19 09:09:55 UTC (rev 176) @@ -47,3 +47,4 @@ 5eeba51632467a2cf6300bb53b26c98e0a03d735 b6c91dc80295b120969877f8e582708fb89038cc Sebastian DiLorenzo 1371462080 +0200 commit: some changes to TAPS b6c91dc80295b120969877f8e582708fb89038cc 532c860ab5cdbc3cbfd3537ef8fe60f35d4935de Sebastian DiLorenzo 1371462084 +0200 pull : Merge made by recursive. 532c860ab5cdbc3cbfd3537ef8fe60f35d4935de 8fa9d868a51e8b4bdee100d16c6219d2541df0a6 Sebastian DiLorenzo 1371566516 +0200 commit: Substantial changes to homepage which now incudes TAPS tutorial as well as some changes to TAPS +8fa9d868a51e8b4bdee100d16c6219d2541df0a6 49637041dfcf47c07ecaa49251071ba4e2ad377a Sebastian DiLorenzo 1371633024 +0200 commit: Fix for library loading in TAPS Modified: .git/logs/refs/heads/master =================================================================== --- .git/logs/refs/heads/master 2013-06-18 14:42:45 UTC (rev 175) +++ .git/logs/refs/heads/master 2013-06-19 09:09:55 UTC (rev 176) @@ -47,3 +47,4 @@ 5eeba51632467a2cf6300bb53b26c98e0a03d735 b6c91dc80295b120969877f8e582708fb89038cc Sebastian DiLorenzo 1371462080 +0200 commit: some changes to TAPS b6c91dc80295b120969877f8e582708fb89038cc 532c860ab5cdbc3cbfd3537ef8fe60f35d4935de Sebastian DiLorenzo 1371462084 +0200 pull : Merge made by recursive. 532c860ab5cdbc3cbfd3537ef8fe60f35d4935de 8fa9d868a51e8b4bdee100d16c6219d2541df0a6 Sebastian DiLorenzo 1371566516 +0200 commit: Substantial changes to homepage which now incudes TAPS tutorial as well as some changes to TAPS +8fa9d868a51e8b4bdee100d16c6219d2541df0a6 49637041dfcf47c07ecaa49251071ba4e2ad377a Sebastian DiLorenzo 1371633024 +0200 commit: Fix for library loading in TAPS Modified: .git/logs/refs/remotes/origin/master =================================================================== --- .git/logs/refs/remotes/origin/master 2013-06-18 14:42:45 UTC (rev 175) +++ .git/logs/refs/remotes/origin/master 2013-06-19 09:09:55 UTC (rev 176) @@ -45,3 +45,4 @@ cb78a64920a2a019a496e6ec35bd383e34b3dff7 5eeba51632467a2cf6300bb53b26c98e0a03d735 Sebastian DiLorenzo 1371209333 +0200 pull : fast-forward 5eeba51632467a2cf6300bb53b26c98e0a03d735 6eb4b7b50b8a1e1e97b2abc30404fa09d78e029e Sebastian DiLorenzo 1371461678 +0200 pull : fast-forward 6eb4b7b50b8a1e1e97b2abc30404fa09d78e029e 8fa9d868a51e8b4bdee100d16c6219d2541df0a6 Sebastian DiLorenzo 1371566540 +0200 update by push +8fa9d868a51e8b4bdee100d16c6219d2541df0a6 49637041dfcf47c07ecaa49251071ba4e2ad377a Sebastian DiLorenzo 1371633040 +0200 update by push Modified: .git/refs/heads/master =================================================================== --- .git/refs/heads/master 2013-06-18 14:42:45 UTC (rev 175) +++ .git/refs/heads/master 2013-06-19 09:09:55 UTC (rev 176) @@ -1 +1 @@ -8fa9d868a51e8b4bdee100d16c6219d2541df0a6 +49637041dfcf47c07ecaa49251071ba4e2ad377a Modified: .git/refs/remotes/origin/master =================================================================== --- .git/refs/remotes/origin/master 2013-06-18 14:42:45 UTC (rev 175) +++ .git/refs/remotes/origin/master 2013-06-19 09:09:55 UTC (rev 176) @@ -1 +1 @@ -8fa9d868a51e8b4bdee100d16c6219d2541df0a6 +49637041dfcf47c07ecaa49251071ba4e2ad377a Modified: pkg/TAPS/R/TAPS.r =================================================================== --- pkg/TAPS/R/TAPS.r 2013-06-18 14:42:45 UTC (rev 175) +++ pkg/TAPS/R/TAPS.r 2013-06-19 09:09:55 UTC (rev 176) @@ -13,9 +13,9 @@ #Load stats. It should be in all, at least semi-new, R distributions so we dont need to install.package it or #pre-install it #library(stats) - suppressPackageStartupMessages(library(stats,character.only=TRUE)) - suppressPackageStartupMessages(library(DNAcopy,character.only=TRUE)) - suppressPackageStartupMessages(library(fields,character.only=TRUE)) + suppressPackageStartupMessages(library(stats)) + suppressPackageStartupMessages(library(DNAcopy)) + suppressPackageStartupMessages(library(fields)) #list.of.packages <- c("stats", "fields") @@ -57,7 +57,7 @@ { ##read CYCHP file from ChAS with log-ratio info## ################################################ - suppressPackageStartupMessages(library(affxparser,character.only=TRUE)) + suppressPackageStartupMessages(library(affxparser)) name=list.files(".",pattern="*.cychp") temp=readCcg(name) Modified: www/TAPS_inst.php =================================================================== --- www/TAPS_inst.php 2013-06-18 14:42:45 UTC (rev 175) +++ www/TAPS_inst.php 2013-06-19 09:09:55 UTC (rev 176) @@ -29,7 +29,7 @@ install.packages("TAPS", repos="http://R-Forge.R-project.org",type="source") -If something still does not work with installation, here are links to the location of the source files:
+If something still does not work with installation, here is a link to the location of the source file:
TAPS
\ No newline at end of file From noreply at r-forge.r-project.org Mon Jun 24 14:07:53 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 24 Jun 2013 14:07:53 +0200 (CEST) Subject: [Patchwork-commits] r177 - www Message-ID: <20130624120753.88045184EDC@r-forge.r-project.org> Author: sebastian_d Date: 2013-06-24 14:07:52 +0200 (Mon, 24 Jun 2013) New Revision: 177 Modified: www/TAPS_exec.php www/TAPS_inst.php Log: Homepage added info on TAPS execution Modified: www/TAPS_exec.php =================================================================== --- www/TAPS_exec.php 2013-06-19 09:09:55 UTC (rev 176) +++ www/TAPS_exec.php 2013-06-24 12:07:52 UTC (rev 177) @@ -7,7 +7,7 @@

TAPS_plot()

TAPS_plot() is a function that visualizes allele-specific copy numbers from microarray -data of tumors. It can either be run in a directory containing multiple sample folder or +data of tumors. It can either be run in a directory containing multiple sample folders or pointing to a specific sample, which would quite simply be a folder containing no subfolders and ideally the files needed to execute.

@@ -48,12 +48,27 @@ The only thing TAPS_plot() needs is the directory argument. If, as mentioned above, you have -a folder containing several sample folders then specifying "directory" to that top folder -will execute all the sample subfolders. If you only have one sample folder then specifying -"directory" to that sample folder will execute it. Note that specifying any folder containing -subfolders will interpret the subfolders as the sample folders. +a folder containing several sample folders then specifying "directory" to that main folder +will execute all the sample subfolders. + +Main folder

+ +Specifying "directory" to a single sample folder will execute only that sample. For example +the folders Sample1 and Sample2.

+Nexus
+ Nexus +
+ChAS
+Chas +

+Note that specifying any folder containing subfolders will interpret the subfolders as the sample folders. +

+ Here is an example execution of TAPS_plot() using the current working directory, ".", as input and all the output left for display. The 6295 sample was processed from Nexus. TAPS_plot() processed sample 6295 completely then went into the next folder, "NonSampleFolder", which is not @@ -91,13 +106,13 @@

TAPS_call()

-The function TAPS_call() uses the relationship between logRatio +The function TAPS_call() uses the relationship between log-ratio and allelic imbalance to assign copy number and allele ratio for each segment.

TAPS_plot() must have been executed before TAPS_call() can be. This is because the .Rdata files -generated during TAPS_plot() will be automatically read by TAPS_call() and you need the plots -generated by TAPS_plot() to give TAPS_call() meaningful input. +generated during TAPS_plot() will be automatically read by TAPS_call() and you need to interpret the plots +generated by TAPS_plot() to be able to give TAPS_call() meaningful input.

TAPS_call() also has "directory" as its main argument, the parameters are read from the file @@ -106,7 +121,7 @@ for that sample to SampleData.txt and specify that sample using the "directory" argument of TAPS_call().

-An example run of TAPS_call(),where "mainsamplefolder" contains SampleData.txt:
+An example run of TAPS_call(), where "mainsamplefolder" contains SampleData.txt:
 	TAPS_call(directory="path/to/mainsamplefolder")

Modified: www/TAPS_inst.php
===================================================================
--- www/TAPS_inst.php	2013-06-19 09:09:55 UTC (rev 176)
+++ www/TAPS_inst.php	2013-06-24 12:07:52 UTC (rev 177)
@@ -3,7 +3,7 @@
 
 Begin by starting R. It is recommended that you use the latest version.
 

-Start by enabling all repositories in R so the dependencies of TAPS can be found.

+Enable all repositories in R so the dependencies of TAPS can be found.

     setRepositories()
@@ -16,7 +16,7 @@
     install.packages("fields")
 
-To install TAPS enter this command in R. +Install TAPS.

@@ -24,7 +24,7 @@ install.packages("TAPS", repos="http://R-Forge.R-project.org")
-If for some reason that does not work try installing it from source by adding 'type="source"' to the command. +If for some reason that does not work, try installing it from source by adding 'type="source"' to the command.
     install.packages("TAPS", repos="http://R-Forge.R-project.org",type="source")
 
From noreply at r-forge.r-project.org Mon Jun 24 14:33:06 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 24 Jun 2013 14:33:06 +0200 (CEST) Subject: [Patchwork-commits] r178 - .git .git/logs .git/logs/refs/heads .git/logs/refs/remotes/origin .git/refs/heads .git/refs/remotes/origin pkg/patchwork/R pkg/patchwork/inst/perl Message-ID: <20130624123306.8CDA3184DA2@r-forge.r-project.org> Author: sebastian_d Date: 2013-06-24 14:33:05 +0200 (Mon, 24 Jun 2013) New Revision: 178 Modified: .git/COMMIT_EDITMSG .git/index .git/logs/HEAD .git/logs/refs/heads/master .git/logs/refs/remotes/origin/master .git/refs/heads/master .git/refs/remotes/origin/master pkg/patchwork/R/patchwork.alleledata.r pkg/patchwork/inst/perl/mpile2alleles.pl Log: buggfix for mpilup and patchwork.alleledata Modified: .git/COMMIT_EDITMSG =================================================================== --- .git/COMMIT_EDITMSG 2013-06-24 12:07:52 UTC (rev 177) +++ .git/COMMIT_EDITMSG 2013-06-24 12:33:05 UTC (rev 178) @@ -1 +1 @@ -Fix for library loading in TAPS +buggfix for mpilup and patchwork.alleledata Modified: .git/index =================================================================== (Binary files differ) Modified: .git/logs/HEAD =================================================================== --- .git/logs/HEAD 2013-06-24 12:07:52 UTC (rev 177) +++ .git/logs/HEAD 2013-06-24 12:33:05 UTC (rev 178) @@ -48,3 +48,6 @@ b6c91dc80295b120969877f8e582708fb89038cc 532c860ab5cdbc3cbfd3537ef8fe60f35d4935de Sebastian DiLorenzo 1371462084 +0200 pull : Merge made by recursive. 532c860ab5cdbc3cbfd3537ef8fe60f35d4935de 8fa9d868a51e8b4bdee100d16c6219d2541df0a6 Sebastian DiLorenzo 1371566516 +0200 commit: Substantial changes to homepage which now incudes TAPS tutorial as well as some changes to TAPS 8fa9d868a51e8b4bdee100d16c6219d2541df0a6 49637041dfcf47c07ecaa49251071ba4e2ad377a Sebastian DiLorenzo 1371633024 +0200 commit: Fix for library loading in TAPS +49637041dfcf47c07ecaa49251071ba4e2ad377a 85bd8859e23a1fd9cc13dca12d161787786508c9 Sebastian DiLorenzo 1371644646 +0200 commit: hopefully fixes to mpile2alleles +85bd8859e23a1fd9cc13dca12d161787786508c9 86dcc04de9d77c535ad155fdfd870ee62c5e9cd4 Sebastian DiLorenzo 1371719448 +0200 commit: Another fix to mpileup. Time for a QA +86dcc04de9d77c535ad155fdfd870ee62c5e9cd4 5a0091d4eaca40691cb6bc59d83f9d1ab55f8566 Sebastian DiLorenzo 1372076903 +0200 commit: small change to alleledata to fix HG check. Modified: .git/logs/refs/heads/master =================================================================== --- .git/logs/refs/heads/master 2013-06-24 12:07:52 UTC (rev 177) +++ .git/logs/refs/heads/master 2013-06-24 12:33:05 UTC (rev 178) @@ -48,3 +48,6 @@ b6c91dc80295b120969877f8e582708fb89038cc 532c860ab5cdbc3cbfd3537ef8fe60f35d4935de Sebastian DiLorenzo 1371462084 +0200 pull : Merge made by recursive. 532c860ab5cdbc3cbfd3537ef8fe60f35d4935de 8fa9d868a51e8b4bdee100d16c6219d2541df0a6 Sebastian DiLorenzo 1371566516 +0200 commit: Substantial changes to homepage which now incudes TAPS tutorial as well as some changes to TAPS 8fa9d868a51e8b4bdee100d16c6219d2541df0a6 49637041dfcf47c07ecaa49251071ba4e2ad377a Sebastian DiLorenzo 1371633024 +0200 commit: Fix for library loading in TAPS +49637041dfcf47c07ecaa49251071ba4e2ad377a 85bd8859e23a1fd9cc13dca12d161787786508c9 Sebastian DiLorenzo 1371644646 +0200 commit: hopefully fixes to mpile2alleles +85bd8859e23a1fd9cc13dca12d161787786508c9 86dcc04de9d77c535ad155fdfd870ee62c5e9cd4 Sebastian DiLorenzo 1371719448 +0200 commit: Another fix to mpileup. Time for a QA +86dcc04de9d77c535ad155fdfd870ee62c5e9cd4 5a0091d4eaca40691cb6bc59d83f9d1ab55f8566 Sebastian DiLorenzo 1372076903 +0200 commit: small change to alleledata to fix HG check. Modified: .git/logs/refs/remotes/origin/master =================================================================== --- .git/logs/refs/remotes/origin/master 2013-06-24 12:07:52 UTC (rev 177) +++ .git/logs/refs/remotes/origin/master 2013-06-24 12:33:05 UTC (rev 178) @@ -46,3 +46,6 @@ 5eeba51632467a2cf6300bb53b26c98e0a03d735 6eb4b7b50b8a1e1e97b2abc30404fa09d78e029e Sebastian DiLorenzo 1371461678 +0200 pull : fast-forward 6eb4b7b50b8a1e1e97b2abc30404fa09d78e029e 8fa9d868a51e8b4bdee100d16c6219d2541df0a6 Sebastian DiLorenzo 1371566540 +0200 update by push 8fa9d868a51e8b4bdee100d16c6219d2541df0a6 49637041dfcf47c07ecaa49251071ba4e2ad377a Sebastian DiLorenzo 1371633040 +0200 update by push +49637041dfcf47c07ecaa49251071ba4e2ad377a 85bd8859e23a1fd9cc13dca12d161787786508c9 Sebastian DiLorenzo 1371644659 +0200 update by push +85bd8859e23a1fd9cc13dca12d161787786508c9 86dcc04de9d77c535ad155fdfd870ee62c5e9cd4 Sebastian DiLorenzo 1371719471 +0200 update by push +86dcc04de9d77c535ad155fdfd870ee62c5e9cd4 5a0091d4eaca40691cb6bc59d83f9d1ab55f8566 Sebastian DiLorenzo 1372076931 +0200 update by push Modified: .git/refs/heads/master =================================================================== --- .git/refs/heads/master 2013-06-24 12:07:52 UTC (rev 177) +++ .git/refs/heads/master 2013-06-24 12:33:05 UTC (rev 178) @@ -1 +1 @@ -49637041dfcf47c07ecaa49251071ba4e2ad377a +5a0091d4eaca40691cb6bc59d83f9d1ab55f8566 Modified: .git/refs/remotes/origin/master =================================================================== --- .git/refs/remotes/origin/master 2013-06-24 12:07:52 UTC (rev 177) +++ .git/refs/remotes/origin/master 2013-06-24 12:33:05 UTC (rev 178) @@ -1 +1 @@ -49637041dfcf47c07ecaa49251071ba4e2ad377a +5a0091d4eaca40691cb6bc59d83f9d1ab55f8566 Modified: pkg/patchwork/R/patchwork.alleledata.r =================================================================== --- pkg/patchwork/R/patchwork.alleledata.r 2013-06-24 12:07:52 UTC (rev 177) +++ pkg/patchwork/R/patchwork.alleledata.r 2013-06-24 12:33:05 UTC (rev 178) @@ -74,7 +74,8 @@ hgcheck = strsplit(line,"\t") #Sometimes chr1 isnt first in the pileup file, traverse until you get to chr1 to see if hg18 or hg19 should be applied. - while((hgcheck[[1]][1] != "chr1") || (hgcheck[[1]][1] != "1")) + #while hgcheck is not "chr1" AND not "1" + while((hgcheck[[1]][1] != "chr1") && (hgcheck[[1]][1] != "1")) { line = readLines(con,1) hgcheck = strsplit(line,"\t") Modified: pkg/patchwork/inst/perl/mpile2alleles.pl =================================================================== --- pkg/patchwork/inst/perl/mpile2alleles.pl 2013-06-24 12:07:52 UTC (rev 177) +++ pkg/patchwork/inst/perl/mpile2alleles.pl 2013-06-24 12:33:05 UTC (rev 178) @@ -14,6 +14,12 @@ open(PILEUP,$ARGV[0]) or die "Could not read from $ARGV[0] , stopping."; open(VCF,$ARGV[1]) or die "Could not read from $ARGV[1] , stopping."; +#For testing purposes +#OUT shows faulty lines and the values they are given +#OK shows a bunch of OK lines to compare too. +# open(OUT,">out.txt"); +# open(OK,">OK.txt"); + my %snps; my %iupac; $iupac{'A'}{'R'} = 'G'; @@ -41,30 +47,67 @@ $iupac{'T'}{'S'} = 'G|C'; $iupac{'T'}{'M'} = 'A|C'; +#For testing purposes +# my $i = 0; +# my $j = 0; +#perl mpile2alleles.pl SRR389821.mpileup SRR389821.vcf > test.out + while () { chomp; next if /^#/; my ($vchr, $vpos, $cons, $consQual) = (split /\t/, $_)[0,1,4,5]; + next if $cons eq 'N'; + next if length $cons > 1; + $cons = uc $cons; + while () { chomp; my ($chr, $pos, $ref, $depth, $baseString) = (split /\t/, $_)[0,1,2,3,4]; + #For testing purposes + # $j++; + + #uc upper case + $ref = uc $ref; + next if $ref eq '*'; + #If the position and chromosome match between pileup and vcf # add if smaller than if ($vchr eq $chr && $vpos == $pos) { - $ref = uc $ref; - next if $ref eq '*'; - next if $cons eq 'N'; my $snp = ($cons =~ m/[AGCT]/) ? $cons : $iupac{$ref}{$cons}; $snps{$chr}{$pos}{'ref'} = $ref; $snps{$chr}{$pos}{'snp'} = $snp; $snps{$chr}{$pos}{'qual'} = $consQual; + # #For testing purposes + # $j == the faulty line number so we can see what is actually happening there + # if($j == 576673 || $j == 683784 || $j == 733447) + # { + # print OUT "Line: $. \n"; + # print OUT "VCF: $vchr $vpos $cons $consQual \n"; + # print OUT "PILEUP: $chr $pos $ref $depth $baseString \n"; + # print OUT "snp: $snp \n"; + # print OUT "assigned: $snps{$chr}{$pos}{'snp'} \n"; + # $i++; + # } + + # print OK "Line: $. \n"; + # print OK "VCF: $vchr $vpos $cons $consQual \n"; + # print OK "PILEUP: $chr $pos $ref $depth $baseString \n"; + # print OK "snp: $snp \n"; + # print OK "assigned: $snps{$chr}{$pos}{'snp'} \n"; + + # if ($i == 3) + # { + # close(OUT); + # close(OK); + # } + my $snpCount; if ($snps{$chr}{$pos}{'snp'} eq 'A') { $snpCount = $baseString =~ tr/Aa/Aa/; From noreply at r-forge.r-project.org Tue Jun 25 14:16:17 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 25 Jun 2013 14:16:17 +0200 (CEST) Subject: [Patchwork-commits] r179 - .git .git/logs .git/logs/refs/heads .git/logs/refs/remotes/origin .git/refs/heads .git/refs/remotes/origin pkg/TAPS/R www/css/img Message-ID: <20130625121618.26F3F1851F6@r-forge.r-project.org> Author: sebastian_d Date: 2013-06-25 14:16:16 +0200 (Tue, 25 Jun 2013) New Revision: 179 Added: www/css/img/Chas.png www/css/img/Main_folder.png www/css/img/Nexus.png Modified: .git/COMMIT_EDITMSG .git/index .git/logs/HEAD .git/logs/refs/heads/master .git/logs/refs/remotes/origin/master .git/refs/heads/master .git/refs/remotes/origin/master pkg/TAPS/R/TAPS.r Log: Add some picture files for taps that i forgot Modified: .git/COMMIT_EDITMSG =================================================================== --- .git/COMMIT_EDITMSG 2013-06-24 12:33:05 UTC (rev 178) +++ .git/COMMIT_EDITMSG 2013-06-25 12:16:16 UTC (rev 179) @@ -1 +1 @@ -buggfix for mpilup and patchwork.alleledata +added some images that i forgot Modified: .git/index =================================================================== (Binary files differ) Modified: .git/logs/HEAD =================================================================== --- .git/logs/HEAD 2013-06-24 12:33:05 UTC (rev 178) +++ .git/logs/HEAD 2013-06-25 12:16:16 UTC (rev 179) @@ -51,3 +51,5 @@ 49637041dfcf47c07ecaa49251071ba4e2ad377a 85bd8859e23a1fd9cc13dca12d161787786508c9 Sebastian DiLorenzo 1371644646 +0200 commit: hopefully fixes to mpile2alleles 85bd8859e23a1fd9cc13dca12d161787786508c9 86dcc04de9d77c535ad155fdfd870ee62c5e9cd4 Sebastian DiLorenzo 1371719448 +0200 commit: Another fix to mpileup. Time for a QA 86dcc04de9d77c535ad155fdfd870ee62c5e9cd4 5a0091d4eaca40691cb6bc59d83f9d1ab55f8566 Sebastian DiLorenzo 1372076903 +0200 commit: small change to alleledata to fix HG check. +5a0091d4eaca40691cb6bc59d83f9d1ab55f8566 998b2f7c44be9ba4a1a31c630143e4f755bf3b32 Sebastian DiLorenzo 1372162569 +0200 commit: added some images that i forgot +998b2f7c44be9ba4a1a31c630143e4f755bf3b32 e557c8daaad5d3fba321242275706fa9e3138286 Sebastian DiLorenzo 1372162589 +0200 pull : Merge made by recursive. Modified: .git/logs/refs/heads/master =================================================================== --- .git/logs/refs/heads/master 2013-06-24 12:33:05 UTC (rev 178) +++ .git/logs/refs/heads/master 2013-06-25 12:16:16 UTC (rev 179) @@ -51,3 +51,5 @@ 49637041dfcf47c07ecaa49251071ba4e2ad377a 85bd8859e23a1fd9cc13dca12d161787786508c9 Sebastian DiLorenzo 1371644646 +0200 commit: hopefully fixes to mpile2alleles 85bd8859e23a1fd9cc13dca12d161787786508c9 86dcc04de9d77c535ad155fdfd870ee62c5e9cd4 Sebastian DiLorenzo 1371719448 +0200 commit: Another fix to mpileup. Time for a QA 86dcc04de9d77c535ad155fdfd870ee62c5e9cd4 5a0091d4eaca40691cb6bc59d83f9d1ab55f8566 Sebastian DiLorenzo 1372076903 +0200 commit: small change to alleledata to fix HG check. +5a0091d4eaca40691cb6bc59d83f9d1ab55f8566 998b2f7c44be9ba4a1a31c630143e4f755bf3b32 Sebastian DiLorenzo 1372162569 +0200 commit: added some images that i forgot +998b2f7c44be9ba4a1a31c630143e4f755bf3b32 e557c8daaad5d3fba321242275706fa9e3138286 Sebastian DiLorenzo 1372162589 +0200 pull : Merge made by recursive. Modified: .git/logs/refs/remotes/origin/master =================================================================== --- .git/logs/refs/remotes/origin/master 2013-06-24 12:33:05 UTC (rev 178) +++ .git/logs/refs/remotes/origin/master 2013-06-25 12:16:16 UTC (rev 179) @@ -49,3 +49,5 @@ 49637041dfcf47c07ecaa49251071ba4e2ad377a 85bd8859e23a1fd9cc13dca12d161787786508c9 Sebastian DiLorenzo 1371644659 +0200 update by push 85bd8859e23a1fd9cc13dca12d161787786508c9 86dcc04de9d77c535ad155fdfd870ee62c5e9cd4 Sebastian DiLorenzo 1371719471 +0200 update by push 86dcc04de9d77c535ad155fdfd870ee62c5e9cd4 5a0091d4eaca40691cb6bc59d83f9d1ab55f8566 Sebastian DiLorenzo 1372076931 +0200 update by push +5a0091d4eaca40691cb6bc59d83f9d1ab55f8566 d638a39e4e15a398cf8459744395a830bbd12287 Sebastian DiLorenzo 1372162589 +0200 pull : fast-forward +d638a39e4e15a398cf8459744395a830bbd12287 e557c8daaad5d3fba321242275706fa9e3138286 Sebastian DiLorenzo 1372162603 +0200 update by push Modified: .git/refs/heads/master =================================================================== --- .git/refs/heads/master 2013-06-24 12:33:05 UTC (rev 178) +++ .git/refs/heads/master 2013-06-25 12:16:16 UTC (rev 179) @@ -1 +1 @@ -5a0091d4eaca40691cb6bc59d83f9d1ab55f8566 +e557c8daaad5d3fba321242275706fa9e3138286 Modified: .git/refs/remotes/origin/master =================================================================== --- .git/refs/remotes/origin/master 2013-06-24 12:33:05 UTC (rev 178) +++ .git/refs/remotes/origin/master 2013-06-25 12:16:16 UTC (rev 179) @@ -1 +1 @@ -5a0091d4eaca40691cb6bc59d83f9d1ab55f8566 +e557c8daaad5d3fba321242275706fa9e3138286 Modified: pkg/TAPS/R/TAPS.r =================================================================== --- pkg/TAPS/R/TAPS.r 2013-06-24 12:33:05 UTC (rev 178) +++ pkg/TAPS/R/TAPS.r 2013-06-25 12:16:16 UTC (rev 179) @@ -140,10 +140,10 @@ segments$Value <- segments$Value-median(Log2$Value) ## Median-centering Log2$Value <- Log2$Value-median(Log2$Value) ## Median-centering - allRegions=NULL; #try(load('allRegions.Rdata'),silent=T) + allRegions=NULL; try(load('allRegions.Rdata'),silent=T) if (is.null(allRegions)) allRegions <- makeRegions(Log2, alf, segments) ## Calculates necessary data for segments (all functions are in this file) save(allRegions,file='allRegions.Rdata') - regs=NULL; #try(load('shortRegions.Rdata'),silent=T) + regs=NULL; try(load('shortRegions.Rdata'),silent=T) if (is.null(regs)) { regs <- regsFromSegs(Log2,alf,segments,bin=bin,min=5) ## Calculates the same data for shortened segments save(regs,file='shortRegions.Rdata') @@ -151,7 +151,8 @@ ## Sample QC sampleData$MAPD[i] <- MAPD <- round(median(abs(diff(Log2$Value[Log2$Chromosome=='chr1'][order(Log2$Start[Log2$Chromosome=='chr1'])]))),2) - sampleData$MHOF[i] <- MHOF <- round(100*median(0.5+regs$hom[regs$scores<0.5],na.rm=T),1) + sampleData$MHOF[i] <- MHOF <- round(100*median(0.5+abs(0.5-alf$Value)),1) + #round(100*median(0.5+regs$hom[regs$scores<0.5],na.rm=T),1) #MAID=round(median(abs(diff(regs$scores[!is.na(regs$scores)]))),3) #Save for TAPS_region() @@ -1606,7 +1607,6 @@ #size[length>10000000]=0.8 #Define the name,dimensions and resolution of the plot. - #pdf(paste(name,'_overview.pdf',sep=''),paper="a4r")#,width=11.7,height=8.3) #Vectorized pdf did not work well for RAM. jpeg(paste(name,'_overview.jpg',sep=''),width=11.7,height=8.3,units="in",res=300) #split the plot into desired formation Added: www/css/img/Chas.png =================================================================== (Binary files differ) Property changes on: www/css/img/Chas.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: www/css/img/Main_folder.png =================================================================== (Binary files differ) Property changes on: www/css/img/Main_folder.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: www/css/img/Nexus.png =================================================================== (Binary files differ) Property changes on: www/css/img/Nexus.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream From noreply at r-forge.r-project.org Tue Jun 25 15:00:50 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 25 Jun 2013 15:00:50 +0200 (CEST) Subject: [Patchwork-commits] r180 - pkg/patchwork/R Message-ID: <20130625130050.708F2184511@r-forge.r-project.org> Author: sebastian_d Date: 2013-06-25 15:00:49 +0200 (Tue, 25 Jun 2013) New Revision: 180 Modified: pkg/patchwork/R/patchwork.Medians_n_AI.r Log: small fix (hopefully) removing medians that have been set to NA Modified: pkg/patchwork/R/patchwork.Medians_n_AI.r =================================================================== --- pkg/patchwork/R/patchwork.Medians_n_AI.r 2013-06-25 12:16:16 UTC (rev 179) +++ pkg/patchwork/R/patchwork.Medians_n_AI.r 2013-06-25 13:00:49 UTC (rev 180) @@ -5,7 +5,7 @@ for (i in 1:nrow(segs)) { ix = kbsegs$chr==as.character(segs$chr[i]) & ( kbsegs$pos > segs$start[i] & kbsegs$pos < segs$end[i] ) - segs$median[i] = median(kbsegs$ratio[ix]) + segs$median[i] = median(kbsegs$ratio[ix],na.rm=T) ix2 = alf$achr==as.character(segs$chr[i]) & ( alf$apos > segs$start[i] & alf$apos < segs$end[i] ) segs$snvs[i] = sum(ix2) From noreply at r-forge.r-project.org Thu Jun 27 17:17:23 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 27 Jun 2013 17:17:23 +0200 (CEST) Subject: [Patchwork-commits] r181 - .git .git/logs .git/logs/refs/heads .git/logs/refs/remotes/origin .git/refs/heads .git/refs/remotes/origin pkg/patchwork pkg/patchwork/R www Message-ID: <20130627151723.B3FB0185926@r-forge.r-project.org> Author: sebastian_d Date: 2013-06-27 17:17:23 +0200 (Thu, 27 Jun 2013) New Revision: 181 Modified: .git/COMMIT_EDITMSG .git/index .git/logs/HEAD .git/logs/refs/heads/master .git/logs/refs/remotes/origin/master .git/refs/heads/master .git/refs/remotes/origin/master pkg/patchwork/DESCRIPTION pkg/patchwork/R/patchwork.plot.r pkg/patchwork/R/patchwork.readChroms.r pkg/patchwork/R/patchwork.segment.r www/TAPS_requ.php www/changelog.php www/pw_inst.php Log: Update regarding pysam and pysam information on homepage Modified: .git/COMMIT_EDITMSG =================================================================== --- .git/COMMIT_EDITMSG 2013-06-25 13:00:49 UTC (rev 180) +++ .git/COMMIT_EDITMSG 2013-06-27 15:17:23 UTC (rev 181) @@ -1 +1 @@ -added some images that i forgot +Move pysam out of package Modified: .git/index =================================================================== (Binary files differ) Modified: .git/logs/HEAD =================================================================== --- .git/logs/HEAD 2013-06-25 13:00:49 UTC (rev 180) +++ .git/logs/HEAD 2013-06-27 15:17:23 UTC (rev 181) @@ -53,3 +53,6 @@ 86dcc04de9d77c535ad155fdfd870ee62c5e9cd4 5a0091d4eaca40691cb6bc59d83f9d1ab55f8566 Sebastian DiLorenzo 1372076903 +0200 commit: small change to alleledata to fix HG check. 5a0091d4eaca40691cb6bc59d83f9d1ab55f8566 998b2f7c44be9ba4a1a31c630143e4f755bf3b32 Sebastian DiLorenzo 1372162569 +0200 commit: added some images that i forgot 998b2f7c44be9ba4a1a31c630143e4f755bf3b32 e557c8daaad5d3fba321242275706fa9e3138286 Sebastian DiLorenzo 1372162589 +0200 pull : Merge made by recursive. +e557c8daaad5d3fba321242275706fa9e3138286 c8a8af10a9f5c2312766cbebef91ffa9126061e5 Sebastian DiLorenzo 1372165351 +0200 commit: small fix (hopefully) removing medians that have been set to NA +c8a8af10a9f5c2312766cbebef91ffa9126061e5 5a2afd158f70d21ed8bf6a45f61a19dbbb6b79c2 Sebastian DiLorenzo 1372169352 +0200 commit: deleting pysam to upgrade and test newer version +5a2afd158f70d21ed8bf6a45f61a19dbbb6b79c2 c08551d489e8bc28692c600dfffa7e7d4cb37ca5 Sebastian DiLorenzo 1372256038 +0200 commit: Move pysam out of package Modified: .git/logs/refs/heads/master =================================================================== --- .git/logs/refs/heads/master 2013-06-25 13:00:49 UTC (rev 180) +++ .git/logs/refs/heads/master 2013-06-27 15:17:23 UTC (rev 181) @@ -53,3 +53,6 @@ 86dcc04de9d77c535ad155fdfd870ee62c5e9cd4 5a0091d4eaca40691cb6bc59d83f9d1ab55f8566 Sebastian DiLorenzo 1372076903 +0200 commit: small change to alleledata to fix HG check. 5a0091d4eaca40691cb6bc59d83f9d1ab55f8566 998b2f7c44be9ba4a1a31c630143e4f755bf3b32 Sebastian DiLorenzo 1372162569 +0200 commit: added some images that i forgot 998b2f7c44be9ba4a1a31c630143e4f755bf3b32 e557c8daaad5d3fba321242275706fa9e3138286 Sebastian DiLorenzo 1372162589 +0200 pull : Merge made by recursive. +e557c8daaad5d3fba321242275706fa9e3138286 c8a8af10a9f5c2312766cbebef91ffa9126061e5 Sebastian DiLorenzo 1372165351 +0200 commit: small fix (hopefully) removing medians that have been set to NA +c8a8af10a9f5c2312766cbebef91ffa9126061e5 5a2afd158f70d21ed8bf6a45f61a19dbbb6b79c2 Sebastian DiLorenzo 1372169352 +0200 commit: deleting pysam to upgrade and test newer version +5a2afd158f70d21ed8bf6a45f61a19dbbb6b79c2 c08551d489e8bc28692c600dfffa7e7d4cb37ca5 Sebastian DiLorenzo 1372256038 +0200 commit: Move pysam out of package Modified: .git/logs/refs/remotes/origin/master =================================================================== --- .git/logs/refs/remotes/origin/master 2013-06-25 13:00:49 UTC (rev 180) +++ .git/logs/refs/remotes/origin/master 2013-06-27 15:17:23 UTC (rev 181) @@ -51,3 +51,6 @@ 86dcc04de9d77c535ad155fdfd870ee62c5e9cd4 5a0091d4eaca40691cb6bc59d83f9d1ab55f8566 Sebastian DiLorenzo 1372076931 +0200 update by push 5a0091d4eaca40691cb6bc59d83f9d1ab55f8566 d638a39e4e15a398cf8459744395a830bbd12287 Sebastian DiLorenzo 1372162589 +0200 pull : fast-forward d638a39e4e15a398cf8459744395a830bbd12287 e557c8daaad5d3fba321242275706fa9e3138286 Sebastian DiLorenzo 1372162603 +0200 update by push +e557c8daaad5d3fba321242275706fa9e3138286 c8a8af10a9f5c2312766cbebef91ffa9126061e5 Sebastian DiLorenzo 1372165363 +0200 update by push +c8a8af10a9f5c2312766cbebef91ffa9126061e5 5a2afd158f70d21ed8bf6a45f61a19dbbb6b79c2 Sebastian DiLorenzo 1372169371 +0200 update by push +5a2afd158f70d21ed8bf6a45f61a19dbbb6b79c2 c08551d489e8bc28692c600dfffa7e7d4cb37ca5 Sebastian DiLorenzo 1372256058 +0200 update by push Modified: .git/refs/heads/master =================================================================== --- .git/refs/heads/master 2013-06-25 13:00:49 UTC (rev 180) +++ .git/refs/heads/master 2013-06-27 15:17:23 UTC (rev 181) @@ -1 +1 @@ -e557c8daaad5d3fba321242275706fa9e3138286 +c08551d489e8bc28692c600dfffa7e7d4cb37ca5 Modified: .git/refs/remotes/origin/master =================================================================== --- .git/refs/remotes/origin/master 2013-06-25 13:00:49 UTC (rev 180) +++ .git/refs/remotes/origin/master 2013-06-27 15:17:23 UTC (rev 181) @@ -1 +1 @@ -e557c8daaad5d3fba321242275706fa9e3138286 +c08551d489e8bc28692c600dfffa7e7d4cb37ca5 Modified: pkg/patchwork/DESCRIPTION =================================================================== --- pkg/patchwork/DESCRIPTION 2013-06-25 13:00:49 UTC (rev 180) +++ pkg/patchwork/DESCRIPTION 2013-06-27 15:17:23 UTC (rev 181) @@ -1,11 +1,11 @@ Package: patchwork Type: Package Title: Allele-specific Copy Number Analysis of whole genome data -Version: 2.2 +Version: 2.3 Date: 2012-30-08 Author: Markus Mayrhofer, Sebastian DiLorenzo Maintainer: Markus Mayrhofer Description: Performs a allele-specific copy number analysis of whole genome data. License: GPL-2 #Imports: patchworkData -#Depends: DNAcopy +Suggests: DNAcopy Modified: pkg/patchwork/R/patchwork.plot.r =================================================================== --- pkg/patchwork/R/patchwork.plot.r 2013-06-25 13:00:49 UTC (rev 180) +++ pkg/patchwork/R/patchwork.plot.r 2013-06-27 15:17:23 UTC (rev 181) @@ -159,7 +159,7 @@ } #Segment the data. - library(DNAcopy) + #library(DNAcopy) segs = NULL try( load(paste(name,"_Segments.Rdata",sep="")), silent=TRUE ) if(length(segs) == 0) Modified: pkg/patchwork/R/patchwork.readChroms.r =================================================================== --- pkg/patchwork/R/patchwork.readChroms.r 2013-06-25 13:00:49 UTC (rev 180) +++ pkg/patchwork/R/patchwork.readChroms.r 2013-06-27 15:17:23 UTC (rev 181) @@ -26,22 +26,22 @@ system(paste("cp -r ",packagepath,"/python .python",sep="")) #If import pysam doesnt work, ie pysam isnt installed yet, we install pysam. - if (system(paste("python ",getwd(),"/.python/Check.py",sep=""),intern=T) == "Pysam Not Available") - { - setwd(".python") - cat("Pysam has not yet been installed on your system. \n Attempting to Build \n") - system("sleep 5") - # build pysam - system("python setup.py build > pysam_build_output.txt") - system("cp pysam_build_output.txt ..") - cat("Build complete. Output of build can be viewed in file pysam_build_output.txt. - \n Attempting to Install \n") - # install pysam to site.USER_BASE - system("python setup.py install --user > pysam_install_output.txt") - system("cp pysam_install_output.txt ..") - cat("Install complete. Output of install can be viewed in file pysam_install_output.txt. \n") - setwd("..") - } + # if (system(paste("python ",getwd(),"/.python/Check.py",sep=""),intern=T) == "Pysam Not Available") + # { + # setwd(".python") + # cat("Pysam has not yet been installed on your system. \n Attempting to Build \n") + # system("sleep 5") + # # build pysam + # system("python setup.py build > pysam_build_output.txt") + # system("cp pysam_build_output.txt ..") + # cat("Build complete. Output of build can be viewed in file pysam_build_output.txt. + # \n Attempting to Install \n") + # # install pysam to site.USER_BASE + # system("python setup.py install --user > pysam_install_output.txt") + # system("cp pysam_install_output.txt ..") + # cat("Install complete. Output of install can be viewed in file pysam_install_output.txt. \n") + # setwd("..") + # } readlength=80 # this is currently hard coded and may be adjusted. seglength=200 # (do not change) Modified: pkg/patchwork/R/patchwork.segment.r =================================================================== --- pkg/patchwork/R/patchwork.segment.r 2013-06-25 13:00:49 UTC (rev 180) +++ pkg/patchwork/R/patchwork.segment.r 2013-06-27 15:17:23 UTC (rev 181) @@ -1,6 +1,6 @@ patchwork.segment <- function(kbsegs,chroms,Alpha,SD) { - #library(DNAcopy) + library(DNAcopy) #Load data included in package #packagepath = system.file(package="patchwork") #load(paste(packagepath,"/data/commonSnps132.RData",sep="")) Modified: www/TAPS_requ.php =================================================================== --- www/TAPS_requ.php 2013-06-25 13:00:49 UTC (rev 180) +++ www/TAPS_requ.php 2013-06-27 15:17:23 UTC (rev 181) @@ -13,8 +13,8 @@ Using Nexus has the benefit of being able to use their segmentation which reduces running time of TAPS.

-If you have used Nexus, locate the samples folder, which is what TAPS takes as input. It should -contain the files "probes.txt", "snps.txt" and "segments.txt". +If you have used Nexus, use "File -> Utilities -> Export from .ivg to.txt" to create "probes.txt", + "snps.txt" and "segments.txt". These should be in a sample folder, which is what TAPS takes as input.

If you have used ChAS, load the file ending in "cyhd.cychp" into ChAS and create the text file ending in "cyhd.txt" Modified: www/changelog.php =================================================================== --- www/changelog.php 2013-06-25 13:00:49 UTC (rev 180) +++ www/changelog.php 2013-06-27 15:17:23 UTC (rev 181) @@ -10,11 +10,19 @@
patchwork v2.3 -
2013
    -
  • Update the version of Pysam that Patchwork uses for general compatibility
  • - fixes to mpileup reading - improvements in all the plots for patchwork, including cytoband information +
  • Moved Pysam out of package due to auto-install issues. Now you will have to manually install it. + See Patchwork -> Installation
--> +
+ +
patchwork v2.3 -
+
2013
+
    +
  • Moved Pysam out of package due to auto-install issues. Now you will have to manually install it. + See Patchwork -> Installation
  • +
+
patchwork / TAPS -
Modified: www/pw_inst.php =================================================================== --- www/pw_inst.php 2013-06-25 13:00:49 UTC (rev 180) +++ www/pw_inst.php 2013-06-27 15:17:23 UTC (rev 181) @@ -45,10 +45,15 @@

Python and Pysam

-Patchwork uses a python mod called pysam for "reading" the chromosomes. The package already checks if you have + + +Patchwork uses a python mod called pysam for "reading" the chromosomes.
Currently +Pysam 0.7.4 +and +Python 2.6.7 and 2.7.1 +are tested and supported. From noreply at r-forge.r-project.org Thu Jun 27 17:25:21 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 27 Jun 2013 17:25:21 +0200 (CEST) Subject: [Patchwork-commits] r182 - pkg/patchwork/inst Message-ID: <20130627152521.7E97D1858BD@r-forge.r-project.org> Author: sebastian_d Date: 2013-06-27 17:25:21 +0200 (Thu, 27 Jun 2013) New Revision: 182 Removed: pkg/patchwork/inst/python/ Log: removing python to fix From noreply at r-forge.r-project.org Thu Jun 27 17:25:53 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 27 Jun 2013 17:25:53 +0200 (CEST) Subject: [Patchwork-commits] r183 - in pkg/patchwork/inst: . python Message-ID: <20130627152553.2A3F21858BD@r-forge.r-project.org> Author: sebastian_d Date: 2013-06-27 17:25:52 +0200 (Thu, 27 Jun 2013) New Revision: 183 Added: pkg/patchwork/inst/python/ pkg/patchwork/inst/python/Pysamloader.py Log: adding pythong again Added: pkg/patchwork/inst/python/Pysamloader.py =================================================================== --- pkg/patchwork/inst/python/Pysamloader.py (rev 0) +++ pkg/patchwork/inst/python/Pysamloader.py 2013-06-27 15:25:52 UTC (rev 183) @@ -0,0 +1,26 @@ +import sys +import re +import os + +import pysam + +filename = sys.argv[1] + +try: + infile = pysam.Samfile(sys.argv[1],"rb") +except IOError,eStr: + print "Error:Cannot open ",filename," for reading: ", eStr + sys.exit() + +outfile = open(".Tmp_chr_pos","w") + +try: + for read in infile.fetch(sys.argv[2]): + outfile.write(str(read.pos) + "\n") +except: + a = re.split('chr',sys.argv[2]) + for read in infile.fetch(a[1]): + outfile.write(str(read.pos) + "\n") + +infile.close() +outfile.close() From noreply at r-forge.r-project.org Thu Jun 27 17:43:17 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 27 Jun 2013 17:43:17 +0200 (CEST) Subject: [Patchwork-commits] r184 - in .git: . logs logs/refs/heads logs/refs/remotes/origin refs/heads refs/remotes/origin Message-ID: <20130627154317.D0CC61856CF@r-forge.r-project.org> Author: sebastian_d Date: 2013-06-27 17:43:17 +0200 (Thu, 27 Jun 2013) New Revision: 184 Modified: .git/COMMIT_EDITMSG .git/index .git/logs/HEAD .git/logs/refs/heads/master .git/logs/refs/remotes/origin/master .git/refs/heads/master .git/refs/remotes/origin/master Log: commit Modified: .git/COMMIT_EDITMSG =================================================================== --- .git/COMMIT_EDITMSG 2013-06-27 15:25:52 UTC (rev 183) +++ .git/COMMIT_EDITMSG 2013-06-27 15:43:17 UTC (rev 184) @@ -1 +1 @@ -Move pysam out of package +homepage info update pysam Modified: .git/index =================================================================== (Binary files differ) Modified: .git/logs/HEAD =================================================================== --- .git/logs/HEAD 2013-06-27 15:25:52 UTC (rev 183) +++ .git/logs/HEAD 2013-06-27 15:43:17 UTC (rev 184) @@ -56,3 +56,4 @@ e557c8daaad5d3fba321242275706fa9e3138286 c8a8af10a9f5c2312766cbebef91ffa9126061e5 Sebastian DiLorenzo 1372165351 +0200 commit: small fix (hopefully) removing medians that have been set to NA c8a8af10a9f5c2312766cbebef91ffa9126061e5 5a2afd158f70d21ed8bf6a45f61a19dbbb6b79c2 Sebastian DiLorenzo 1372169352 +0200 commit: deleting pysam to upgrade and test newer version 5a2afd158f70d21ed8bf6a45f61a19dbbb6b79c2 c08551d489e8bc28692c600dfffa7e7d4cb37ca5 Sebastian DiLorenzo 1372256038 +0200 commit: Move pysam out of package +c08551d489e8bc28692c600dfffa7e7d4cb37ca5 b617a63c7595a2cb1b2a85e2ed73a67eccac8b32 Sebastian DiLorenzo 1372346578 +0200 commit: homepage info update pysam Modified: .git/logs/refs/heads/master =================================================================== --- .git/logs/refs/heads/master 2013-06-27 15:25:52 UTC (rev 183) +++ .git/logs/refs/heads/master 2013-06-27 15:43:17 UTC (rev 184) @@ -56,3 +56,4 @@ e557c8daaad5d3fba321242275706fa9e3138286 c8a8af10a9f5c2312766cbebef91ffa9126061e5 Sebastian DiLorenzo 1372165351 +0200 commit: small fix (hopefully) removing medians that have been set to NA c8a8af10a9f5c2312766cbebef91ffa9126061e5 5a2afd158f70d21ed8bf6a45f61a19dbbb6b79c2 Sebastian DiLorenzo 1372169352 +0200 commit: deleting pysam to upgrade and test newer version 5a2afd158f70d21ed8bf6a45f61a19dbbb6b79c2 c08551d489e8bc28692c600dfffa7e7d4cb37ca5 Sebastian DiLorenzo 1372256038 +0200 commit: Move pysam out of package +c08551d489e8bc28692c600dfffa7e7d4cb37ca5 b617a63c7595a2cb1b2a85e2ed73a67eccac8b32 Sebastian DiLorenzo 1372346578 +0200 commit: homepage info update pysam Modified: .git/logs/refs/remotes/origin/master =================================================================== --- .git/logs/refs/remotes/origin/master 2013-06-27 15:25:52 UTC (rev 183) +++ .git/logs/refs/remotes/origin/master 2013-06-27 15:43:17 UTC (rev 184) @@ -54,3 +54,4 @@ e557c8daaad5d3fba321242275706fa9e3138286 c8a8af10a9f5c2312766cbebef91ffa9126061e5 Sebastian DiLorenzo 1372165363 +0200 update by push c8a8af10a9f5c2312766cbebef91ffa9126061e5 5a2afd158f70d21ed8bf6a45f61a19dbbb6b79c2 Sebastian DiLorenzo 1372169371 +0200 update by push 5a2afd158f70d21ed8bf6a45f61a19dbbb6b79c2 c08551d489e8bc28692c600dfffa7e7d4cb37ca5 Sebastian DiLorenzo 1372256058 +0200 update by push +c08551d489e8bc28692c600dfffa7e7d4cb37ca5 b617a63c7595a2cb1b2a85e2ed73a67eccac8b32 Sebastian DiLorenzo 1372346594 +0200 update by push Modified: .git/refs/heads/master =================================================================== --- .git/refs/heads/master 2013-06-27 15:25:52 UTC (rev 183) +++ .git/refs/heads/master 2013-06-27 15:43:17 UTC (rev 184) @@ -1 +1 @@ -c08551d489e8bc28692c600dfffa7e7d4cb37ca5 +b617a63c7595a2cb1b2a85e2ed73a67eccac8b32 Modified: .git/refs/remotes/origin/master =================================================================== --- .git/refs/remotes/origin/master 2013-06-27 15:25:52 UTC (rev 183) +++ .git/refs/remotes/origin/master 2013-06-27 15:43:17 UTC (rev 184) @@ -1 +1 @@ -c08551d489e8bc28692c600dfffa7e7d4cb37ca5 +b617a63c7595a2cb1b2a85e2ed73a67eccac8b32 From noreply at r-forge.r-project.org Fri Jun 28 15:55:13 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 28 Jun 2013 15:55:13 +0200 (CEST) Subject: [Patchwork-commits] r185 - .git .git/logs .git/logs/refs/heads .git/logs/refs/remotes/origin .git/refs/heads .git/refs/remotes/origin pkg/TAPS/R Message-ID: <20130628135513.490E318502F@r-forge.r-project.org> Author: sebastian_d Date: 2013-06-28 15:55:12 +0200 (Fri, 28 Jun 2013) New Revision: 185 Modified: .git/index .git/logs/HEAD .git/logs/refs/heads/master .git/logs/refs/remotes/origin/master .git/refs/heads/master .git/refs/remotes/origin/master pkg/TAPS/R/TAPS.r Log: TAPS 250kb buggfix by markus Modified: .git/index =================================================================== (Binary files differ) Modified: .git/logs/HEAD =================================================================== --- .git/logs/HEAD 2013-06-27 15:43:17 UTC (rev 184) +++ .git/logs/HEAD 2013-06-28 13:55:12 UTC (rev 185) @@ -57,3 +57,4 @@ c8a8af10a9f5c2312766cbebef91ffa9126061e5 5a2afd158f70d21ed8bf6a45f61a19dbbb6b79c2 Sebastian DiLorenzo 1372169352 +0200 commit: deleting pysam to upgrade and test newer version 5a2afd158f70d21ed8bf6a45f61a19dbbb6b79c2 c08551d489e8bc28692c600dfffa7e7d4cb37ca5 Sebastian DiLorenzo 1372256038 +0200 commit: Move pysam out of package c08551d489e8bc28692c600dfffa7e7d4cb37ca5 b617a63c7595a2cb1b2a85e2ed73a67eccac8b32 Sebastian DiLorenzo 1372346578 +0200 commit: homepage info update pysam +b617a63c7595a2cb1b2a85e2ed73a67eccac8b32 f626f1a4b4965df8008d349712318cedf6dde9eb Sebastian DiLorenzo 1372427760 +0200 pull : Fast-forward Modified: .git/logs/refs/heads/master =================================================================== --- .git/logs/refs/heads/master 2013-06-27 15:43:17 UTC (rev 184) +++ .git/logs/refs/heads/master 2013-06-28 13:55:12 UTC (rev 185) @@ -57,3 +57,4 @@ c8a8af10a9f5c2312766cbebef91ffa9126061e5 5a2afd158f70d21ed8bf6a45f61a19dbbb6b79c2 Sebastian DiLorenzo 1372169352 +0200 commit: deleting pysam to upgrade and test newer version 5a2afd158f70d21ed8bf6a45f61a19dbbb6b79c2 c08551d489e8bc28692c600dfffa7e7d4cb37ca5 Sebastian DiLorenzo 1372256038 +0200 commit: Move pysam out of package c08551d489e8bc28692c600dfffa7e7d4cb37ca5 b617a63c7595a2cb1b2a85e2ed73a67eccac8b32 Sebastian DiLorenzo 1372346578 +0200 commit: homepage info update pysam +b617a63c7595a2cb1b2a85e2ed73a67eccac8b32 f626f1a4b4965df8008d349712318cedf6dde9eb Sebastian DiLorenzo 1372427760 +0200 pull : Fast-forward Modified: .git/logs/refs/remotes/origin/master =================================================================== --- .git/logs/refs/remotes/origin/master 2013-06-27 15:43:17 UTC (rev 184) +++ .git/logs/refs/remotes/origin/master 2013-06-28 13:55:12 UTC (rev 185) @@ -55,3 +55,4 @@ c8a8af10a9f5c2312766cbebef91ffa9126061e5 5a2afd158f70d21ed8bf6a45f61a19dbbb6b79c2 Sebastian DiLorenzo 1372169371 +0200 update by push 5a2afd158f70d21ed8bf6a45f61a19dbbb6b79c2 c08551d489e8bc28692c600dfffa7e7d4cb37ca5 Sebastian DiLorenzo 1372256058 +0200 update by push c08551d489e8bc28692c600dfffa7e7d4cb37ca5 b617a63c7595a2cb1b2a85e2ed73a67eccac8b32 Sebastian DiLorenzo 1372346594 +0200 update by push +b617a63c7595a2cb1b2a85e2ed73a67eccac8b32 f626f1a4b4965df8008d349712318cedf6dde9eb Sebastian DiLorenzo 1372427760 +0200 pull : fast-forward Modified: .git/refs/heads/master =================================================================== --- .git/refs/heads/master 2013-06-27 15:43:17 UTC (rev 184) +++ .git/refs/heads/master 2013-06-28 13:55:12 UTC (rev 185) @@ -1 +1 @@ -b617a63c7595a2cb1b2a85e2ed73a67eccac8b32 +f626f1a4b4965df8008d349712318cedf6dde9eb Modified: .git/refs/remotes/origin/master =================================================================== --- .git/refs/remotes/origin/master 2013-06-27 15:43:17 UTC (rev 184) +++ .git/refs/remotes/origin/master 2013-06-28 13:55:12 UTC (rev 185) @@ -1 +1 @@ -b617a63c7595a2cb1b2a85e2ed73a67eccac8b32 +f626f1a4b4965df8008d349712318cedf6dde9eb Modified: pkg/TAPS/R/TAPS.r =================================================================== --- pkg/TAPS/R/TAPS.r 2013-06-27 15:43:17 UTC (rev 184) +++ pkg/TAPS/R/TAPS.r 2013-06-28 13:55:12 UTC (rev 185) @@ -1644,13 +1644,14 @@ #Top part of the plot #------------------------------------------------------------ + #nchr=24; if (sum(chr=='chrY')==0) nchr=23 #Loop over and plot the 24 chromosomes for (c in 1:24) { #Pick a chromosome this <- ideogram[ideogram$c==c,] #Extract that chromosomes information - ix <- chr==this$chr + ix <- chr==as.character(this$chr) #Add color depending on the length of this chromosome col <- rep('#B0B0B030',length(chr)) col[ix & (pos < this$mid)] <- paste(colors_p(sum(ix & (pos < this$mid))), '70', sep='') @@ -1742,9 +1743,9 @@ for (c in 1:24) { this <- ideogram[ideogram$c==c,] - ix <- chr==this$chr - mix <- mchr==this$chr #& mval>=(-2) - six <- schr==this$chr + ix <- chr==as.character(this$chr) + mix <- mchr==as.character(this$chr) #& mval>=(-2) + six <- schr==as.character(this$chr) #Predefine ymin ymax and sequence between them ymin=floor(2*min(int,na.rm=T))/2 @@ -1819,7 +1820,7 @@ for(c in 1:24) { this <- ideogram[ideogram$c==c,] - ix <- chr==this$chr + ix <- chr==as.character(this$chr) col <- rep('#B0B0B030',length(chr)) col[ix & (pos < this$mid)] <- paste(colors_p(sum(ix & (pos < this$mid))), '70', sep='') col[ix & (pos > this$mid)] <- paste(colors_q(sum(ix & (pos > this$mid))), '70', sep='') @@ -2010,7 +2011,7 @@ #------------------------------------------------------------ #index of the selected chromsome to the chr object - ix <- chr==this$chr + ix <- chr==as.character(this$chr) notix1 = chr=="chrX" notix = !ix + notix1 @@ -2090,7 +2091,7 @@ par(mgp =c(0.5,0.25,0)) #Select the correct chromosome and remove stuff lower than -1 - mix <- mchr==this$chr #& mval>(-1) + mix <- mchr==as.character(this$chr) #& mval>(-1) #Predefine ymin ymax and sequence between them ymin=floor(2*min(int,na.rm=T))/2 @@ -2178,7 +2179,7 @@ mtext(text=this$chr,side=2,las=1,line=-1.2) #index of the chromData for this chromosome - dix = chromData$chr == this$chr + dix = chromData$chr == as.character(this$chr) #Add cytoband information as differently colored rectangles rect(xleft=chromData$chromStart[dix],xright=chromData$chromEnd[dix], @@ -2213,7 +2214,7 @@ par(mgp =c(0.5,0.25,0)) #Index of correct chromsome and allele frequency not in either 0 or 1 - six <- schr==this$chr & !(sval %in% c(0,1)) + six <- schr==as.character(this$chr) & !(sval %in% c(0,1)) #plot allele frequency over position plot(spos[six],sval[six], @@ -2342,7 +2343,7 @@ #Left side of the plot (Whole genome) #------------------------------------------------------------ #index of the selected chromsome to the chr object - ix <- chr==this$chr + ix <- chr==as.character(this$chr) notix1 = chr=="chrX" notix = !ix + notix1 @@ -2480,7 +2481,7 @@ par(mgp =c(0.5,0.25,0)) #Select the correct chromosome and remove stuff lower than -1 - mix <- mchr==this$chr #& mval>(-1) + mix <- mchr==as.character(this$chr) #& mval>(-1) #Predefine ymin ymax and sequence between them ymin=floor(min(int[ix]))-0.5 @@ -2548,7 +2549,7 @@ mtext(text="Cytoband",side=2,las=1,line=-1,cex=0.8) #index of the chromData for this chromosome - dix = chromData$chr == this$chr + dix = chromData$chr == as.character(this$chr) #Add cytoband information as differently colored rectangles rect(xleft=chromData$chromStart[dix],xright=chromData$chromEnd[dix], @@ -2584,7 +2585,7 @@ par(mgp =c(0.5,0.25,0)) #Index of correct chromsome and allele frequency not in either 0 or 1 - six <- schr==this$chr & !(sval %in% c(0,1)) + six <- schr==as.character(this$chr) & !(sval %in% c(0,1)) #plot allele frequency over position plot(spos[six],sval[six], @@ -2807,8 +2808,8 @@ #------------------------------------------------------------ #index of overlapping the selected chromosome region to the chr object - wix <- chr==this$chr & (((Rstart <= start) & (Rend >= end)) | ((Rstart >= start) & (Rstart <= end)) | ((Rend <= end) & (Rend >= start))) - ix <- chr==this$chr + wix <- chr==as.character(this$chr) & (((Rstart <= start) & (Rend >= end)) | ((Rstart >= start) & (Rstart <= end)) | ((Rend <= end) & (Rend >= start))) + ix <- chr==as.character(this$chr) #Create an index of colors relating to the positions and lengths on this chromosome col <- rep('#B0B0B030',length(chr)) @@ -2859,7 +2860,7 @@ par(xpd=T) #Select the correct chromosome and remove stuff lower than -1 - mix <- mchr==this$chr #& mval>(-1) + mix <- mchr==as.character(this$chr) #& mval>(-1) #Create an index of colors relating to the positions and lengths on this chromosome col=rep('#000000',sum(ix)) @@ -2943,7 +2944,7 @@ mtext(text="Cytoband",side=2,las=1,line=-1,cex=0.8) #index of the chromData for this chromosome - dix = chromData$chr == this$chr + dix = chromData$chr == as.character(this$chr) #Add cytoband information as differently colored rectangles rect(xleft=chromData$chromStart[dix],xright=chromData$chromEnd[dix], @@ -2982,7 +2983,7 @@ #Index of correct chromsome and allele frequency not in either 0 or 1 - six <- schr==this$chr & !(sval %in% c(0,1)) + six <- schr==as.character(this$chr) & !(sval %in% c(0,1)) #plot allele frequency over position plot(spos[six],sval[six], @@ -3024,9 +3025,9 @@ #Select the correct chromosome and region and remove stuff lower than -1 - mix <- mchr==this$chr & (mpos >= Rstart) & (mpos <= Rend) #& mval>(-1) + mix <- mchr==as.character(this$chr) & (mpos >= Rstart) & (mpos <= Rend) #& mval>(-1) - wix <- chr==this$chr & (((Rstart <= start) & (Rend >= end)) | ((Rstart >= start) & (Rstart <= end)) | ((Rend <= end) & (Rend >= start))) + wix <- chr==as.character(this$chr) & (((Rstart <= start) & (Rend >= end)) | ((Rstart >= start) & (Rstart <= end)) | ((Rend <= end) & (Rend >= start))) cix = ((Rstart >= start) & (Rstart <= end)) start[cix] = Rstart @@ -3107,7 +3108,7 @@ #Create and index of the genes within region (rstart to rend) #gix <- kg$chr==this$chr & (((Rstart <= kg$gtxStart) & (Rend >= kg$gtxEnd)) | ((Rstart >= kg$gtxStart) & (Rstart <= kg$gtxEnd)) | ((Rend <= kg$gtxEnd) & (Rend >= kg$gtxStart))) - gix <- kg$chr==this$chr & ((Rstart <= kg$gtxEnd) & (Rend >= kg$gtxStart)) + gix <- kg$chr==as.character(this$chr) & ((Rstart <= kg$gtxEnd) & (Rend >= kg$gtxStart)) #If they are only partial overlapping, remove the parts outside of the selected region cix = ((Rstart >= kg$gtxStart) & (Rstart <= kg$gtxEnd)) @@ -3182,7 +3183,7 @@ #Index of correct chromsome and allele frequency not in either 0 or 1 - six <- schr==this$chr & !(sval %in% c(0,1)) & (spos >= Rstart) & (spos <= Rend) + six <- schr==as.character(this$chr) & !(sval %in% c(0,1)) & (spos >= Rstart) & (spos <= Rend) #plot allele frequency over position plot(spos[six],sval[six],