bam permanent

11 views
Skip to first unread message

jp d

unread,
Feb 22, 2024, 3:31:50 PMFeb 22
to genome mirror
hi,
sorry its been a while and maybe i used to know this,
we have an older mirror and i want to make some bams
a permanent track.
what is the usual pathflow for that ?(ie is there an hgLoadBed?)

does hgBbiDbLink work for bams ?

or convert bam to big bed then use hgBbiDbLink ?

is any information lost in that conversion ?

thanks
jpd

Gerardo Perez

unread,
Mar 11, 2024, 9:16:30 PMMar 11
to jp d, genome mirror

Hello, jpd.

Thank you for your interest in the Genome Browser and for sending your inquiry.

We apologize for the delay in our response. You can make a track hub for the bam tracks and then make them appear with your default tracks on your mirror. This will allow the bam tracks to appear every time you open the UCSC Genome Browser graphic display and they will also appear after you reset all your settings. If you are unfamiliar with track hubs, please read the user guide, https://genome.ucsc.edu/goldenPath/help/hgTrackHubHelp.html. We also offer a quick start guide for basic hubs, https://genome.ucsc.edu/goldenPath/help/hubQuickStart.html.

After you created and attached your track hub with bam tracks to your UCSC Genome Browser mirror and have the desired display options, you can then do the following to make the track hub appear with your default tracks:

1. Make a session (http://genome.ucsc.edu/goldenPath/help/hgSessionHelp.html) in your mirror and save the session with the name ‘session_settings’. You can also save the session settings to a local file but this will require some editing through the command line. If you save the session settings to a local file and name it ‘session_settings’ then you can run the following awk command to edit the file so it can be loaded to a table:

awk 'BEGIN{ORS="&"}{print}' session_settings | awk '{gsub(/ /,"="); print}' | awk '{gsub("hub.txt=","hub.txt "); print}' > load_session_settings

2. Open shell on your mirror: ssh mirror
3. Go to a directory where you can add files
4. Create a new file, ‘defaultCart.sql’, in order to create a new MySQL table. Add the following to the defaultCart.sql file:

#The default cart
CREATE TABLE defaultCart (
    contents longblob not null    # cart contents
);

5 Drop the existing defaultCart table by running the following query:
mysql hgcentral -Ne "DROP TABLE defaultCart" 

6. Load the defaultCart.sql file as a table by running the following query:
mysql hgcentral < defaultCart.sql

7. Insert your session to the default cart table by using your user name and the session name, which was the session saved in Step 1, and run the following query (add your userName):
mysql hgcentral -Ne "insert into defaultCart select contents from namedSessionDb where sessionName='session_settings' and userName='your_user_name'" 

If you saved your session settings to a local file then you will need to create a new file, ‘load_session_settings’, in your mirror directory and add the contents from the 'load_session_settings' file that was created in Step 1. Then add the ‘load_session_settings’ file into the defaultCart table by running the following query:
mysql -e "LOAD DATA LOCAL INFILE 'load_session_settings' INTO TABLE defaultCart" hgcentral

8. Go to your UCSC Genome Browser mirror and reset your settings by mouseOvering Genome Browser on the blue bar menu and click Reset All User Settings

After resetting your settings, you should see the track hub with bam tracks on your UCSC Genome Browser mirror.

I hope this is helpful. If you have any further questions, please reply to genome...@soe.ucsc.edu.

Gerardo Perez
UCSC Genomics Institute


--

---
You received this message because you are subscribed to the Google Groups "UCSC Genome Browser Mirror-Specific Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to genome-mirro...@soe.ucsc.edu.
To view this discussion on the web visit https://groups.google.com/a/soe.ucsc.edu/d/msgid/genome-mirror/274377060.3281728.1708633384464%40mail.yahoo.com.
Reply all
Reply to author
Forward
0 new messages