Augustus icon indicating copy to clipboard operation
Augustus copied to clipboard

augustus-3.3.2: auxprogs/bam2wig dependencies are incorrect

Open mmokrejs opened this issue 5 years ago • 13 comments

It does not seem one needs any of the following to link:

$(HTSLIB)/libhts.a -lcurses -lm -lz -lpthread -lcurl -lssl -lcrypto, only -lbam is needed.

mmokrejs avatar Mar 29 '19 12:03 mmokrejs

The dependencies of bam2wig have been kind of a nuisance. We now have a Python3 script that utilizes samtools directly and does not require linking of any kind: https://github.com/Gaius-Augustus/Augustus/commit/3da1d64553bafb7d0a80decea0b09e11dfd4a872

bamToWig.py lowers the priority of this issue. bam2wig might become deprecated.

KatharinaHoff avatar Aug 26 '19 11:08 KatharinaHoff

Hi, I am struggling with bam2wig as well. I followed the instructions here https://github.com/Gaius-Augustus/Augustus/blob/master/auxprogs/bam2wig/README.txt and installed bcftools, samtools and htslib, all in the same place. The last command doesn't make sense to me. Why type in make when bam2wig doesn't have a make file? Accordingly, I can't install Augustus, because it is missing bam2wig. I'd be happy to use bamtoWig instead, but do I implement it? I'd be really thankful for a pointer here... Best, Mathilde

PopGenHamburg avatar Oct 08 '19 14:10 PopGenHamburg

bam2wig does have a Makefile: https://github.com/Gaius-Augustus/Augustus/blob/master/auxprogs/bam2wig/Makefile

It shouldn't be a problem to compile AUGUSTUS without bam2wig. Except from the main Makefile of Augustus:

all: mkdir -p bin cd src && ${MAKE} cd auxprogs && ${MAKE} This means, AUGUSTUS is compiled before any of the auxprogs are touched.

In the auxprogs/Makefile, only utrrnaseq was after bam2wig. I altered that order with commit https://github.com/Gaius-Augustus/Augustus/commit/1eaf5ae1d65696c13bd8d876f70bc9004ce7f5b2 . So it really shouldn't matter if compilation of bam2wig fails, since in practice, you can simply use bamToWig.py to accomplish the same task.

KatharinaHoff avatar Oct 14 '19 09:10 KatharinaHoff

I'm also having issues with bamToWig:

ERROR in file /packages/braker/2.1.4/scripts/braker.pl at line 10244 Failed to execute: /packages/python/3.6.7/bin/python3 /gpfs/packages/augustus/3.3.3/scripts/bamToWig.py -b /gpfs/projects/nereus/mcurrey/ptae/annotate/braker/rnaseq_plus.s.bam -g /gpfs/projects/nereus/mcurrey/ptae/annotate/braker/genome.fa -o /gpfs/projects/nereus/mcurrey/ptae/annotate/braker/rnaseq_plus.wig 2> /gpfs/projects/nereus/mcurrey/ptae/annotate/braker/errors/bamToWig_plus.err

Traceback (most recent call last): File "/gpfs/packages/augustus/3.3.3/scripts/bamToWig.py", line 154, in with urllib.request.urlopen(tool_url) as response, open(key, 'wb') as out_file: AttributeError: module 'urllib' has no attribute ‘request'

fishes2catch avatar Oct 15 '19 21:10 fishes2catch

Please update sources from github. This issue has been fixed.

On Tue 15. Oct 2019 at 23:01, Mark Currey [email protected] wrote:

I'm also having issues with bamToWig:

ERROR in file /packages/braker/2.1.4/scripts/braker.pl at line 10244 Failed to execute: /packages/python/3.6.7/bin/python3 /gpfs/packages/augustus/3.3.3/scripts/bamToWig.py -b /gpfs/projects/nereus/mcurrey/ptae/annotate/braker/rnaseq_plus.s.bam -g /gpfs/projects/nereus/mcurrey/ptae/annotate/braker/genome.fa -o /gpfs/projects/nereus/mcurrey/ptae/annotate/braker/rnaseq_plus.wig 2> /gpfs/projects/nereus/mcurrey/ptae/annotate/braker/errors/bamToWig_plus.err

Traceback (most recent call last): File "/gpfs/packages/augustus/3.3.3/scripts/bamToWig.py", line 154, in with urllib.request.urlopen(tool_url) as response, open(key, 'wb') as out_file: AttributeError: module 'urllib' has no attribute ‘request'

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Gaius-Augustus/Augustus/issues/53?email_source=notifications&email_token=AJMC6JF4UPB6TGH4UIM6FK3QOYVSNA5CNFSM4HCJI4F2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBKGT3Q#issuecomment-542403054, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJMC6JFTXHJX67UDR7C6QLLQOYVSNANCNFSM4HCJI4FQ .

KatharinaHoff avatar Oct 16 '19 03:10 KatharinaHoff

Dear Augustus team,

I think I have the same issue with Augustus 3.3.3 ( I follow the instruction from samtools, bamtools) but I have this error : g++ -o "utrrnaseq" ./src/Compute_UTRs.o ./src/Coord_Transform.o ./src/Genomic_Data.o ./src/Splice_Sites.o ./src/Supporting_Methods.o ./src/Test.o ./src/UTRs.o ./src/main.o
Finished building target: utrrnaseq

make[2]: Leaving directory '/opt/Augustus/auxprogs/utrrnaseq/Debug' cd bam2wig; make; make[2]: Entering directory '/opt/Augustus/auxprogs/bam2wig' gcc -Wall -O2 -I/tools/samtools -I. -I/tools/htslib -I/tools/bcftools -c bam2wig.c -o bam2wig.o bam2wig.c:18:10: fatal error: sam.h: No such file or directory #include "sam.h" ^~~~~~~ compilation terminated. Makefile:33: recipe for target 'bam2wig.o' failed make[2]: *** [bam2wig.o] Error 1 make[2]: Leaving directory '/opt/Augustus/auxprogs/bam2wig' Makefile:7: recipe for target 'all' failed make[1]: *** [all] Error 2 make[1]: Leaving directory '/opt/Augustus/auxprogs' Makefile:7: recipe for target 'all' failed make: *** [all] Error 2 FATAL: post proc: exit status 2 FATAL: While performing build: while running engine: exit status 255

Can you help me ?

Lcornet avatar Nov 21 '19 14:11 Lcornet

It shouldn't be a problem to compile AUGUSTUS without bam2wig

This should be in the Readme. We install Augustus because it is a dependency of BUSCO. That error message from bam2wig is confusing.

SHuang-Broad avatar Dec 02 '19 01:12 SHuang-Broad

HI!

I have a query related to AUGUSTUS (gene prediction tool) I could install all the dependencies required to install Augustus but unable to install bam2wig I followed README.md and installed bam2wig's dependency HTSlib and was successful in installing it but still bam2wig isn't working correctly. Kindly guide how to go about it.

I wrote "make" in bam2wig folder

Output:

cc -Wall -O2 -c bam2wig.c -o bam2wig.o -I/usr/include/htslib bam2wig.c: In function ‘main’: bam2wig.c:62:2: error: unknown type name ‘hts_pos_t’ hts_pos_t beg, end, pos; ^ bam2wig.c:89:17: error: ‘HTS_POS_MAX’ undeclared (first use in this function) beg = 0; end = HTS_POS_MAX; tid = -1; ^ bam2wig.c:89:17: note: each undeclared identifier is reported only once for each function it appears in bam2wig.c:107:2: error: unknown type name ‘sam_hdr_t’ sam_hdr_t *htmp = bam_hdr_read(data[0]->bgzf_fp); ^ bam2wig.c:107:20: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types] sam_hdr_t *htmp = bam_hdr_read(data[0]->bgzf_fp); ^ bam2wig.c:112:4: warning: implicit declaration of function ‘hts_parse_region’ [-Wimplicit-function-declaration] hts_parse_region(reg, &tid, &beg, &end, (hts_name2id_f)bam_name2id, htmp, 0); ^ bam2wig.c:141:21: warning: implicit declaration of function ‘bam_mplp64_auto’ [-Wimplicit-function-declaration] while ((exitCode = bam_mplp64_auto(mplp, &tid, &pos, n_plp, plp)) > 0) ^ bam2wig.c:149:23: error: request for member ‘target_name’ in something not a structure or union newTargetName = htmp->target_name[tid]; ^ bam2wig.c:172:11: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘int’ [-Wformat=] printf("%ld %d\n", pos+1, coverage); ^ bam2wig.c:185:2: warning: implicit declaration of function ‘sam_hdr_destroy’ [-Wimplicit-function-declaration] sam_hdr_destroy(htmp); ^ Makefile:46: recipe for target 'bam2wig.o' failed make: [bam2wig.o] Error 1 (ignored) Check if HTSlib is installed and of version 1.10 or higher - see README.txt Makefile:46: recipe for target 'bam2wig.o' failed make: *** [bam2wig.o] Error 1

aditi17142 avatar Mar 02 '21 10:03 aditi17142

I usually skip compiling bam2wig (I confirm that it is currently very difficult). Wie have a python script in the scripts folder that does the same job. You can safely skip bam2wig.

On Tue, Mar 2, 2021 at 11:15 AM aditi17142 [email protected] wrote:

HI!

I have a query related to AUGUSTUS (gene prediction tool) I could install all the dependencies required to install Augustus but unable to install bam2wig I followed README.md and installed bam2wig's dependency HTSlib ans was successfully in installing it but still bam2wig isn't working correctly. Kindly guide how to go about it.

I wrote "make" in bam2wig folder

Output:

cc -Wall -O2 -c bam2wig.c -o bam2wig.o -I/usr/include/htslib bam2wig.c: In function ‘main’: bam2wig.c:62:2: error: unknown type name ‘hts_pos_t’ hts_pos_t beg, end, pos; ^ bam2wig.c:89:17: error: ‘HTS_POS_MAX’ undeclared (first use in this function) beg = 0; end = HTS_POS_MAX; tid = -1; ^ bam2wig.c:89:17: note: each undeclared identifier is reported only once for each function it appears in bam2wig.c:107:2: error: unknown type name ‘sam_hdr_t’ sam_hdr_t *htmp = bam_hdr_read(data[0]->bgzf_fp); ^ bam2wig.c:107:20: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types] sam_hdr_t *htmp = bam_hdr_read(data[0]->bgzf_fp); ^ bam2wig.c:112:4: warning: implicit declaration of function ‘hts_parse_region’ [-Wimplicit-function-declaration] hts_parse_region(reg, &tid, &beg, &end, (hts_name2id_f)bam_name2id, htmp, 0); ^ bam2wig.c:141:21: warning: implicit declaration of function ‘bam_mplp64_auto’ [-Wimplicit-function-declaration] while ((exitCode = bam_mplp64_auto(mplp, &tid, &pos, n_plp, plp)) > 0) ^ bam2wig.c:149:23: error: request for member ‘target_name’ in something not a structure or union newTargetName = htmp->target_name[tid]; ^ bam2wig.c:172:11: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘int’ [-Wformat=] printf("%ld %d\n", pos+1, coverage); ^ bam2wig.c:185:2: warning: implicit declaration of function ‘sam_hdr_destroy’ [-Wimplicit-function-declaration] sam_hdr_destroy(htmp); ^ Makefile:46: recipe for target 'bam2wig.o' failed make: [bam2wig.o] Error 1 (ignored) Check if HTSlib is installed and of version 1.10 or higher - see README.txt Makefile:46: recipe for target 'bam2wig.o' failed make: *** [bam2wig.o] Error 1

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Gaius-Augustus/Augustus/issues/53#issuecomment-788793597, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJMC6JCQWZWOEJNGEE4Y7DTTBS3DPANCNFSM4HCJI4FQ .

KatharinaHoff avatar Mar 02 '21 14:03 KatharinaHoff

Thank you for replying @KatharinaHoff I would request you if you could guide more specifically how I can skip the bam2wig file and execute augustus. As when I checked into scripts directory, I could find bam2wig.py. While executing the file I typed ./bamToWig.py Output usage: bamToWig.py [-h] -b BAMFILE -g GENOMEFILE -o OUTFILE [-s SAMTOOLS_PATH] bamToWig.py: error: the following arguments are required: -b/--bamFile, -g/--genomeFile, -o/--outFile

Kindly guide. Thank you.

aditi17142 avatar Mar 03 '21 05:03 aditi17142

Hello, this problem persists on Ubuntu 20.04, after installing the htslib both ways per instructions here https://github.com/Gaius-Augustus/Augustus/blob/master/auxprogs/bam2wig/README.md

Seems like the TOOLDIR in the bam2wig Makefile was overriding my local TOOLDIR export? I ended up using the second install method (... install htslib from github.com/samtools), and hashed out default TOOLDIR code in the the Augustus/auxprogs/bam2wig/Makefile, and replaced it with my local TOOLDIR, as below

#Makefile of bam2wig #... #ifdef TOOLDIR #DEF_TOOLDIR=1 #else TOOLDIR=$(HOME)/tools #replace with your own ... #... #endif

export TOOLDIR=/my/dir/to/htslib

This compiled the bam2wig executalbe which worked on the Augustus/tests/short/auxprogs/bam2wig/test_files/test.s.bam file, and allowed the augustus install

chris1234321 avatar Apr 30 '21 13:04 chris1234321

@aditi17142 : probably a version of HTSlib lower than 1.10 is used compare compiler output "Check if HTSlib is installed and of version 1.10 or higher" see docs/INSTALL.md for help and Augustus#307

@chris1234321 : the build process has been updated and TOOLDIR has been made obsolete, please use INCLUDE_PATH_HTSLIB and LIBRARY_PATH_HTSLIB in commons.mk and see the HTSlib section in docs/INSTALL.md

hmehlan avatar Sep 10 '21 09:09 hmehlan

Still BROKEN; fix is here: https://github.com/Gaius-Augustus/Augustus/issues/307

cement-head avatar Feb 06 '24 21:02 cement-head