Add very basic test program for the libmaus2/biobambam2 cram encoding interface#43
Add very basic test program for the libmaus2/biobambam2 cram encoding interface#43gt1 wants to merge 2 commits intojkbonfield:masterfrom
Conversation
|
It builds, but there are no uses of it in the test harness. I can run it on the existing test data if I recreate the How would you want it validating? Success on decode of the output file with scramble once more? Eg: I think I'd prefer it to be using filenames than stdin / stdout, as that's liable to cause test failures on Windows unless we're careful (I haven't checked if we are). That's easy to do with a change to the arg for |
…ame instead of reading from standard input and writing to standard output
|
I have changed the program so it uses filenames of an input and an output file instead of stdin and stdout. As for the valdiating method: I think another step of decoding the output again with scramble should be fine. Ideally it should check the actual data, but that could be difficult because of reformatting. Do you have anything in place for doing this? The order of the records should remain the same, so at least some fields chould be checked (seqid, position, read name, etc.). |
|
I'll have a think. I think I already rely on things like awk and md5sum in the test harness, but not 100% sure so I should check. If they're portable enough then it ought to be trivial to cull anything we think may be changeable, but I'd guess it ought to be pretty stable bar perhaps some header meta-data. Thanks for working on this. |
|
I added a call to this in the test harness in a local branch containing this PR and rebased on top of some updates to master. I just added these to the existing cram_io.test file as both tests are covering biobambam requirements. https://github.com/jkbonfield/io_lib/blob/bambam_interface_test/tests/cram_io.test It works on most platforms, however it fails on s390x. Is this a known issue? If so is it the test that is incompatible, or the API in io_lib itself? We could potentially omit the test on a specific platform via a check of https://travis-ci.org/github/jkbonfield/io_lib/jobs/769685530#L5560 I'm struggling to reproduce it on easier accessed platforms. I've tried address sanitizer, thread sanitizer and valgrind and it seems quite happy with all. For what it's worth I'm retiring travis anyway soon, having now got some basic GitHub Actions set up, but I haven't as yet got other platforms done there so I may leave it for a little while yet. |
|
It is not something I have seen. Would it be possible to get line numbers in the trace?
…________________________________________
Von: James Bonfield ***@***.***>
Gesendet: Donnerstag, 6. Mai 2021 17:00
An: jkbonfield/io_lib
Cc: German Tischler-Höhle; Author
Betreff: [EXTERNAL]Re: [jkbonfield/io_lib] Add very basic test program for the libmaus2/biobambam2 cram encoding interface (#43)
WARNING: This email was sent from an address outside the company. Do not click on any links or open any file attachments unless you recognize the sender and are confident the content is safe.
I added a call to this in the test harness in a local branch containing this PR and rebased on top of some updates to master. I just added these to the existing cram_io.test file as both tests are covering biobambam requirements.
https://github.com/jkbonfield/io_lib/blob/bambam_interface_test/tests/cram_io.test<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjkbonfield%2Fio_lib%2Fblob%2Fbambam_interface_test%2Ftests%2Fcram_io.test&data=04%7C01%7C%7Cc019eed4db7f40e55b8d08d9109fc172%7Cf54d3069b76d43d9b2f14a23ea2ca7ce%7C0%7C0%7C637559100597876981%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=iNtD2TzFVQqJlzTr03%2F6iSaT55MGH84mXEbx6EpwHJg%3D&reserved=0>
It works on most platforms, however it fails on s390x. Is this a known issue? If so is it the test that is incompatible, or the API in io_lib itself? We could potentially omit the test on a specific platform via a check of uname -s or similar.
https://travis-ci.org/github/jkbonfield/io_lib/jobs/769681798<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftravis-ci.org%2Fgithub%2Fjkbonfield%2Fio_lib%2Fjobs%2F769681798&data=04%7C01%7C%7Cc019eed4db7f40e55b8d08d9109fc172%7Cf54d3069b76d43d9b2f14a23ea2ca7ce%7C0%7C0%7C637559100597876981%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=VfK%2BlUsb6v6j1zTft2qC05P4gywnRn4KnAxZr9EfldM%3D&reserved=0>
*** Error in `/home/travis/build/jkbonfield/io_lib/tests/.libs/lt-cram_bambam_interface_test': malloc(): memory corruption: 0x000002aa01074bd0 ***
======= Backtrace: =========
/lib/s390x-linux-gnu/libc.so.6(+0x79262)[0x3ff81179262]
/lib/s390x-linux-gnu/libc.so.6(+0x7f3d6)[0x3ff8117f3d6]
/lib/s390x-linux-gnu/libc.so.6(+0x81ac0)[0x3ff81181ac0]
/lib/s390x-linux-gnu/libc.so.6(__libc_calloc+0x2a0)[0x3ff81184820]
/home/travis/build/jkbonfield/io_lib/io_lib/.libs/libstaden-read.so.14(cram_new_container+0x22)[0x3ff8146ec42]
/home/travis/build/jkbonfield/io_lib/io_lib/.libs/libstaden-read.so.14(cram_put_bam_seq+0x790)[0x3ff81459a20]
/home/travis/build/jkbonfield/io_lib/io_lib/.libs/libstaden-read.so.14(cram_process_work_package+0x142)[0x3ff8147950a]
/home/travis/build/jkbonfield/io_lib/tests/.libs/lt-cram_bambam_interface_test(+0x1bd6)[0x2aa00581bd6]
/home/travis/build/jkbonfield/io_lib/io_lib/.libs/libstaden-read.so.14(cram_enque_compression_block+0x10c)[0x3ff8147939c]
/home/travis/build/jkbonfield/io_lib/tests/.libs/lt-cram_bambam_interface_test(main+0x5ce)[0x2aa0058186e]
/lib/s390x-linux-gnu/libc.so.6(__libc_start_main+0x10e)[0x3ff81122ece]
/home/travis/build/jkbonfield/io_lib/tests/.libs/lt-cram_bambam_interface_test(+0x1a14)[0x2aa00581a14]
======= Memory map: ========
...
Aborted (core dumped)
I'm struggling to reproduce it on easier accessed platforms. I've tried address sanitizer, thread sanitizer and valgrind and it seems quite happy with all.
For what it's worth I'm retiring travis anyway soon, having now got some basic GitHub Actions set up, but I haven't as yet got other platforms done there so I may leave it for a little while yet.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjkbonfield%2Fio_lib%2Fpull%2F43%23issuecomment-833593207&data=04%7C01%7C%7Cc019eed4db7f40e55b8d08d9109fc172%7Cf54d3069b76d43d9b2f14a23ea2ca7ce%7C0%7C0%7C637559100597886945%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Ei3616tu8rB29gZoXnz2xel9Vd4yjixUc8PcpIbo8uo%3D&reserved=0>, or unsubscribe<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAA2UHZTICETNV6K7LWIK4JDTMKVKJANCNFSM42YBRX4A&data=04%7C01%7C%7Cc019eed4db7f40e55b8d08d9109fc172%7Cf54d3069b76d43d9b2f14a23ea2ca7ce%7C0%7C0%7C637559100597886945%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=56McIwhTRYLNPB0cjJh3wLjTQZcnG%2FEt9e92dq3R1To%3D&reserved=0>.
|
Hi James,
here is a suggestion for a very simple test program using the cram_bambam interface. So far it is quite peculiar in that it requires
It has no actual parallelism yet, but I have used it successfully to transcode a BAM file into CRAM, so it should be sufficient to check whether the interface is functional (apart from locking/threading issues).
Best wishes,
German