Bookmarklet To Open User Ucsc Genome Browser For Specific Chromosomal Location
2
1
Entering edit mode
14.4 years ago
D W ▴ 150

I've written a bookmarlet to open a user defined web link, in this specific case a specific genomic location in the UCSC genome broswer.

javascript:d=%22%22+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);d=d.replace(/%5Cr%5Cn%7C%5Cr%7C%5Cn/g,%22%20,%22);if(!d)d=prompt(%22Enter%20the%20chromosomal%20location%20(ex.%20chr1:213243007-213243247):%22,%20%22%22);if(d!=null)location=%22http://genome.ucsc.edu/cgi-bin/hgTracks?hgS_doOtherUser=submit&hgS_otherUserName=Denilw&hgS_otherUserSessionName=mrkdOvrExpUniqMonometh&position=%22+escape(d).replace(/%20/g,%22+%22);void%200

There are 24 chromosomes in the human genome that can be displayed and I would like to do the following:

1) Parse the chromosome out of the user entered string

Use a regex in java script to parse 1 from chr1:213243007-213243247 or X from chrX:213243007-213243247

2) Alter the form on UCSC based on the user input

There are 4 tracks or data sets to show for each of the 22 chromosomes, 88 in total. These are available for selection in the Custom Tracks section of UCSC genome browser as per the linke chosen above, say, this

HS0356_chr__CHROMOSOME__duplicates_standard_len_triangle
HS0445_dpwg_chr_chr_CHROMOSOME__duplicates_standard_len_triangle
HS1328_chr__CHROMOSOME__duplicates_standard_len_triangle
HS1329_dpwg_chr_chr_CHROMOSOME__duplicates_standard_len_triangle

Then I would like the drop down menus for the above, where CHROMOSOME is defined in part 1 to be changed from Hide to Full so that only the data for the chromosome of interest will be displayed.

Perhaps something like this would be helpful.

ucsc genome • 2.7k views
ADD COMMENT
0
Entering edit mode

a drop down menu with a bookmarklet ? I guess it would be easier to to with greasemonkey....

ADD REPLY
0
Entering edit mode

greasemonkey solutions are accepted

ADD REPLY
1
Entering edit mode
ADD COMMENT
0
Entering edit mode
14.4 years ago

This question seems to be more about javascript programming rather than bioinformatics. You might have better luck rephrasing and posting it to Stackoverflow.

ADD COMMENT
0
Entering edit mode

I didn't have luck on stackoverflow.

ADD REPLY

Login before adding your answer.

Traffic: 1783 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6