keithwhor / NtSeq

JavaScript (node + browser) bioinformatics library for nucleotide sequence manipulation and analysis.
MIT License
208 stars 25 forks source link

Does your node-modules support only little endianness? #2

Closed smartmouse closed 9 years ago

smartmouse commented 9 years ago

Hi, I am using your node-module on big endian machine. when I run your unit tests, got some errors. The same tests work perfectly fine on our little endian machines -- xlinux. Node.js version is 0.10.36 and 0.12.0

Thanks.

ntseq@1.0.9 test /home/Test/NtSeq node ./tests/test.js

Test passed: Sequence got correct size (7) Test passed: Sequence got correct size (8) Test passed: Sequence got correct size (9) Test passed: Sequence loaded properly (7) Test passed: Sequence loaded properly (8) Test passed: Sequence loaded properly (9) Test passed: Sequence loaded as RNA and output properly Test failed: Sequence got correct complement (7) Test passed: Sequence got correct complement (8) Test failed: Sequence got correct complement (9) Test passed: Sequence equivalency true positive Test passed: Sequence equivalency true negative Test passed: Replication works with no parameters for length 9 sequence Test failed: Replication works with one parameter (offset 1) for length 9 sequence Test passed: Replication works with (0, 8) for length 9 sequence Test failed: Replication works with (7, 2) for length 9 sequence Test passed: Replication works for (0, 8) of length 9 sequence Test failed: Sequence polymerization gives correct results (4, 4) Test failed: Sequence polymerization gives correct results (5, 4) Test failed: Sequence insertion gives correct results (length 4 at 0) Test failed: Sequence insertion gives correct results (length 4 at 1) Test failed: Sequence insertion gives correct results (length 5 at 0) Test failed: Sequence insertion gives correct results (length 5 at 1) Test failed: Deletion works for offset 0, length 1 Test failed: Deletion works for offset 0, length 2 Test failed: Deletion works for offset 1, length 2 Test failed: Deletion works for offset 1, length 7 Test passed: Deletion works for offset 8, length 1 Test passed: Repeat works for length 3 sequence, repeated 1x Test failed: Repeat works for length 3 sequence, repeated 2x Test failed: Repeat works for length 3 sequence, repeated 3x Test failed: Repeat works for length 3 sequence, repeated 17x Test passed: Sequence masked properly Test passed: Sequence covered properly Test passed: Sequence content read correctly (3 each) Test passed: Sequence content read correctly (4 each) Test passed: Sequence content read correctly (contains degenerate NTs) Test passed: Sequence fractional content read correctly (4 each, 0.25) Test passed: Sequence ATGC (average) content read correctly Test passed: Sequence ATGC (average) fractional content read correctly Test passed: Sequence translated correctly (one AA) Test passed: Sequence translated correctly (no parameters) Test passed: Sequence translated correctly (offset 1 nt) Test passed: Sequence translated correctly (offset 1 nt, length 7 nts) Test passed: Sequence translated correctly (offset 2 nt) Test passed: Sequence translated correctly (offset 2 nt, length 7 nts) Test passed: Sequence translated frame correctly (no parameters) Test passed: Sequence translated frame correctly (frame 0, offset 1 AA) Test passed: Sequence translated frame correctly (frame 0, offset 1 AA, length 2 AA) Test passed: Sequence translated frame correctly (frame 1, offset 1 AA, length 2 AA) Test passed: Sequence translated frame correctly (frame 2, offset 1 AA, length 2 AA) Test failed: mapSequence successfully found correct match scores, loaded from .fasta Test failed: mapSequence successfully found correct match scores, loaded from .4bnt Passed 34 of 53 tests. (64.15%) There seem to be some errors with the package

keithwhor commented 9 years ago

Great catch! Will create a fix soon. For now assume support for little endian machines only. :)

smartmouse commented 9 years ago

Perfect! Thank you for your prompt reply. You are great.

keithwhor commented 9 years ago

No problem!

I'd be hesitant to expect a fix as quickly as the reply, I'll have to find an effective way to write tests for endianness regardless of system architecture.

I will throw up a patch ASAP that will throw an error when instantiating the package if you're using a BE architecture.