plotting read counts on the plus and minus strand

1,425 views
Skip to first unread message

Yeroslaviz, Assa

unread,
Sep 30, 2014, 1:06:25 PM9/30/14
to gen...@soe.ucsc.edu, Yeroslaviz, Assa
Hi,

I was wondering how I can plot my read counts in a strand specific way on the UCSC browser.
I would like to have the count for the gene on the plus strand to go up, while the reads mapped to the minus strand will be shown downwards.
Something like this:

[cid:B633FE69-92DD-4339-B8F0-15026C5A2445]

Is it possible to separate the two strands according to a specific parameter?

Thanks
Assa

Jonathan Casper

unread,
Sep 30, 2014, 9:16:32 PM9/30/14
to Yeroslaviz, Assa, gen...@soe.ucsc.edu

Hello Assa,

Thank you for your question about plotting your - strand read counts below the x axis of a graph. There is a way for you to do this, if you have your read counts for the + and - strands in different bigWig (or bedGraph or wiggle) files. When you load the custom track containing your read counts on the - strand, there is a "negateValues" option that you can specify in the track line (see http://genome.ucsc.edu/goldenPath/help/trackDb/trackDbDoc.html#wig_-_Signal_Graphing_Track_Settings). This setting will automatically negate the read counts so that the positive values are treated as negative and are displayed below the x axis.

You can also do this without the "negateValues" track setting by editing your data so that the read counts for items on the - strand are negative numbers instead of positive.

More information about the wiggle, bedGraph, and bigWig file formats is available on our file formats page at http://genome.ucsc.edu/FAQ/FAQformat.html. bigWig files are usually created from wiggle or bedGraph files to store the data in a more compact format.

I hope this is helpful. If you have any further questions, please reply to gen...@soe.ucsc.edu or genome...@soe.ucsc.edu. Questions sent to those addresses will be archived in publicly-accessible forums for the benefit of other users. If your question contains sensitive data, you may send it instead to genom...@soe.ucsc.edu.

--
Jonathan Casper
UCSC Genome Bioinformatics Group


Assa

--


Yeroslaviz, Assa

unread,
Oct 2, 2014, 11:12:32 AM10/2/14
to Jonathan Casper, gen...@soe.ucsc.edu, Yeroslaviz, Assa
Hi Jonathan,

Thanks for the quick answer. It was very helpful.
I have followup question though.

I have tried to create a bed file with positive and negative values in one. This went quite well by using samtools to split the bam file to forward and reverse strands. I have used a combination of bamToBed, sortBed, genomeCoverageBed to create the separate bedgraph files. I than used awk to add a "-" symbol for the negative strand reads.

Now I need to concatenate them.

I have tried a small fraction of my file to see how it works when there are overlapping regions of negative and positive values. I as I was afraid, the positions were shifted. This is the image I get when I am using the list of reads from my file ( I attached the file).
But as an example I have these region:
chr2L 83459 83460 28
chr2L 83460 83462 -30
chr2L 83460 83462 30
chr2L 83462 83466 -35
chr2L 83462 83466 35

Here I have both positive an negative values, which I can't see in my browser. Is there a better or more direct way to create the bedgraph?


[cid:A8A7C989-680F-44F9-95C6-1C64B1806A12]


I would appreciate your help,

Thanks,

Assa

--
Dr. Assa Yeroslaviz
Max Planck Institute for Biochemistry / Max-Planck-Institut für Biochemie
Application service, Bioinformatics group / Bioinformatische Servicegruppe
Am Klopferspitz 18, 82152 Martinsried
Tel: +49 (0)89 8578 2427
Email: yeros...@biochem.mpg.de


From: Jonathan Casper <jca...@soe.ucsc.edu<mailto:jca...@soe.ucsc.edu>>
Date: Wednesday, October 1, 2014 3:16 AM
To: Assa Yeroslaviz <yeros...@biochem.mpg.de<mailto:yeros...@biochem.mpg.de>>
Cc: "gen...@soe.ucsc.edu<mailto:gen...@soe.ucsc.edu>" <gen...@soe.ucsc.edu<mailto:gen...@soe.ucsc.edu>>
Subject: Re: [genome] plotting read counts on the plus and minus strand


Hello Assa,

Thank you for your question about plotting your - strand read counts below the x axis of a graph. There is a way for you to do this, if you have your read counts for the + and - strands in different bigWig (or bedGraph or wiggle) files. When you load the custom track containing your read counts on the - strand, there is a "negateValues" option that you can specify in the track line (see http://genome.ucsc.edu/goldenPath/help/trackDb/trackDbDoc.html#wig_-_Signal_Graphing_Track_Settings). This setting will automatically negate the read counts so that the positive values are treated as negative and are displayed below the x axis.

You can also do this without the "negateValues" track setting by editing your data so that the read counts for items on the - strand are negative numbers instead of positive.

More information about the wiggle, bedGraph, and bigWig file formats is available on our file formats page at http://genome.ucsc.edu/FAQ/FAQformat.html. bigWig files are usually created from wiggle or bedGraph files to store the data in a more compact format.

I hope this is helpful. If you have any further questions, please reply to gen...@soe.ucsc.edu<mailto:gen...@soe.ucsc.edu> or genome...@soe.ucsc.edu<mailto:genome...@soe.ucsc.edu>. Questions sent to those addresses will be archived in publicly-accessible forums for the benefit of other users. If your question contains sensitive data, you may send it instead to genom...@soe.ucsc.edu<mailto:genom...@soe.ucsc.edu>.

--
Jonathan Casper
UCSC Genome Bioinformatics Group

testbedgraph.txt

Steve Heitner

unread,
Oct 2, 2014, 1:02:20 PM10/2/14
to Yeroslaviz, Assa, Jonathan Casper, gen...@soe.ucsc.edu
Hello, Assa.

This will not work because your single file contains both positive and
negative values that overlap the same genomic coordinates. Thie bedGraph
and wiggle formats will only display one value per base, so you cannot
display both a positive and negative value at the same coordinates. The
best solution would be to follow the instructions that Jonathan outlined
below for two bigWig tracks - one for the positive values and one for the
negative values.

Please contact us again at gen...@soe.ucsc.edu if you have any further
questions. Questions sent to that address will be archived in a
publicly-accessible forum for the benefit of other users. If your question
contains sensitive data, you may send it instead to genom...@soe.ucsc.edu.

---
Steve Heitner
UCSC Genome Bioinformatics Group
--


Reply all
Reply to author
Forward
0 new messages