[Patchwork-commits] r42 - pkg/patchwork/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Dec 8 10:59:10 CET 2011
Author: sebastian_d
Date: 2011-12-08 10:59:09 +0100 (Thu, 08 Dec 2011)
New Revision: 42
Modified:
pkg/patchwork/R/karyotype.r
pkg/patchwork/R/karyotype_chroms.r
pkg/patchwork/R/karyotype_chromsCN.r
pkg/patchwork/R/patchwork.CNA.r
pkg/patchwork/R/patchwork.alleledata.r
Log:
Did i just commit? cant remember :), lets do it again so i can test it on SSH
Modified: pkg/patchwork/R/karyotype.r
===================================================================
--- pkg/patchwork/R/karyotype.r 2011-12-07 16:47:12 UTC (rev 41)
+++ pkg/patchwork/R/karyotype.r 2011-12-08 09:59:09 UTC (rev 42)
@@ -1,4 +1,4 @@
-karyotype <- function(chr,start,end,int,ai,chroms,
+karyotype <- function(chr,start,end,int,ai,
name='',xlim=c(0,2.4),ylim=c(0.3,1))
{
png(paste(name,'.karyotype.png',sep=''),width=1300,height=1300)
@@ -9,10 +9,6 @@
data(ideogram,package="patchworkData")
- #substitute ideogram chr names with chroms-object chr names
- # so it will work independent of chr field name.
- #ideogram = merge(chroms,ideogram,all=F,by=1)
-
colors_p <- colorRampPalette(c("#6600FF","#9900CC"),space="rgb")
colors_q <- colorRampPalette(c("#CC0099","#CC0000"),space="rgb")
Modified: pkg/patchwork/R/karyotype_chroms.r
===================================================================
--- pkg/patchwork/R/karyotype_chroms.r 2011-12-07 16:47:12 UTC (rev 41)
+++ pkg/patchwork/R/karyotype_chroms.r 2011-12-08 09:59:09 UTC (rev 42)
@@ -1,4 +1,4 @@
-karyotype_chroms <- function(chr,start,end,int,ai,chroms,mchr,mpos,mval,
+karyotype_chroms <- function(chr,start,end,int,ai,mchr,mpos,mval,
schr,spos,sval,name='',xlim=c(0,2.4),ylim=c(0.3,1))
{
@@ -8,11 +8,6 @@
data(ideogram,package="patchworkData")
- #substitute ideogram chr names with chroms-object chr names
- # so it will work independent of chr field name.
-
- #ideogram$chr = chroms
-
#create a color ramp palette to segue the color scheme for plot.
colors_p <- colorRampPalette(c("#6600FF","#9900CC"),space="rgb")
Modified: pkg/patchwork/R/karyotype_chromsCN.r
===================================================================
--- pkg/patchwork/R/karyotype_chromsCN.r 2011-12-07 16:47:12 UTC (rev 41)
+++ pkg/patchwork/R/karyotype_chromsCN.r 2011-12-08 09:59:09 UTC (rev 42)
@@ -9,14 +9,6 @@
data(ideogram,package="patchworkData")
- #substitute ideogram chr names with chroms-object chr names
- # so it will work independent of chr field name.
-
- #chroms = as.character(unique(schr))
- #chroms = chroms[chroms != chroms[grep("M",chroms)]]
-
- #ideogram$chr = chroms
-
colors_p <- colorRampPalette(c("#6600FF","#9900CC"),space="rgb")
colors_q <- colorRampPalette(c("#CC0099","#CC0000"),space="rgb")
Modified: pkg/patchwork/R/patchwork.CNA.r
===================================================================
--- pkg/patchwork/R/patchwork.CNA.r 2011-12-07 16:47:12 UTC (rev 41)
+++ pkg/patchwork/R/patchwork.CNA.r 2011-12-08 09:59:09 UTC (rev 42)
@@ -29,24 +29,9 @@
#either chr1...chr22,chrX,chrY or 1...22,X,Y
data(ideogram,package="patchworkData")
- if(grep("chr",as.character(alf$achr[1])) == 1)
- {
- chroms = as.character(unique(ideogram$chr))
- }
- else
- {
- alf$achr = as.character(alf$achr)
- for(i in 1:22)
- {
- alf$achr[alf$achr == as.character(i)] = paste("chr",as.character(i),sep="")
- }
- i = "X"
- alf$achr[alf$achr == as.character(i)] = paste("chr",as.character(i),sep="")
- i = "Y"
- alf$achr[alf$achr == as.character(i)] = paste("chr",as.character(i),sep="")
- chroms = as.character(unique(ideogram$chr))
- }
+ chroms = as.character(unique(ideogram$chr))
+
#relic from using alf as chrom generator.
#chroms = chroms[chroms != chroms[grep("M",chroms)]]
@@ -124,10 +109,10 @@
#Plot it
cat("Initiating Plotting \n")
karyotype(segs$chr,segs$start,segs$end,segs$median,segs$ai,
- chroms,name=as.character(BamFile),
+ name=as.character(BamFile),
xlim=c(0,2.4),ylim=c(0.3,1))
karyotype_chroms(segs$chr,segs$start,segs$end,segs$median,segs$ai,
- chroms,kbsegs$chr,kbsegs$pos,kbsegs$ratio,
+ kbsegs$chr,kbsegs$pos,kbsegs$ratio,
alf$achr,alf$apos,(1-alf$amin/alf$amax),
name=as.character(BamFile),xlim=c(0,2.4),
ylim=c(0.3,1))
Modified: pkg/patchwork/R/patchwork.alleledata.r
===================================================================
--- pkg/patchwork/R/patchwork.alleledata.r 2011-12-07 16:47:12 UTC (rev 41)
+++ pkg/patchwork/R/patchwork.alleledata.r 2011-12-08 09:59:09 UTC (rev 42)
@@ -32,5 +32,24 @@
alf=merge(alf,dbSnp[,c(1,3)], all=F, by=1:2)
+ #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),]
+ alf$achr = as.character(alf$achr)
+
+ x_x = strsplit(alf$achr[1],"chr")
+ if(length(x_x[[1]]) == 1)
+ {
+ for(i in 1:22)
+ {
+ alf$achr[alf$achr == as.character(i)] = paste("chr",as.character(i),sep="")
+ }
+ i = "X"
+ alf$achr[alf$achr == as.character(i)] = paste("chr",as.character(i),sep="")
+ i = "Y"
+ alf$achr[alf$achr == as.character(i)] = paste("chr",as.character(i),sep="")
+ }
+
return(alf)
}
More information about the Patchwork-commits
mailing list