Entering edit mode
8.1 years ago
Bioradical
▴
60
I'm looking for a program to extract signal values from a bigWig file for a given set of coordinates.
Python, R or command line is fine (my programming is rudimentary at best). Thank you!
cool library... does this also takes care about negative and positive strands from bed file?
There's nothing special about the minus strand, it has the same values in a bigWig file.
I think it will be helpful if one is plotting the nucleosome signal around TSS or TTS. As some genes has reverse orientation (negative strands in gff file), there data needs to be reversed accordingly before plotting. Correct me if I am wrong.
Tools like
computeMatrix
in deepTools handle such things automatically (deepTools uses the pyBigWig library under the hood).Ohh... thanks I have used it, but completely forgotten.
Smooth as hell :) Great work Devon!
Are you done with the thesis?
I was going to yell that just now when I saw him walk into a talk :)
Looks like @John wants to stay a student .. forever.
Not smooth, @John :)
Hehehe, hasn't there been enough bioinformatician-abuse for one day? :P
For the record, my answer would have been "uhhh..."
You're a grad student, there's never enough grad student abuse :)
Hi Devon, Thank you very much for this script. I added three lines where you have the comment, 'Do something with the values':
This prints out a list of ATG numbers and a number. For example,
AT5G27350 6375.189992427826
However, some ATG numbers have 'nan' instead of a number, such as :
AT5G64667 nan
I was wondering if the reason why 'nan' is printed is because that in the list there may be 1 or 2 nan's, so the sum for the whole list is 'nan' ?
When I put 'nan' in a list I created and try to sum all value in this list with sum(mylist), I get an error, so I don't know how 'nan' is working in the bw.values() function.
If there is just a single 'nan' in the vals, then does that mean a sum of the vals would be 'nan' ? If this is true, is there a way to replace the 'nan' with a 0 ?
You'll want
np.nansum()
.Great ! Thank you very much. Works very well. Numbers for all the ATGs (genes).
Hi, I have been struggling to find a way to extract signal from a bw file. And this code is perfect for what I want to do. However, I do not know python. I would like to do this on Linux terminal.
Could you share the code that replicates the above in linux?
Thanks
Type that into a file,
pip install --user pyBigWig
and then execute the file you saved.