Fix local align score vector#1036
Merged
josemduarte merged 3 commits intobiojava:masterfrom Sep 30, 2022
Merged
Conversation
added 3 commits
July 25, 2022 20:07
Initialize pointers array to dimension (ye,1)
Initialize pointers to size (ye+1,1)
josemduarte
approved these changes
Aug 26, 2022
Contributor
josemduarte
left a comment
There was a problem hiding this comment.
Thanks a lot and sorry for the delay. I think this looks good.
I'm not sure why the tests are not running. I'll have a look.
Contributor
|
Could you add a dummy commit to the branch? I'm hoping that will trigger the tests. |
Contributor
|
I've run the tests locally and they pass. I'll merge. |
Author
|
Thank you for running that, I missed your comment earlier. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Using a local alignment with linear gap penalty resulted in the failure trace below. Setting pointers to dimension (ye+1,1) fixed the error. Added a test "testLinearAlignmentLocal()" in TestDNAAlignment.java to verify results.
java.lang.NullPointerException: Cannot store to object array because "pointers[y]" is null
at org.biojava.nbio.alignment.routines.AlignerHelper.setScoreVector(AlignerHelper.java:587)
at org.biojava.nbio.alignment.routines.AlignerHelper.setScoreVector(AlignerHelper.java:560)
at org.biojava.nbio.alignment.template.AbstractMatrixAligner.align(AbstractMatrixAligner.java:347)
at org.biojava.nbio.alignment.template.AbstractPairwiseSequenceAligner.getPair(AbstractPairwiseSequenceAligner.java:114)
at org.biojava.nbio.alignment.TestDNAAlignment.testLinearAlignmentLocal(TestDNAAlignment.java:178)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:577)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:93)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)