brentp / hts-nim

nim wrapper for htslib for parsing genomics data files

Home Page:https://brentp.github.io/hts-nim/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issues with nimble test

lucia-ramirez opened this issue · comments

Hello,

I was following the steps to download hts-nim, but I got the following error when I ran nimble test:

Executing task test in /lustre/scratch123/hgi/mdt2/teams/trynka/lucia/bin/hts-nim/hts.nimble
Hint: used config file '/software/teamtrynka/conda/ase/nim/config/nim.cfg' [Conf]
Hint: used config file '/software/teamtrynka/conda/ase/nim/config/config.nims' [Conf]
Hint: used config file '/lustre/scratch123/hgi/mdt2/teams/trynka/lucia/bin/hts-nim/tests/nim.cfg' [Conf]
Hint: 7880 lines; 0.338s; 6.992MiB peakmem; Debug build; proj: /lustre/scratch123/hgi/mdt2/teams/trynka/lucia/bin/hts-nim/tests/all; out: /lustre/scratch123/hgi/mdt2/teams/trynka/lucia/bin/hts-nim/tests/all [SuccessX]
Hint: /lustre/scratch123/hgi/mdt2/teams/trynka/lucia/bin/hts-nim/tests/all  [Exec]
could not import: sam_hdr_destroy
Error: execution of an external program failed: '/lustre/scratch123/hgi/mdt2/teams/trynka/lucia/bin/hts-nim/tests/all '
stack trace: (most recent call last)
/tmp/nimblecache-1036732846/nimscriptapi_3424262110.nim(187, 16)
/lustre/scratch123/hgi/mdt2/teams/trynka/lucia/bin/hts-nim/hts.nimble(20, 8) testTask
/software/teamtrynka/conda/ase/nim/lib/system/nimscript.nim(260, 7) exec
/software/teamtrynka/conda/ase/nim/lib/system/nimscript.nim(260, 7) Error: unhandled exception: FAILED: nim c  -d:useSysAssert -d:useGcAssert --lineDir:on --debuginfo -r tests/all [OSError]
     Error: Exception raised during nimble script execution

I am using htslib 1.12, nim 1.4.8 and nimble 0.13.1.

Thanks!

Hi Lucia,
this means that nim is finding an older version of htslib (< 1.10) when sam_hdr_destroy did not exist.
You can use something like: export LD_LIBRARY_PATH=/path/to/dir/
where dir is the directory that contains a libhts.so that's >= 1.10.
-Brent

Hello, I already added the path export LD_LIBRARY_PATH=/software/teamtrynka/conda/ase/lib/ (where /software/teamtrynka/conda/ase/lib/ contains libhts.a, libhts.so, libhts.so.1.12, libhts.so.3) but I am still getting the same error

Maybe you can create a new conda env and try again. This is definitely the case of nim (and the C compiler used by nim) finding an older htslib. If you update ld library path, you might make sure all the nim cache directories are cleared as that might not trigger a deep recompile since it doesn't see a file change. The caches will be in ~/.cache/nim and you can remove the entire directory.

It was indeed the cache - Thanks!

Sorry, I just realized that nimble test still drop some issues for bgzf-suite, vcf-suite and test files is this okay?

Executing task test in /lustre/scratch123/hgi/mdt2/teams/trynka/lucia/bin/hts-nim/hts.nimble
Hint: used config file '/software/teamtrynka/conda/ase/nim/config/nim.cfg' [Conf]
Hint: used config file '/software/teamtrynka/conda/ase/nim/config/config.nims' [Conf]
Hint: used config file '/lustre/scratch123/hgi/mdt2/teams/trynka/lucia/bin/hts-nim/tests/nim.cfg' [Conf]
Hint: 7880 lines; 0.897s; 6.988MiB peakmem; Debug build; proj: /lustre/scratch123/hgi/mdt2/teams/trynka/lucia/bin/hts-nim/tests/all; out: /lustre/scratch123/hgi/mdt2/teams/trynka/lucia/bin/hts-nim/tests/all [SuccessX]
Hint: /lustre/scratch123/hgi/mdt2/teams/trynka/lucia/bin/hts-nim/tests/all  [Exec]

[Suite] flag test-suite
  [OK] test flags

[Suite] flag cigar-suite
  [OK] test op
  [OK] new cigar

[Suite] flag hts-suite
  [OK] test hts

[Suite] bgzf-suite
  [OK] test-write
  [OK] test-read
  [OK] bgzf-iterator
[E::bgzf_read_block] Failed to read BGZF block data at offset 0 expected 24944 bytes; hread returned 982
  [OK] bgzf-iterator-err
  [OK] write-with-index
  [OK] read-new-index
  [OK] csi-iterator
  [OK] bgzi-query from VCF rows

[Suite] fai-suite
  [OK] fai-read
  [OK] fai chrom_len
  [OK] fai indexing
  [OK] issue26
  [OK] close

[Suite] aux-test
  [OK] test aux
  [OK] tag
  [OK] drop tag

[Suite] vcf suite
[E::bcf_hdr_read] Input is not detected as bcf or vcf format
  [OK] empty file rasies
  [OK] filter
  [OK] test writer
  [OK] vcf write missing format values
  [OK] iterating over info fields
  [OK] that adding a new sample and setting values works.
  [OK] format fields
  [OK] test empty format
  [OK] test format setting
  [OK] add string to header
  [OK] add info to header
  [OK] add and set Flag
  [OK] load index
  [OK] remove info from header
  [OK] add format to header
  [OK] remove format from header
  [OK] set qual
  [OK] set id
  [OK] new from string

[Suite] genotypes suite
  [OK] test alts
  [OK] unknown alts
  [OK] contig names

[Suite] header record
  [OK] info test
  [OK] format test

[Suite] vcf alleles
  [OK] update alleles with low-level setters works
  [OK] update alleles with high-level setters works

[Suite] bug suite
  [OK] csq reader
  [OK] re-use same header issue 77

[Suite] speed tests
312078 in .. 5.220469364 seconds 
  [OK] standard format getter

[Suite] bam-suite
  [OK] xam_index
  [OK] test sa sam
  [OK] test sa bam
  [OK] cram writing
  [OK] set aux
  [OK] set qname
  [OK] test from string

[Suite] stats suite
  [OK] test fisher
0.09873714670538818
0.002221433773229274
0.002221433773229274
  [OK] binomial

[Suite] bugs
  [OK] vcf/bcf subset alts

[Suite] test files
  [OK] that iteration works
  [OK] file types
[E::hts_open_format] Failed to open file "tests/sadfasdfasdfasdf" : No such file or directory
  [OK] that bad path gives reasonable error message
  [OK] readLine

[Suite] Ensure the samples included in Readme.md works as intended
  Success: Readme.md sample code between lines 39 and 62 seems OK.
  Success: Readme.md sample code between lines 69 and 107 seems OK.
  Success: Readme.md sample code between lines 112 and 119 seems OK.
  [OK] Code extraction and running.

yes, that's as expected. those are checking the error handling in hts-nim and htslib also reports some messages.