This site is a beta test.
Question: BAM to BIGWIG
0
Entering edit mode
2.7 years ago
robbenstijn • 0

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 2.7 years ago robbenstijn • 0 • updated 2.7 years ago EagleEye 6.4k
Entering edit mode
2

Couldn't find the folder you want to use

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

ADD REPLYlink 2.7 years ago
vmicrobio
• 240
Entering edit mode
0

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 2.7 years ago
robbenstijn
• 0 • updated 2.7 years ago
WouterDeCoster
39k
Entering edit mode
1

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

ADD REPLYlink 2.7 years ago
vmicrobio
• 240
Entering edit mode
0

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 2.7 years ago
robbenstijn
• 0
Entering edit mode
0

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 2.7 years ago
EagleEye
6.4k
Entering edit mode
0

you need to have wigToBigWig as mentioned in this post

ADD REPLYlink 2.7 years ago
vmicrobio
• 240
Entering edit mode
0

Okay I got it ... Thanks:)

ADD REPLYlink 2.7 years ago
EagleEye
6.4k
Entering edit mode
0

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 2.7 years ago
robbenstijn
• 0
Entering edit mode
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 2.7 years ago
genomax
68k
Entering edit mode
0

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 2.7 years ago
robbenstijn
• 0 • updated 2.7 years ago
genomax
68k
Entering edit mode
0

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 2.7 years ago
genomax
68k
Entering edit mode
0

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

ADD REPLYlink 2.7 years ago
EagleEye
6.4k
Entering edit mode
0

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 2.7 years ago
WouterDeCoster
39k
6
Entering edit mode
2.7 years ago
EagleEye 6.4k
Sweden

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 2.7 years ago EagleEye 6.4k

Login before adding your answer.

Powered by the version 1.5.2