bigWig (update for bedGraphToBigWig ~v357 and later)
- make sure the bedGraph files are sorted prior to bigWig conversion
I had trouble running the current version of the pipeline with a reference genome with chromosomes sorted as [chr1, chr2, chr3, ..., chr10, ... ] instead of [chr1, chr10, chr2,... ].
These changes ensures that the bedGraph files are sorted prior to running bedGraphToBigWig.
One thing I'm unsure about though is if the bedGraph files are needed later in the pipeline and if resorting the files would disrupt something.
Hi Karl,
apologies for the late reply and thanks for the contribution.
What kind of problems did you get? We have run the pipeline several times with references sorted by genomic position (as you wrote: chr1, chr2, ...) but never had problems.
Could you please share log files and/or the process error files with any relevant information?
Best, Emilio
Hi Emilo, of course...
The pipeline stops during the bigwig step. This is the command log:
The script runs if I sort the bedGraph files as suggested by these commits. If you say that it works for you, I will see if I can find some other reason this happens. One thing I can think of directly would be that I create the STAR reference before starting the pipeline. I also have another version of bedGraphToBigWig (v357)... I'll look into it.
Looks like there is an embarrassing mistake behind this... it occurred when testing to set the pipeline up with on BioConda and I didn't run the pipeline as per ususal... the copy-paste-demon added the --wig-ref-prefix - flag. I'm rerunning to make sure, but I'm convinced that that's it... I'll close this down when I confirmed it...
Ok, no problem.
The problem remained when I corrected the mistake reported above, but I think I figured it out. It comes down to the bedGraphToBigWig version.
I was testing my bioConda environment, and there were only version 357.
It comes down to that v308 does not check chromosome sorting, but v357 does. I added v308 to bioconda and now it seems to work as intended. I'm running a test over night to confirm that I have it right this time. This done, I'll push/share the environment.
I'll leave this PR here if you want to update bedGraphToBigWig at a later time point. Although perhaps a newer version of STAR compensates for this... I don't know :)