Ensembl / WiggleTools

Basic operations on the space of numerical functions defined on the genome using lazy evaluators for flexibility and efficiency
Apache License 2.0
142 stars 24 forks source link

No chromosome with 2 numbers in the output wig #48

Closed LucoLab closed 4 years ago

LucoLab commented 4 years ago

Trying to do (something that used to work one year ago) :

Didn't change the executable.

wiggletools write final.wig trim length.chromosomes.sorted.bed diff mean A.rep1.bw B.rep2.bw : C.control.bw To explain a little bit, I compute the mean of two replicates and remove the input signal. I don't remember the trim part but this is the part that creates the error. Without the trim part , the output is fine.

In output final.wig , I have only signal for chr1 to chr9 and (chrX / chrY).

I revert back these files (A.rep1.bw B.rep2.bw C.control.bw) to wig to check if also they were empty for chr10 for example but they contain signal for chromosomes with two numbers.

awk '{ print $1}' final.wig | sort -u

chr1 chr2 chr3 chr4 chr5 chr6 chr7 chr8 chr9 chrX chrY

Any ideas ?

My file with chrom length : length.chromosomes.sorted.bed diff

GL000008.2 0 209709 GL000009.2 0 201709 GL000194.1 0 191469 GL000195.1 0 182896 GL000205.2 0 185591 GL000208.1 0 92689 GL000213.1 0 164239 GL000214.1 0 137718 GL000216.2 0 176608 GL000218.1 0 161147 GL000219.1 0 179198 GL000220.1 0 161802 GL000221.1 0 155397 GL000224.1 0 179693 GL000225.1 0 211173 GL000226.1 0 15008 KI270302.1 0 2274 KI270303.1 0 1942 KI270304.1 0 2165 KI270305.1 0 1472 KI270310.1 0 1201 KI270311.1 0 12399 KI270312.1 0 998 KI270315.1 0 2276 KI270316.1 0 1444 KI270317.1 0 37690 KI270320.1 0 4416 KI270322.1 0 21476 KI270329.1 0 1040 KI270330.1 0 1652 KI270333.1 0 2699 KI270334.1 0 1368 KI270335.1 0 1048 KI270336.1 0 1026 KI270337.1 0 1121 KI270338.1 0 1428 KI270340.1 0 1428 KI270362.1 0 3530 KI270363.1 0 1803 KI270364.1 0 2855 KI270366.1 0 8320 KI270371.1 0 2805 KI270372.1 0 1650 KI270373.1 0 1451 KI270374.1 0 2656 KI270375.1 0 2378 KI270376.1 0 1136 KI270378.1 0 1048 KI270379.1 0 1045 KI270381.1 0 1930 KI270382.1 0 4215 KI270383.1 0 1750 KI270384.1 0 1658 KI270385.1 0 990 KI270386.1 0 1788 KI270387.1 0 1537 KI270388.1 0 1216 KI270389.1 0 1298 KI270390.1 0 2387 KI270391.1 0 1484 KI270392.1 0 971 KI270393.1 0 1308 KI270394.1 0 970 KI270395.1 0 1143 KI270396.1 0 1880 KI270411.1 0 2646 KI270412.1 0 1179 KI270414.1 0 2489 KI270417.1 0 2043 KI270418.1 0 2145 KI270419.1 0 1029 KI270420.1 0 2321 KI270422.1 0 1445 KI270423.1 0 981 KI270424.1 0 2140 KI270425.1 0 1884 KI270429.1 0 1361 KI270435.1 0 92983 KI270438.1 0 112505 KI270442.1 0 392061 KI270448.1 0 7992 KI270465.1 0 1774 KI270466.1 0 1233 KI270467.1 0 3920 KI270468.1 0 4055 KI270507.1 0 5353 KI270508.1 0 1951 KI270509.1 0 2318 KI270510.1 0 2415 KI270511.1 0 8127 KI270512.1 0 22689 KI270515.1 0 6361 KI270516.1 0 1300 KI270517.1 0 3253 KI270518.1 0 2186 KI270519.1 0 138126 KI270521.1 0 7642 KI270522.1 0 5674 KI270528.1 0 2983 KI270529.1 0 1899 KI270530.1 0 2168 KI270538.1 0 91309 KI270539.1 0 993 KI270544.1 0 1202 KI270548.1 0 1599 KI270579.1 0 31033 KI270580.1 0 1553 KI270581.1 0 7046 KI270582.1 0 6504 KI270583.1 0 1400 KI270584.1 0 4513 KI270587.1 0 2969 KI270588.1 0 6158 KI270589.1 0 44474 KI270590.1 0 4685 KI270591.1 0 5796 KI270593.1 0 3041 KI270706.1 0 175055 KI270707.1 0 32032 KI270708.1 0 127682 KI270709.1 0 66860 KI270710.1 0 40176 KI270711.1 0 42210 KI270712.1 0 176043 KI270713.1 0 40745 KI270714.1 0 41717 KI270715.1 0 161471 KI270716.1 0 153799 KI270717.1 0 40062 KI270718.1 0 38054 KI270719.1 0 176845 KI270720.1 0 39050 KI270721.1 0 100316 KI270722.1 0 194050 KI270723.1 0 38115 KI270724.1 0 39555 KI270725.1 0 172810 KI270726.1 0 43739 KI270727.1 0 448248 KI270728.1 0 1872759 KI270729.1 0 280839 KI270730.1 0 112551 KI270731.1 0 150754 KI270732.1 0 41543 KI270733.1 0 179772 KI270734.1 0 165050 KI270735.1 0 42811 KI270736.1 0 181920 KI270737.1 0 103838 KI270738.1 0 99375 KI270739.1 0 73985 KI270740.1 0 37240 KI270741.1 0 157432 KI270742.1 0 186739 KI270743.1 0 210658 KI270744.1 0 168472 KI270745.1 0 41891 KI270746.1 0 66486 KI270747.1 0 198735 KI270748.1 0 93321 KI270749.1 0 158759 KI270750.1 0 148850 KI270751.1 0 150742 KI270752.1 0 27745 KI270753.1 0 62944 KI270754.1 0 40191 KI270755.1 0 36723 KI270756.1 0 79590 KI270757.1 0 71251 chr1 0 248956422 chr10 0 133797422 chr11 0 135086622 chr12 0 133275309 chr13 0 114364328 chr14 0 107043718 chr15 0 101991189 chr16 0 90338345 chr17 0 83257441 chr18 0 80373285 chr19 0 58617616 chr2 0 242193529 chr20 0 64444167 chr21 0 46709983 chr22 0 50818468 chr3 0 198295559 chr4 0 190214555 chr5 0 181538259 chr6 0 170805979 chr7 0 159345973 chr8 0 145138636 chr9 0 138394717 chrM 0 16569 chrX 0 156040895 chrY 0 57227415

dzerbino commented 4 years ago

Hello @LucoLab ,

Please disregard my previous suggestion (deleted from this thread to reduce confusion), your chromosome length file was indeed sorted alphabetically (d'oh!).

Nonetheless, it feels strongly like a sorting issue. If the chromosomes are not visited in the same order across both files, trouble will ensue.

What happens if you do:

wiggletools write_bg - diff mean A.rep1.bw B.rep2.bw : C.control.bw | cut -f1 | uniq

The order of appearance of the chromosomes should correspond to that of the chromosome length file.

Cheers,

Daniel

LucoLab commented 4 years ago

Ok they are not in the same order as length.chromosomes.sorted.bed diff :

wiggletools write_bg - diff mean A.rep1.bw B.rep2.bw : C.control.bw | cut -f1 | uniq

So I will try to sort length.chromosomes.sorted.bed as the order given by your command.

The wig where created by bamCoverage from deeptools(3.3.1) and it's possible we update this tool recently. So they may have made some changes in their sort process. (or I may have change the order of length.chromosomes file..)

chr1
chr2
chr3
chr4
chr5
chr6
chr7
chr8
chr9
chr10
chr11
chr12
chr13
chr14
chr15
chr16
chr17
chr18
chr19
chr20
chr21
chr22
chrX
chrY
chrM
GL000008.2
GL000009.2
GL000194.1
GL000195.1
GL000205.2
GL000208.1
GL000213.1
GL000214.1
GL000216.2
GL000218.1
GL000219.1
GL000220.1
GL000221.1
GL000224.1
GL000225.1
GL000226.1
KI270302.1
KI270303.1
KI270304.1
KI270305.1
KI270310.1
KI270311.1
KI270312.1
KI270315.1
KI270316.1
KI270317.1
KI270320.1
KI270322.1
KI270329.1
KI270330.1
KI270333.1
KI270334.1
KI270335.1
KI270336.1
KI270337.1
KI270338.1
KI270340.1
KI270362.1
KI270363.1
KI270364.1
KI270366.1
KI270371.1
KI270372.1
KI270373.1
KI270374.1
KI270375.1
KI270376.1
KI270378.1
KI270379.1
KI270381.1
KI270382.1
KI270383.1
KI270384.1
KI270385.1
KI270386.1
KI270387.1
KI270388.1
KI270389.1
KI270390.1
KI270391.1
KI270392.1
KI270393.1
KI270394.1
KI270395.1
KI270396.1
KI270411.1
KI270412.1
KI270414.1
KI270417.1
KI270418.1
KI270419.1
KI270420.1
KI270422.1
KI270423.1
KI270424.1
KI270425.1
KI270429.1
KI270435.1
KI270438.1
KI270442.1
KI270448.1
KI270465.1
KI270466.1
KI270467.1
KI270468.1
KI270507.1
KI270508.1
KI270509.1
KI270510.1
KI270511.1
KI270512.1
KI270515.1
KI270516.1
KI270517.1
KI270518.1
KI270519.1
KI270521.1
KI270522.1
KI270528.1
KI270529.1
KI270530.1
KI270538.1
KI270539.1
KI270544.1
KI270548.1
KI270579.1
KI270580.1
KI270581.1
KI270582.1
KI270583.1
KI270584.1
KI270587.1
KI270588.1
KI270589.1
KI270590.1
KI270591.1
KI270593.1
KI270706.1
KI270707.1
KI270708.1
KI270709.1
KI270710.1
KI270711.1
KI270712.1
KI270713.1
KI270714.1
KI270715.1
KI270716.1
KI270717.1
KI270718.1
KI270719.1
KI270720.1
KI270721.1
KI270722.1
KI270723.1
KI270724.1
KI270725.1
KI270726.1
KI270727.1
KI270728.1
KI270729.1
KI270730.1
KI270731.1
KI270732.1
KI270733.1
KI270734.1
KI270735.1
KI270736.1
KI270737.1
KI270738.1
KI270739.1
KI270740.1
KI270741.1
KI270742.1
KI270743.1
KI270744.1
KI270745.1
KI270746.1
KI270747.1
KI270748.1
KI270749.1
KI270750.1
KI270751.1
KI270752.1
KI270753.1
KI270754.1
KI270755.1
KI270756.1
KI270757.1
LucoLab commented 4 years ago

Using a file sorted as the output of your command gives me an error :

Bed file length.chromosomes.bed is not sorted!
Position chr10:1 is before chr9:1

File used length.chromosomes.bed:

chr1 0 248956422 chr2 0 242193529 chr3 0 198295559 chr4 0 190214555 chr5 0 181538259 chr6 0 170805979 chr7 0 159345973 chr8 0 145138636 chr9 0 138394717 chr10 0 133797422 chr11 0 135086622 chr12 0 133275309 chr13 0 114364328 chr14 0 107043718 chr15 0 101991189 chr16 0 90338345 chr17 0 83257441 chr18 0 80373285 chr19 0 58617616 chr20 0 64444167 chr21 0 46709983 chr22 0 50818468 chrX 0 156040895 chrY 0 57227415 chrM 0 16569 GL000008.2 0 209709 GL000009.2 0 201709 GL000194.1 0 191469 GL000195.1 0 182896 GL000205.2 0 185591 GL000208.1 0 92689 GL000213.1 0 164239 GL000214.1 0 137718 GL000216.2 0 176608 GL000218.1 0 161147 GL000219.1 0 179198 GL000220.1 0 161802 GL000221.1 0 155397 GL000224.1 0 179693 GL000225.1 0 211173 GL000226.1 0 15008 KI270302.1 0 2274 KI270303.1 0 1942 KI270304.1 0 2165 KI270305.1 0 1472 KI270310.1 0 1201 KI270311.1 0 12399 KI270312.1 0 998 KI270315.1 0 2276 KI270316.1 0 1444 KI270317.1 0 37690 KI270320.1 0 4416 KI270322.1 0 21476 KI270329.1 0 1040 KI270330.1 0 1652 KI270333.1 0 2699 KI270334.1 0 1368 KI270335.1 0 1048 KI270336.1 0 1026 KI270337.1 0 1121 KI270338.1 0 1428 KI270340.1 0 1428 KI270362.1 0 3530 KI270363.1 0 1803 KI270364.1 0 2855 KI270366.1 0 8320 KI270371.1 0 2805 KI270372.1 0 1650 KI270373.1 0 1451 KI270374.1 0 2656 KI270375.1 0 2378 KI270376.1 0 1136 KI270378.1 0 1048 KI270379.1 0 1045 KI270381.1 0 1930 KI270382.1 0 4215 KI270383.1 0 1750 KI270384.1 0 1658 KI270385.1 0 990 KI270386.1 0 1788 KI270387.1 0 1537 KI270388.1 0 1216 KI270389.1 0 1298 KI270390.1 0 2387 KI270391.1 0 1484 KI270392.1 0 971 KI270393.1 0 1308 KI270394.1 0 970 KI270395.1 0 1143 KI270396.1 0 1880 KI270411.1 0 2646 KI270412.1 0 1179 KI270414.1 0 2489 KI270417.1 0 2043 KI270418.1 0 2145 KI270419.1 0 1029 KI270420.1 0 2321 KI270422.1 0 1445 KI270423.1 0 981 KI270424.1 0 2140 KI270425.1 0 1884 KI270429.1 0 1361 KI270435.1 0 92983 KI270438.1 0 112505 KI270442.1 0 392061 KI270448.1 0 7992 KI270465.1 0 1774 KI270466.1 0 1233 KI270467.1 0 3920 KI270468.1 0 4055 KI270507.1 0 5353 KI270508.1 0 1951 KI270509.1 0 2318 KI270510.1 0 2415 KI270511.1 0 8127 KI270512.1 0 22689 KI270515.1 0 6361 KI270516.1 0 1300 KI270517.1 0 3253 KI270518.1 0 2186 KI270519.1 0 138126 KI270521.1 0 7642 KI270522.1 0 5674 KI270528.1 0 2983 KI270529.1 0 1899 KI270530.1 0 2168 KI270538.1 0 91309 KI270539.1 0 993 KI270544.1 0 1202 KI270548.1 0 1599 KI270579.1 0 31033 KI270580.1 0 1553 KI270581.1 0 7046 KI270582.1 0 6504 KI270583.1 0 1400 KI270584.1 0 4513 KI270587.1 0 2969 KI270588.1 0 6158 KI270589.1 0 44474 KI270590.1 0 4685 KI270591.1 0 5796 KI270593.1 0 3041 KI270706.1 0 175055 KI270707.1 0 32032 KI270708.1 0 127682 KI270709.1 0 66860 KI270710.1 0 40176 KI270711.1 0 42210 KI270712.1 0 176043 KI270713.1 0 40745 KI270714.1 0 41717 KI270715.1 0 161471 KI270716.1 0 153799 KI270717.1 0 40062 KI270718.1 0 38054 KI270719.1 0 176845 KI270720.1 0 39050 KI270721.1 0 100316 KI270722.1 0 194050 KI270723.1 0 38115 KI270724.1 0 39555 KI270725.1 0 172810 KI270726.1 0 43739 KI270727.1 0 448248 KI270728.1 0 1872759 KI270729.1 0 280839 KI270730.1 0 112551 KI270731.1 0 150754 KI270732.1 0 41543 KI270733.1 0 179772 KI270734.1 0 165050 KI270735.1 0 42811 KI270736.1 0 181920 KI270737.1 0 103838 KI270738.1 0 99375 KI270739.1 0 73985 KI270740.1 0 37240 KI270741.1 0 157432 KI270742.1 0 186739 KI270743.1 0 210658 KI270744.1 0 168472 KI270745.1 0 41891 KI270746.1 0 66486 KI270747.1 0 198735 KI270748.1 0 93321 KI270749.1 0 158759 KI270750.1 0 148850 KI270751.1 0 150742 KI270752.1 0 27745 KI270753.1 0 62944 KI270754.1 0 40191 KI270755.1 0 36723 KI270756.1 0 79590 KI270757.1 0 7125

dzerbino commented 4 years ago

Hello again,

This probably boils down to sorting functions, which are tied to Unix locale.

To be clear: the order of chromosomes chr1, chr2, chr3... chr9, chr10... came from the wiggletools write_bg - diff mean A.rep1.bw B.rep2.bw : C.control.bw | cut -f1 | uniq command or from your wig file? Note that the bigwig files are not read in the same order as wigs.

Cheers,

Daniel

LucoLab commented 4 years ago

Yes they came from your command.

wiggletools write_bg - diff mean A.rep1.bw B.rep2.bw : C.control.bw | cut -f1 | uniq

Then I tried to do again with length.chromosomes.bed ordered as the result of your command.

wiggletools write final.wig trim length.chromosomes.bed diff mean A.rep1.bw B.rep2.bw : C.control.bw

It's where I have the error but it's weird because chr9 is before chr10 in length.chromosomes.bed.

Bed file length.chromosomes.bed is not sorted!
Position chr10:1 is before chr9:1
dzerbino commented 4 years ago

OK, so the issue is that the first command is reading the chromosomes in an arbitrary order (that used when creating the BigWig file) which is not the order expected by WiggleTools.

I'll have to correct this.

LucoLab commented 4 years ago

Ok thanks !

dzerbino commented 4 years ago

I've just pushed a commit on the master branch, could you please re-compile and give it a spin?

LucoLab commented 4 years ago

I'll give a try.

LucoLab commented 4 years ago

Hummm I tried to recompile but got some errors. Any advices to correct and go faster.

make

cd src; make -e make[1]: Entering directory '/home/jean-philippe.villemin/bin/WiggleTools/new_version/WiggleTools-master/src' /home/jean-philippe.villemin/bin/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -I../../libBigWig -I../../htslib -D_PBGZF_USE -c bigWiggleReader.c -o bigWiggleReader.o In file included from ../../libBigWig/bigWig.h:4:0, from bigWiggleReader.c:16: ../../libBigWig/bigWigIO.h:5:10: fatal error: curl/curl.h: No such file or directory

include <curl/curl.h>

      ^~~~~~~~~~~~~

compilation terminated.

I am on

Debian 3.16.74-1 (2019-09-24) x86_64 GNU/Linux

Previous lib are installed (from my .profile) :

export C_INCLUDE_PATH="$HOME/bin/gsl-2.3/bin/include:$HOME/bin/libBigWig/bin/include:$HOME/bin/htslib/bin/include" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/bin/libBigWig/bin/lib:$HOME/bin/gsl-2.3/bin/lib:$HOME/bin/htslib/bin/lib"

Not sure it was a good idea but I tried to install previous in my conda env but compilation is still failing due to the curl.h file.

conda install -c conda-forge gsl conda install -c bioconda libbigwig conda install -c anaconda curl

dzerbino commented 4 years ago

Hello,

Were you able to compile the libBigWig library independently in the first place?

Cheers,

Daniel

LucoLab commented 4 years ago

Initially a long time ago yes, I tried to re-compile with the last version from your link but with no sucess(still curl problem). In libbigwig dir :

make

/home/jean-philippe.villemin/bin/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc -I. -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -c -o io.o io.c io.c:2:10: fatal error: curl/curl.h: No such file or directory

include <curl/curl.h>

      ^~~~~~~~~~~~~

compilation terminated. make: *** [Makefile:33: io.o] Error 1

dzerbino commented 4 years ago

Hmm, if you installed curl with conda, I'm guessing you need to expand you C_INCLUDE_PATH and LD_LIBRARY_PATH to point to wherever conda drops headers and libs?

LucoLab commented 4 years ago

Yeahhh , I will look later because I need to grap the kids at school, sorry . But curl.h is on my system even at different locations so yeah my config need to be clean up. I ll tell you. But I m in coda env so it should find it after a conda install and shoul not take into account old C_INCLUDE...anyway, I might be wrong.Thanks for you time, have a good weekend.

locate curl.h

/home/jean-philippe.villemin/bin/anaconda3/include/curl/curl.h /home/jean-philippe.villemin/bin/anaconda3/pkgs/libcurl-7.65.2-h20c2e04_0/include/curl/curl.h /home/jean-philippe.villemin/bin/anaconda3_4.5.11/envs/majiq_env/include/curl/curl.h /home/jean-philippe.villemin/bin/anaconda3_4.5.11/envs/outrigger-env/include/curl/curl.h /home/jean-philippe.villemin/bin/anaconda3_4.5.11/envs/python2/include/curl/curl.h /home/jean-philippe.villemin/bin/anaconda3_4.5.11/envs/r_env/include/curl/curl.h /home/jean-philippe.villemin/bin/anaconda3_4.5.11/include/curl/curl.h /home/jean-philippe.villemin/bin/anaconda3_4.5.11/pkgs/curl-7.52.1-0/include/curl/curl.h /home/jean-philippe.villemin/bin/anaconda3_4.5.11/pkgs/curl-7.55.1-h78862de_4/include/curl/curl.h /home/jean-philippe.villemin/bin/anaconda3_4.5.11/pkgs/curl-7.55.1-hcb0b314_2/include/curl/curl.h /home/jean-philippe.villemin/bin/anaconda3_4.5.11/pkgs/libcurl-7.61.0-h1ad7b7a_0/include/curl/curl.h /home/jean-philippe.villemin/bin/anaconda3_4.5.11/pkgs/libcurl-7.64.0-h01ee5af_0/include/curl/curl.h /home/jean-philippe.villemin/bin/anaconda3_4.5.11/pkgs/libcurl-7.65.3-h20c2e04_0/include/curl/curl.h /home/jean-philippe.villemin/bin/cmake-3.8.1/Utilities/cm_curl.h /home/jean-philippe.villemin/bin/cmake-3.8.1/Utilities/cmcurl/include/curl/curl.h /home/jean-philippe.villemin/bin/packages_R-3.3.1/include/curl/curl.h /usr/include/curl/curl.h

LucoLab commented 4 years ago

Outside conda env, it's not complaining about curl but still errors (not related to missing things I think) :

cd src; make -e make[1]: Entering directory '/home/jean-philippe.villemin/bin/WiggleTools-upgraded/src' cc -g -Wall -O3 -std=gnu99 -I../../libBigWig -I../../htslib -D_PBGZF_USE -c bigWiggleReader.c -o bigWiggleReader.o bigWiggleReader.c: In function ‘BigWiggleReaderSeek’: bigWiggleReader.c:108:14: warning: assignment discards ‘const’ qualifier from pointer target type data->chrom = chrom; ^ cc -g -Wall -O3 -std=gnu99 -I../../libBigWig -I../../htslib -D_PBGZF_USE -c multiplexer.c -o multiplexer.o

cc -g -Wall -O3 -std=gnu99 -I../../libBigWig -I../../htslib -D_PBGZF_USE -c reducers.c -o reducers.o cc -g -Wall -O3 -std=gnu99 -I../../libBigWig -I../../htslib -D_PBGZF_USE -c bedReader.c -o bedReader.o bedReader.c: In function ‘BedReaderSeek’: bedReader.c:95:14: warning: assignment discards ‘const’ qualifier from pointer target type data->chrom = chrom; ^ cc -g -Wall -O3 -std=gnu99 -I../../libBigWig -I../../htslib -D_PBGZF_USE -c bigBedReader.c -o bigBedReader.o bigBedReader.c: In function ‘BigBedReaderSeek’: bigBedReader.c:109:14: warning: assignment discards ‘const’ qualifier from pointer target type data->chrom = chrom; ^ cc -g -Wall -O3 -std=gnu99 -I../../libBigWig -I../../htslib -D_PBGZF_USE -c bamReader.c -o bamReader.o bamReader.c: In function ‘BamReaderSeek’: bamReader.c:227:14: warning: assignment discards ‘const’ qualifier from pointer target type data->chrom = chrom; ^ cc -g -Wall -O3 -std=gnu99 -I../../libBigWig -I../../htslib -D_PBGZF_USE -c apply.c -o apply.o cc -g -Wall -O3 -std=gnu99 -I../../libBigWig -I../../htslib -D_PBGZF_USE -c commandParser.c -o commandParser.o cc -g -Wall -O3 -std=gnu99 -I../../libBigWig -I../../htslib -D_PBGZF_USE -c wigWriter.c -o wigWriter.o cc -g -Wall -O3 -std=gnu99 -I../../libBigWig -I../../htslib -D_PBGZF_USE -c statistics.c -o statistics.o cc -g -Wall -O3 -std=gnu99 -I../../libBigWig -I../../htslib -D_PBGZF_USE -c unaryOps.c -o unaryOps.o cc -g -Wall -O3 -std=gnu99 -I../../libBigWig -I../../htslib -D_PBGZF_USE -c multiSet.c -o multiSet.o cc -g -Wall -O3 -std=gnu99 -I../../libBigWig -I../../htslib -D_PBGZF_USE -c setComparisons.c -o setComparisons.o cc -g -Wall -O3 -std=gnu99 -I../../libBigWig -I../../htslib -D_PBGZF_USE -c bufferedReader.c -o bufferedReader.o bufferedReader.c: In function ‘compare_chrom_lengths’: bufferedReader.c:188:2: warning: implicit declaration of function ‘strcmp’ [-Wimplicit-function-declaration] return strcmp(cl_A->chrom, cl_B->chrom); ^ cc -g -Wall -O3 -std=gnu99 -I../../libBigWig -I../../htslib -D_PBGZF_USE -c vcfReader.c -o vcfReader.o vcfReader.c: In function ‘VcfReaderSeek’: vcfReader.c:70:14: warning: assignment discards ‘const’ qualifier from pointer target type data->chrom = chrom; ^ cc -g -Wall -O3 -std=gnu99 -I../../libBigWig -I../../htslib -D_PBGZF_USE -c bcfReader.c -o bcfReader.o bcfReader.c: In function ‘downloadBCFFile’: bcfReader.c:53:52: warning: passing argument 2 of ‘pushValuesToBuffer’ discards ‘const’ qualifier from pointer target type if (pushValuesToBuffer(data->bufferedReaderData, bcf_hdr_id2name(data->bcf_header, vcf_line->rid), vcf_line->pos+1, vcf_line->pos+2, 1)) ^ In file included from bcfReader.c:19:0: bufferedReader.h:30:6: note: expected ‘char ’ but argument is of type ‘const char ’ bool pushValuesToBuffer(BufferedReaderData data, char chrom, int start, int finish, double value); ^ bcfReader.c: In function ‘BcfReaderSeek’: bcfReader.c:94:14: warning: assignment discards ‘const’ qualifier from pointer target type data->chrom = chrom; ^ cc -g -Wall -O3 -std=gnu99 -I../../libBigWig -I../../htslib -D_PBGZF_USE -c plots.c -o plots.o cc -g -Wall -O3 -std=gnu99 -I../../libBigWig -I../../htslib -D_PBGZF_USE -c mWigWriter.c -o mWigWriter.o cc -g -Wall -O3 -std=gnu99 -I../../libBigWig -I../../htslib -D_PBGZF_USE -c recycleBin.c -o recycleBin.o cc -g -Wall -O3 -std=gnu99 -I../../libBigWig -I../../htslib -D_PBGZF_USE -c fib.c -o fib.o cc -g -Wall -O3 -std=gnu99 -I../../libBigWig -I../../htslib -D_PBGZF_USE -c samReader.c -o samReader.o samReader.c: In function ‘SamReaderSeek’: samReader.c:186:14: warning: assignment discards ‘const’ qualifier from pointer target type data->chrom = chrom; ^ mkdir -p ../lib ar rcs ../lib/libwiggletools.a *.o cc -g -Wall -O3 -std=gnu99 -I../../libBigWig -I../../htslib -D_PBGZF_USE -c wiggletools.c -o wiggletools.o mkdir -p ../bin cc -g -Wall -O3 -std=gnu99 -L../lib -L../../libBigWig -L../../htslib wiggletools.c -lwiggletools -l:libBigWig.a -lcurl -l:libhts.a -lgsl -lgslcblas -lz -lpthread -lm -llzma -lbz2 -o ../bin/wiggletools /usr/bin/ld: ../lib/libwiggletools.a(wigReader.o): unrecognized relocation (0x29) in section `.text.WiggleReaderSeek' /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status make[1]: [Makefile:15: ../bin/wiggletools] Error 1 make[1]: Leaving directory '/home/jean-philippe.villemin/bin/WiggleTools-upgraded/src' make: [Makefile:7: Wiggletools] Error 2

dzerbino commented 4 years ago

That's new, I've never seen such a linker error in many years of C programming!

Apparently it's due to multiple version of ld being used.

Let's start with the basics, could you please do make clean; make ?

(You can ignore the warnings about const)

LucoLab commented 4 years ago

Ok it worked I think. Thanks. The executable is created. I will do some test now using length.chromosomes.bed.

dzerbino commented 4 years ago

Ace! Thanks for the rapid responses and detailed report, much appreciated!