Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

Add shard boundary mode for overlapping non-variant segments. #86

Merged
merged 2 commits into from
Apr 19, 2016

Conversation

deflaux
Copy link
Contributor

@deflaux deflaux commented Apr 18, 2016

This PR goes along with googlegenomics/dataflow-java#182

@dionloy
Copy link

dionloy commented Apr 18, 2016

LGTM

@deflaux deflaux merged commit f792f1e into googlegenomics:master Apr 19, 2016
// The following methods have package scope and are helpers for ShardUtils. For sharded Contigs,
// the ShardUtils methods should be used to ensure that shards are shuffled all together before
// being returned to clients.
List<Contig> getShards(long numberOfBasesPerShard) {
double shardCount = Math.ceil(end - start) / (double) numberOfBasesPerShard;
double shardCount = Math.ceil(end - start) / numberOfBasesPerShard;
Copy link

Choose a reason for hiding this comment

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

Nota bene: Performing a ceiling on the difference between two long numbers will not change anything. I think you might want to have the following - with an additional encompassing set of parentheses - to have the intended effect:

double shardCount = Math.ceil( (end - start) / numberOfBasesPerShard );

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed - will fix.

Copy link

Choose a reason for hiding this comment

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

Thanks :) BTW, I'm sure you noticed this as well, but shardCount can be int if you cast Math.ceil as follows, since you use it as an integer upper-bound in the for-loop afterwards:

int shardCount = (int) Math.ceil( (end - start) / numberOfBasesPerShard );

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants