This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Errors with sort-bed

I have bigwig file downloaded from GEO, and convert it to wig file using bigwigToWig (ftp://hgdownload.cse.ucsc.edu/apache/htdocs-rr/goldenPath/help/bigWig.html). And when I want to used sort-bed command in BEDOPS, it gives me error like this:

Non-numeric start coordinate. See line 1025 in GSM723005_H3K4me1-MEF.wig.

​But I checked manually and didn't find anything wrong in this file.

If I don't use sort-bed, but just use convert it to bed file by myself, then run BEDOPS, it returns me empty output file (although I think the file is already sorted).

Any idea what went wrong to my procedure?

Thank you very much!​

chip-seq bedops

are you trying to sort a WIG file with a sort-BED tool ??

yeah, Im trying to use sort-bed in BEDOPS, it is said the input could be wig file.

No, It does not say that.

It says that

The sort-bed utility requires one or more three-column BED file(s). Support for common headers (such as UCSC BED track headers) is included, although headers will be stripped from the output

Sorting arbitrarily large BED files is easy with sort-bed, which easily scales beyond available system memory, as needed. We also offer portable conversion scripts that transform data in common genomic formats (SAM/BAM, GFF/GTF, PSL, WIG, and VCF) to sorted BED data that are ready to use with core BEDOPS utilities.

http://bedops.readthedocs.org/en/latest/content/overview.html#bedops-tools-are-flexible

It's misleading

First, convert your wig file into bed. I would suggest to use wig2bed from bedops.

Then run sort-bed command on your converted file

yeah! i got it. tHANK YOU

1 answer

Sounds like you need to do something like:

$ wig2bed < GSM723005_H3K4me1-MEF.wig > GSM723005_H3K4me1-MEF.wig.bed

Like most BEDOPS apps, the wig2bed application exports sorted data by default, so you shouldn't need to pipe to sort-bed.

You would need to sort if you explicitly set wig2bed not to sort, as in the following:

$ wig2bed --do-not-sort < GSM723005_H3K4me1-MEF.wig | sort-bed - > GSM723005_H3K4me1-MEF.wig.bed

See wig2bed --help for a description and listing of options.

Log in to answer this question.