Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests for CollectOxoGMetrics, CollectJumpingLibraryMetrics and BamTBfq classes #694

Conversation

ekazachkova
Copy link
Contributor

Current version Picard Tools doesn't contain test suite for CollectOxoGMetrics, CollectJumpingLibraryMetrics and BamToBfq classes. We represent PR that contains acceptance tests for this classes and new test data for BamToBfq class.

@coveralls
Copy link

Coverage Status

Coverage increased (+2.3%) to 73.468% when pulling 191354c on EpamLifeSciencesTeam:ls-epam_increased_test_coverage into 6e9f6cb on broadinstitute:master.

@fleharty fleharty self-assigned this Dec 16, 2016
Copy link
Contributor

@fleharty fleharty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ekazachkova Look's great, just a few minor changes requested.

Assert.assertEquals(metrics.JUMP_DUPLICATE_PAIRS, 1);
Assert.assertEquals(metrics.JUMP_DUPLICATE_PCT, 0.25);
Assert.assertEquals(metrics.JUMP_LIBRARY_SIZE, 6);
Assert.assertEquals((int)metrics.JUMP_MEAN_INSERT_SIZE, 176);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a good idea to cast inside of an assert.
This should be something more like...
Assert.assertEquals(metrics.JUMP_MEAN_INSERT_SIZE, 176.0);

Assert.assertEquals((int)metrics.NONJUMP_DUPLICATE_PCT, 0);
Assert.assertEquals(metrics.NONJUMP_LIBRARY_SIZE, 0);
Assert.assertEquals((int)metrics.NONJUMP_MEAN_INSERT_SIZE, 96);
Assert.assertEquals((int)metrics.NONJUMP_STDEV_INSERT_SIZE, 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NONJUMP_STDEV_INSERT_SIZE evaluates to NaN, by casting it to int it becomes a 0. Instead you should check to see that it is NaN.

Assert.assertEquals(metrics.NONJUMP_DUPLICATE_PAIRS, 0);
Assert.assertEquals((int)metrics.NONJUMP_DUPLICATE_PCT, 0);
Assert.assertEquals(metrics.NONJUMP_LIBRARY_SIZE, 0);
Assert.assertEquals((int)metrics.NONJUMP_MEAN_INSERT_SIZE, 96);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

96.0

final MetricsFile<CollectOxoGMetrics.CpcgMetrics, Comparable<?>> output = new MetricsFile<>();
output.read(new FileReader(outputFile));

final CollectOxoGMetrics.CpcgMetrics cpcgMetrics = output.getMetrics().get(4);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear what index 4 refers to, could you create a variable with a useful name?

@coveralls
Copy link

Coverage Status

Coverage increased (+2.3%) to 73.471% when pulling 41797cf on EpamLifeSciencesTeam:ls-epam_increased_test_coverage into 6e9f6cb on broadinstitute:master.

@ekazachkova
Copy link
Contributor Author

Done. @fleharty have a look, please.

Copy link
Contributor

@fleharty fleharty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ekazachkova Great job! Thanks for addressing all the comments!

@fleharty
Copy link
Contributor

@ekazachkova Feel free to rebase, squash, and merge!

@yfarjoun
Copy link
Contributor

yfarjoun commented Jan 25, 2017 via email

@ekazachkova ekazachkova force-pushed the ls-epam_increased_test_coverage branch from 41797cf to 3c0597f Compare January 25, 2017 10:16
@coveralls
Copy link

Coverage Status

Coverage increased (+2.3%) to 73.512% when pulling 3c0597f on EpamLifeSciencesTeam:ls-epam_increased_test_coverage into 1c6cd8a on broadinstitute:master.

@ekazachkova
Copy link
Contributor Author

Thanks! @fleharty you can merge.

@fleharty fleharty merged commit 2105a1e into broadinstitute:master Jan 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants