Author Topic: Issue with convert2bed  (Read 5920 times)

catcha

  • Newbie
  • *
  • Posts: 1
Issue with convert2bed
« on: October 15, 2015, 10:33:58 PM »
I have been trying to use convert2bed to convert wig files from ucsc to bed. However I keep getting the same message:

Code: [Select]
$ ./convert2bed --input=wig [--output=bed] < GSM980987_WT_rep3_CG.wig > GSM980987_WT_rep3_CG.bed
Error: Cannot find sort-bed binary required for sorting BED output
convert2bed
  version: 2.4.13
  author:  Alex Reynolds

I've looked for the sort-bed binary and it seems to be fine:
Code: [Select]
$ ./sort-bed
sort-bed
  citation: http://bioinformatics.oxfordjournals.org/content/28/14/1919.abstract
  version:  2.4.14
  authors:  Scott Kuehn

USAGE: sort-bed [--help] [--version] [--check-sort] [--max-mem <val>] [--tmpdir <path>] <file1.bed> <file2.bed> <...>
        Sort BED file(s).
        May use '-' to indicate stdin.
        Results are sent to stdout.

        <val> for --max-mem may be 8G, 8000M, or 8000000000 to specify 8 GB of memory.
        --tmpdir is useful only with --max-mem.

I'm not sure what the issue is.  Could it be my input wig file.  Its current format is:
Code: [Select]
$ head GSM980987_WT_rep3_CG.wig
track type=wiggle_0 name="WT rep3 mCG" description="WT replicate 3 mCG Stroud et al" visibility=full color=0,100,0 graphType=bar
variableStep chrom=chr1
109     1
110     -0.95
115     0.833333
116     -1
161     0.933333
162     -0.8
310     0.777778
311     -0.833333

Any help would be greatly appreciated.

sjn

  • Administrator
  • Jr. Member
  • *****
  • Posts: 72
Re: Issue with convert2bed
« Reply #1 on: October 16, 2015, 06:26:24 AM »
Try:

convert2bed --input wig --output bed < GSM980987_WT_rep3_CG.wig > GSM980987_WT_rep3_CG.bed

There is a script that wraps convert2bed specifically for this use (and makes the syntax easier):

wig2bed < GSM980987_WT_rep3_CG.wig > GSM980987_WT_rep3_CG.bed


AlexReynolds

  • Administrator
  • Jr. Member
  • *****
  • Posts: 72
Re: Issue with convert2bed
« Reply #2 on: October 16, 2015, 04:36:07 PM »
Your environment's PATH variable setting helps your shell find the applications you want to run.

So also make sure all your BEDOPS binaries are available from your environment PATH.

Usually, this means editing .bash_profile (or similar, depending on your shell) to include your current directory (which contains convert2bed and sort-bed etc.) in your PATH, or instead copying the BEDOPS binaries to /usr/local/bin or a similar folder that is already in your PATH.

If you're not sure what your PATH variable is set to, type echo $PATH and see what it says.