Question: BAM to BIGWIG
0
gravatar for robbenstijn
21 months ago by
robbenstijn0 wrote:

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

ADD COMMENTlink modified 21 months ago by EagleEye6.0k • written 21 months ago by robbenstijn0
2

Couldn't find the folder you want to use

For running a python script : ./ script.py or python script.py

ADD REPLYlink written 21 months ago by vmicrobio230

I tried this, but when I run:

python BAM_BIGWIG.py Galaxy6RmDupdata.bam (Galaxy6RmDupdata.bam is the name of my bam file)

I get:

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'
ADD REPLYlink modified 21 months ago by WouterDeCoster35k • written 21 months ago by robbenstijn0
1

I still can't find your python file Are you sure about the usage of the script?

ADD REPLYlink written 21 months ago by vmicrobio230

I renamed the bam_to_wiggle.py file from the link above to BAM_BIGWIG.py. Does this answer your question?

Thanks for your help btw!

ADD REPLYlink written 21 months ago by robbenstijn0

Is'nt the above mentioned python code only converts BAM to wiggle (NOT bigwig) ?

http://github.com/chapmanb/bcbb/blob/master/nextgen/scripts/bam_to_wiggle.py

ADD REPLYlink modified 21 months ago • written 21 months ago by EagleEye6.0k

you need to have wigToBigWig as mentioned in this post

ADD REPLYlink written 21 months ago by vmicrobio230

Okay I got it ... Thanks:)

ADD REPLYlink written 21 months ago by EagleEye6.0k

Yes about that, do you know how to install this?

What I did was that i went to this link: http://hgdownload.cse.ucsc.edu/admin/exe/ Clicked on macOSX.i386/ Clicked on wigToBigWig And then this file started to download. But I'll probably need to install it right? Now I posted it in the same directory as the python file, but it still gives the same error messages as is shown above... Also the command pip install wigToBigWig in the terminal doesn't work, this only gives:

Could not find a version that satisfies the requirement wigToBigWig (from versions: ) No matching distribution found for wigToBigWig

ADD REPLYlink written 21 months ago by robbenstijn0
1

There is no installation needed. You are downloading a pre-compiled program. You may need to add execute permissions by doing sudo chmod u+x wigToBigWig. After that you can run it like ./wigToBigWig options from the directory where it is located.

ADD REPLYlink modified 21 months ago • written 21 months ago by genomax59k

I did just that and it worked. Now I get another error, would you happen to know what it means? Thanks!

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 109, in convert_to_bigwig
    subprocess.check_call(cl)
  File "/Users/Stijn/anaconda/lib/python2.7/subprocess.py", line 181, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/Users/Stijn/anaconda/lib/python2.7/subprocess.py", line 168, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/Users/Stijn/anaconda/lib/python2.7/subprocess.py", line 390, in __init__
    errread, errwrite)
  File "/Users/Stijn/anaconda/lib/python2.7/subprocess.py", line 1024, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
ADD REPLYlink modified 21 months ago by genomax59k • written 21 months ago by robbenstijn0

Error is about not finding a file/directory in your $PATH or the directly where you are running the command from. Can you post the full command you used?

ADD REPLYlink written 21 months ago by genomax59k

Are you sure that your version of macOS is 32 bit and not 64 bit. Try with 'macOSX.x86_64/' version.

ADD REPLYlink written 21 months ago by EagleEye6.0k

Hello robbenstijn!

It appears that your post has been cross-posted to another site: http://seqanswers.com/forums/showthread.php?t=74398

This is typically not recommended as it runs the risk of annoying people in both communities.

ADD REPLYlink written 21 months ago by WouterDeCoster35k
5
gravatar for EagleEye
21 months ago by
EagleEye6.0k
Sweden
EagleEye6.0k wrote:

1) samtools mpileup: Convert BAM to wiggle

2) twoBitInfo: Calculate chromosome sizes for hg19 or any genome you are dealing with

3) wigToBigWig: wiggle to bigWig

Note: For macOS select tool for appropriate OS from here

ADD COMMENTlink modified 21 months ago • written 21 months ago by EagleEye6.0k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1309 users visited in the last hour