[GenABEL-dev] Visualizing region in UCSC browser

Yurii Aulchenko yurii.aulchenko at gmail.com
Tue May 17 18:18:45 CEST 2011


Dear Marcin,

I definitely think this will be a useful function!

Few suggestions:

1) If you decide to submit this function, please also think of
producing help in roxygen format (see e.g. polygenic_hglm,
https://r-forge.r-project.org/scm/viewvc.php/pkg/GenABEL/R/polygenic_hglm.R?view=markup&root=genabel)

2) Would that be possible to supply species as another argument?
Surely many people will be interested in different species :)

Small on the code comments below:

On Thu, May 12, 2011 at 12:02 PM, Marcin Kierczak
<marcin.kierczak at slu.se> wrote:
> Hi again,
>
> during the workshop I mentiond to Yurii my function for visualization of a predefined region in UCSC browser. The code for canine genome is below. I have also some code for another browsers. If you think it is worth adding to GenABEL as a function, I will be happy to code it in a nicer way. Regards,
>
>                                                                                                                Marcin
>
>
> show.ucsc <- function(data, region) {

need checks for class of 'data' and sanity checks of 'region'

>        snp1 <- which(snpnames(data at gtdata) == region[1])

snpnames(data) will work

>        chromosome = chromosome(data at gtdata)[snp1]

chromosome(data) will work

>        if (length(region) <= 1) {
>                beg <- map(data at gtdata)[snp1]

map(data) will work

>                end <- beg
>        }
>        else {
>                snp2 <- which(snpnames(data at gtdata) == region[2])
>                beg <- map(data at gtdata)[snp1]
>                end <- map(data at gtdata)[snp2]
>        }
>        url <- paste("http://genome.ucsc.edu/cgi-bin/hgTracks?clade=mammal&org=Dog&db=canFam2&position=chr",chromosome,":",beg,"-",end,"&hgt.suggest=&pix=1600&Submit=submit", sep="")
>        a <- try(browseURL(url));
>  if (is(a,"try-error")) {
>        stop("can not invoke browser")
>  }
> }
>
> _______________________________________
>
> Marcin Kierczak, PhD
> Postdoctoral Researcher
> Department of Animal Breeding and Genetics
> Swedish University of Agricultural Sciences
>
> Box 7023
> SE-75 007 Uppsala
> Sweden
> phone: +46 18 672 065
> e-mail: Marcin.Kierczak at hgen.slu.se
> web: http://www.computationalgenetics.se
> _______________________________________
>
> _______________________________________________
> genabel-devel mailing list
> genabel-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel
>


More information about the genabel-devel mailing list