Convert BED(UCSC) to VCF
1
2
Entering edit mode
9.5 years ago

I am using liftOver to convert hg19-hg38. I made BED file from VCF to run liftOver. How can I convert output BED(HG38) to VCF format.

Assembly • 13k views
ADD COMMENT
2
Entering edit mode
9.5 years ago
komal.rathi ★ 4.1k

Instead of doing multiple conversions, you can use CrossMap to convert VCF (hg19) <-> VCF (hg38). Other than VCF, it can support SAM/BAM, Wiggle/BigWig, BED, GFF/GTF file formats.

Or you can use NCBI remap.

ADD COMMENT
1
Entering edit mode

I successfully run CrossMap. It was my first experience at Biostars and happened to be so nice. Thank you very much for your help.

ADD REPLY
0
Entering edit mode

Just curious--did you end up using either of my tweaks? Which one ended up working for you?

ADD REPLY
0
Entering edit mode

Thank you komal. I have installed CrossMap. I tried to run

python CrossMap.py

It generates following error message

Traceback (most recent call last):
  File "CrossMap.py", line 26, in <module>
    from cmmodule  import ireader
ImportError: No module named cmmodule

Do you think it is not properly installed?

ADD REPLY
2
Entering edit mode

cmmodule is a directory within CrossMap lib that contains python modules for CrossMap.py. I can think of two ways you can add the lib directory to your python path. You can do it in BASH by running something like

export PYTHONPATH=/home/user/CrossMap/usr/local/lib/python2.7/site-packages:$PYTHONPATH

taken from here: http://crossmap.sourceforge.net/#installation

After you export the directory to PYTHONPATH, you should be able to run CrossMap as usual. I don't like doing this since then it's in my path until my next logout. More importantly, I'll have to remember to export PYTHONPATH in every new session where I want to run CrossMap, and I know I'll forget this.

Instead, I added these three lines to my code just before import optparse, and the script adds lib to the python path on its own:

PARENTPATH = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
LIBPATH = os.path.join(PARENTPATH, "lib")
sys.path.append(LIBPATH)

As long as bin and lib are sister directories, this should work. Let me know if you want any more explanation about why it does.

ADD REPLY
0
Entering edit mode

Sir, I am having the same problem about running Crossmap. I got the same cmmodule error. But since I have python through home-brew. I guess it caused a problem. Could you help to solve my problem ? or I you could teach me how to catch a fish I would also be glad. Thank you very much for your help.

edit:

btw, my python site packages are located the path below.

/usr/local/lib/python2.7/site-packages
ADD REPLY
0
Entering edit mode

What python version did you use?

ADD REPLY
0
Entering edit mode

Python 2.7.3

ADD REPLY
0
Entering edit mode

I tried first and it worked.

export PYTHONPATH=/home/user/CrossMap/usr/local/lib/python2.7/site-packages:$PYTHONPATH
ADD REPLY
0
Entering edit mode

I am trying CrossMap but it requires chain file. Is there any way without using chain file?

ADD REPLY

Login before adding your answer.

Traffic: 2063 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6