Question: GVIZ plotTracks plots dense features under each other
0
gravatar for tonja.r
4.1 years ago by
tonja.r450
UK
tonja.r450 wrote:

I am using gviz from a bioconductor to plot SNPs data using chromosome and genome axis:

My problem is that it plots dense located SNPs under each other and I could not find a parameter to avoid. I also could not find if it is possible to plot the name of the SNPs to the corresponding bar or mark one specific SNP with another color.
 

gr99 <- GRanges(seqnames = c("chr7","chr7","chr7","chr7","chr7","chr7"),
                IRanges(start=c(128580042,128580052,128575552,128576086,128579202,128579666),                        
                        end=c(128580042,128580052,128575552,128576086,128579202,128579666)))

atrack2=AnnotationTrack(gr99, name = "SNP")
gen = c()
gen[chr] =genome(atrack2)="hg19"
gtrack <- GenomeAxisTrack()
itrack <- IdeogramTrack(genome = gen, chromosome = "chr7")
plotTracks(list(itrack,gtrack, atrack2),panel.only == TRUE)

 

snp • 2.2k views
ADD COMMENTlink modified 4.0 years ago • written 4.1 years ago by tonja.r450

Not the best solution. Make two or more tracks and plot them together

a <- seq(1,length(gr99),2)
​plotTracks(list(itrack,gtrack, atrack2[a],atrack2[-a]))

 

ADD REPLYlink modified 4.1 years ago • written 4.1 years ago by Jimbou680
1
gravatar for tonja.r
4.0 years ago by
tonja.r450
UK
tonja.r450 wrote:

 AnnotationTrack has a stacking parameter:

atrack = AnnotationTrack(gr99, name = "CREDIBLE SET", id = set$X.SNPID,stacking ="dense")

ADD COMMENTlink written 4.0 years ago by tonja.r450
0
gravatar for Jimbou
4.1 years ago by
Jimbou680
Germany
Jimbou680 wrote:

And here it is:

atrack1=AnnotationTrack(gr99, name = "SNP", id = paste0("rs",c(1:6))) # id == the SNP names
displayPars(atrack1) <- list(fontcolor.group="#80808000",col=NULL,fill="black",showId=T,showFeatureId=T,cex=1.2,fontcolor.item="red")
plotTracks(list(itrack,gtrack, atrack1))

You can play with the displayPars to get your picture of choice

displayPars(atrack1) 

 

ADD COMMENTlink modified 4.1 years ago • written 4.1 years ago by Jimbou680
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1401 users visited in the last hour