SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bam to bigwig gokhulkrishnakilaru Bioinformatics 6 11-21-2016 11:54 AM
Creating BigWig files from BAM files... Hparker Bioinformatics 2 05-15-2015 05:28 AM
bigwig and replicates dilemma emolinari Bioinformatics 4 08-20-2014 01:17 AM
new tool for bigWig data AndyP Bioinformatics 0 11-02-2013 07:35 AM
convert wig to bigwig khb Bioinformatics 1 12-16-2010 07:02 AM

Reply
 
Thread Tools
Old 02-23-2017, 12:00 AM   #1
RobbenStijn
Member
 
Location: Amsterdam

Join Date: Feb 2017
Posts: 12
Default BAM to BIGWIG

I'm trying to convert a BAM file to a BIGWIG file on my mac using the following link:

https://github.com/chapmanb/bcbb/blo...m_to_wiggle.py

Could someone explain what commands I have to put into the terminal (or in Sublime Text)? My BAM file is called Galaxy6RmDupdata.bam. I couldn't figure this out myself from the explanation in the link itself.

Any help would be greatly appreciated!

Many thanks,

Stijn
RobbenStijn is offline   Reply With Quote
Old 02-23-2017, 01:07 AM   #2
tristan dubos
Member
 
Location: France

Join Date: Dec 2015
Posts: 39
Default

Hi ,

What did you try ? it seems to be something like :
bam_to_wiggle.py Galaxy6RmDupdata.bam --outfile path_to_the_result

Tristan
tristan dubos is offline   Reply With Quote
Old 02-23-2017, 01:29 AM   #3
RobbenStijn
Member
 
Location: Amsterdam

Join Date: Feb 2017
Posts: 12
Default

Hi Tristan Again!

I tried:

$ python BAM_BIGWIG.py Galaxy6RmDupdata.bam

This worked but it got me the following error:

Traceback (most recent call last):
File "BAM_BIGWIG.py", line 136, in <module>
main(*args, **kwargs)
File "BAM_BIGWIG.py", line 62, in main
convert_to_bigwig(wig_file, chr_sizes, config, outfile)
File "BAM_BIGWIG.py", line 108, in convert_to_bigwig
cl = [get_program("ucsc_bigwig", config, default="wigToBigWig"), wig_file, size_file, bw_file]
File "/Users/Stijn/anaconda/lib/python2.7/site-packages/bcbio/pipeline/config_utils.py", line 188, in get_program
return _get_program_cmd(name, pconfig, config, default)
File "/Users/Stijn/anaconda/lib/python2.7/site-packages/bcbio/pipeline/config_utils.py", line 214, in wrap
raise CmdNotFound(" ".join(map(repr, (fn.func_name, name, pconfig, default))))
bcbio.pipeline.config_utils.CmdNotFound: '_get_program_cmd' 'ucsc_bigwig' {'cmd': 'wigToBigWig', 'dir': 'wigToBigWig'} 'wigToBigWig'

Now I downloaded the wigToBigWig file and put it in the same directory as the python file, but I'm not sure if I'm supposed to do something with the wigToBigWig file now...
RobbenStijn is offline   Reply With Quote
Old 02-23-2017, 01:45 AM   #4
tristan dubos
Member
 
Location: France

Join Date: Dec 2015
Posts: 39
Default

Well dependency !!! Enjoy !!
Just a think what is the next step with your bigwig ? Are you making an annotation or something ?
I think you have to install wigToBigWig from UCSC (http://hgdownload.cse.ucsc.edu/admin/exe/) to solve the errors as you said. did you download the exe (wigToBigWig) ?
tristan dubos is offline   Reply With Quote
Old 02-23-2017, 01:53 AM   #5
RobbenStijn
Member
 
Location: Amsterdam

Join Date: Feb 2017
Posts: 12
Default

I clicked on your link, then on macOSX.i386/, then downloaded wigToBigWig.
I put this file in the same directory as my BIG_BIGWIG.py. But I still get the same error...
RobbenStijn is offline   Reply With Quote
Old 02-23-2017, 01:57 AM   #6
tristan dubos
Member
 
Location: France

Join Date: Dec 2015
Posts: 39
Default

I think you have to install it
tristan dubos is offline   Reply With Quote
Old 02-23-2017, 03:59 AM   #7
RobbenStijn
Member
 
Location: Amsterdam

Join Date: Feb 2017
Posts: 12
Default

Do you know how? Until now I just have the wigToBigWig file which isn't readable actually. Also the command:

$ pip install wigToBigWig

gives the following error:

Could not find a version that satisfies the requirement wigToBigWig (from versions: )
No matching distribution found for wigToBigWig
RobbenStijn is offline   Reply With Quote
Old 02-23-2017, 04:27 AM   #8
tristan dubos
Member
 
Location: France

Join Date: Dec 2015
Posts: 39
Default

It's an exe in linux you have use it using ./wigToBigWig , don't for mac. Same you have to give right to your system to use it and if it's call by BIG_BIGWIG.py you have to had the path to the exe to your system variables then it knows where found it. I hope i m understandable ...
tristan dubos is offline   Reply With Quote
Old 02-23-2017, 04:35 AM   #9
RobbenStijn
Member
 
Location: Amsterdam

Join Date: Feb 2017
Posts: 12
Default

I'm not sure I quite follow. I'm running this on a mac, so i think I clicked the right links?
And if I understand correctly I should not rename the python program?
RobbenStijn is offline   Reply With Quote
Old 02-23-2017, 05:54 AM   #10
tristan dubos
Member
 
Location: France

Join Date: Dec 2015
Posts: 39
Default

Sorry i miss a word i would say i don't know about mac. The think is if i understand right BIG_BIGWIG.py use wigToBigWig to calculate something, and to call it he need to know where is wigToBigWig.
tristan dubos is offline   Reply With Quote
Old 02-23-2017, 10:32 AM   #11
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

Code:
pip install --user deepTools
bamCoverage -b Galaxy6RmDupdata.bam -o Galaxy6RmDupdata.bigWig
dpryan is offline   Reply With Quote
Old 01-19-2018, 10:53 AM   #12
apredeus
Senior Member
 
Location: Bioinformatics Institute, SPb

Join Date: Jul 2012
Posts: 151
Default

Quote:
Originally Posted by dpryan View Post
Code:
pip install --user deepTools
bamCoverage -b Galaxy6RmDupdata.bam -o Galaxy6RmDupdata.bigWig
deepTools actually prove pretty hard to get to work - one conda environment and pip they fail to install with separate errors, and another conda environment they seem to install fine, but throw a segfault when executed.
apredeus is offline   Reply With Quote
Old 01-19-2018, 11:26 AM   #13
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

Quote:
Originally Posted by apredeus View Post
deepTools actually prove pretty hard to get to work - one conda environment and pip they fail to install with separate errors, and another conda environment they seem to install fine, but throw a segfault when executed.
It's rare to see reports of installation errors anymore, especially with conda. If you have installation errors with conda then it's likely that you managed to somehow break your conda installation. Without actual error messages or reproducible segfaults I can't be of any help.
dpryan is offline   Reply With Quote
Old 01-19-2018, 11:37 AM   #14
apredeus
Senior Member
 
Location: Bioinformatics Institute, SPb

Join Date: Jul 2012
Posts: 151
Default

Quote:
Originally Posted by dpryan View Post
It's rare to see reports of installation errors anymore, especially with conda.
I know, that's why I was surprised - two separate installations, two different errors!

Quote:
If you have installation errors with conda then it's likely that you managed to somehow break your conda installation. Without actual error messages or reproducible segfaults I can't be of any help.
So, in the instance when it appears to install without any errors, bamCoverage produces the following error:
bamCoverage
Traceback (most recent call last):
File "/home/apredeus/miniconda2/bin/bamCoverage", line 4, in <module>
from deeptools.bamCoverage import main
File "/home/apredeus/miniconda2/lib/python2.7/site-packages/deeptools/bamCoverage.py", line 8, in <module>
from deeptools import writeBedGraph # This should be made directly into a bigWig
File "/home/apredeus/miniconda2/lib/python2.7/site-packages/deeptools/writeBedGraph.py", line 9, in <module>
from deeptools.utilities import getCommonChrNames, toBytes
File "/home/apredeus/miniconda2/lib/python2.7/site-packages/deeptools/utilities.py", line 3, in <module>
import pysam
File "/home/apredeus/miniconda2/lib/python2.7/site-packages/pysam/__init__.py", line 5, in <module>
from pysam.libchtslib import *
ImportError: libhts.so.1: cannot open shared object file: No such file or directory
In another installation, it generates this error:
RuntimeError: module compiled against API version 0xb but this version of numpy is 0x7
Traceback (most recent call last):
File "/pub37/alexp/miniconda2/bin/bamCoverage", line 4, in <module>
from deeptools.bamCoverage import main
File "/pub37/alexp/miniconda2/lib/python2.7/site-packages/deeptools/bamCoverage.py", line 8, in <module>
from deeptools import writeBedGraph # This should be made directly into a bigWig
File "/pub37/alexp/miniconda2/lib/python2.7/site-packages/deeptools/writeBedGraph.py", line 5, in <module>
import pyBigWig
ImportError: numpy.core.multiarray failed to import
Seems like it doesn't have the HTS library in the first case, and is compiled against wrong numpy in the second. Couldn't figure out the way to fix either easily though, so ended up doing it the old way (bedtools + begGraphToBigWig).
apredeus is offline   Reply With Quote
Old 01-19-2018, 11:53 AM   #15
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

The first error is due to a broken pysam installation. Just remove pysam and reinstall it. The second error is due to changing the version of numpy installed (you want 1.13.*). As a rule of thumb, it's best to install conda packages in separate envs. That way (A) you can use multiple versions and (B) you can update/remove packages in one env without breaking them in another.
dpryan is offline   Reply With Quote
Old 01-19-2018, 12:05 PM   #16
apredeus
Senior Member
 
Location: Bioinformatics Institute, SPb

Join Date: Jul 2012
Posts: 151
Default

Thank you for the suggestions.
apredeus is offline   Reply With Quote
Reply

Tags
bam bigwig convert github

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 11:21 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO