[BioC] GenomeGraphs question

Joern Toedling j.toedling at imb-mainz.de
Wed Feb 8 17:26:47 CET 2012


Hello,

the function "setPar" might be what you are looking for.

You can check the parameters associated with each object easily by just 
typing the object's name, such as
 > snpPlot

and set them this way:
 > setPar(snpPlot, "pointSize", 2) # or something else than 2

and then calling "gdPlot" will probably do the trick.

Regards,
Joern




On 02/08/2012 04:53 PM, Iain Gallagher wrote:
>
> Dear List
>
> I am plotting some snps using GenomeGraphs to show genomic context. I have a simple question: how do I change the size of the plotting character?
>
> # SCRIPT BEGINS
>
> require(biomaRt) # get and load the library
> require(GenomeGraphs)
>
> # get the snps we need info on
> snps<- c('rs136617760', 'rs42494357', 'rs110465273', 'rs42494342',  'rs109809949', 'rs134449285', 'rs137562332', 'rs132841890')
>
> # set up the database we need to query
> snpmart<- useMart('snp', dataset = 'btaurus_snp')
>
> # we want to get the snp id, allele, chromosome position and chromosome
> # in biomaRt attributes are what you want, filters are what you're using to query the db
> # there's load of info available; use listAttributes(snpmart) to see what you can get back
> # and listFilters(snpmart) to see what you can put in as a query
>
> snpInfo<- getBM(attributes = c('refsnp_id', 'allele', 'chrom_start', 'chr_name'), filters = 'snp_filter', values = snps, mart = snpmart)
>
> # plot these using GenomeGraphs
> # subset out the chromosome 13 snps
> thirteenSnps<- subset(snpInfo, snpInfo$chr_name == 13)
>
> # make pretend 'intensity values' for later
> ints<- seq(1,6) # could replace with 1/log10p perhaps!
> names(ints)<- thirteenSnps$refsnp_id
> ints<- as.matrix(ints)
>
> # set up mart
> cowmart<- useMart('ensembl', dataset = 'btaurus_gene_ensembl')
>
> # make a plot of the genes on bovine chromosome 13 around the SNPs Mairead found on chromosome 13
> ideogram<- makeIdeogram(chromosome = 13)
>
> plusStrand<- makeGeneRegion(chromosome = 13, start = min(thirteenSnps$chrom_start)-5e5, end = min(thirteenSnps$chrom_start)+5e5, strand = "+", biomart = cowmart)
>
> minStrand<- makeGeneRegion( chromosome = 13, start = min(thirteenSnps$chrom_start)-5e5, end = min(thirteenSnps$chrom_start)+5e5, strand = "-", biomart = cowmart)
>
> genomeAxis<- makeGenomeAxis(add53 = TRUE, add35 = TRUE)
>
> snpPlot<- makeGenericArray(intensity = ints, probeStart = thirteenSnps$chrom_start,  dp = DisplayPars(color="darkred", type="point", cex = 2))
>
> gdPlot(list(makeTitle('Chromosome 13'), a = ideogram, b = plusStrand, c = genomeAxis, d = minStrand, e = snpPlot), labelCex = 2, labelRot = 0)
>
> # SCRIPT ENDS
>
> I would like to make the dots representing the snps larger. I tried e.g.
>
> dp = DisplayPars(cex = 2) and dp = DisplayPars(size = 2) in the snpPlot definition without success and I can't work out the answer from the documentation.
>
> Incidentally I'm aware that the above script is perhaps abusing makeGenericArray - it works for me. If anyone has a more 'proper' way of doing this then that would be educational as well.
>
> Best
>
> Iain
>


-- 
Joern Toedling, PhD
Core Facility Bioinformatics
Institute of Molecular Biology gGmbH (IMB)
http://www.imb-mainz.de
Tel.: +49 6131 39 21511



More information about the Bioconductor mailing list