[GenABEL-dev] Visualizing region in UCSC browser

Marcin Kierczak marcin.kierczak at slu.se
Thu May 12 12:02:37 CEST 2011


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) {
	snp1 <- which(snpnames(data at gtdata) == region[1])
	chromosome = chromosome(data at gtdata)[snp1]
	if (length(region) <= 1) { 
  		beg <- map(data at gtdata)[snp1]
  		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
_______________________________________



More information about the genabel-devel mailing list