Welcome to the Genome Toolbox! I am glad you navigated to the blog and hope you find the contents useful and insightful for your genomic needs. If you find any of the entries particularly helpful, be sure to click the +1 button on the bottom of the post and share with your colleagues. Your input is encouraged, so if you have comments or are aware of more efficient tools not included in a post, I would love to hear from you. Enjoy your time browsing through the Toolbox.

Tuesday, November 19, 2013

Encode Features with no Strand Information in UCSC BED Format

The UCSC Genome Browser is a powerful tool that allows you to visualize your own data in custom tracks with respect to scores of other publicly available data tracks.  To use some of the more advanced features for plotting .bed files, strand information is a required field in the .bed files.  Usually, I would just arbitrarily assign a "+" for the strand information to indicate the feature was on the plus strand, when in actuality there is no relevant strand for the feature.  This results in arrows (>>>>>>) being drawn over the feature in Genome Browser, not the end of the world, but still not the polished look I was going for.  To circumvent this, I tried to leave the field blank when uploading a custom track, however, I would get the error: "Error line 1 of custom track: Expecting + or - in strand".  Then I stumbled on a simple fix, that doesn't seem to be documented well.  All Genome Browser needs is a period (.) in the strand field of the .bam file for each feature and all seems to work fine.  The result: a sharp looking feature track in Genome Browser.

4 comments:

  1. hi, for this quick fix where does the (.) period go? In the .bed file one is uploading?

    ReplyDelete
    Replies
    1. The period goes in the field of the .bed file where the + or - normally goes. The period in that field simply tells the UCSC genome browser there is no strand information for the feature. Hope this helps.

      Delete
  2. Hi

    I am using Bedtools coverage option to calculate coverage of my aligned reads in .bam format over 2kb windows of chromosome. So, I created a bed file for the chromosome separated in 2kb windows. The bed file has only 3 columns:chr1 0 2000; chr1 2000 4000... and so on. I am running the bedtools coverage option with -a genome.bed -b reads.bam. When I try to upload it to UCSC it tells me ''Error line 1 of custom track: Expecting + or - in strand'' How can I solve this?

    Thank you

    ReplyDelete
    Replies
    1. The output of bedtools is like this:
      chr1 0 2000 0 0 2000 0.0000000
      chr1 2000 4000 0 0 2000 0.0000000

      And I dont know where to introduce the column with dots.

      Delete