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

Shard readGroupSets using the associated referenceSet. #64

Merged
merged 5 commits into from
Oct 13, 2015

Conversation

deflaux
Copy link
Contributor

@deflaux deflaux commented Oct 13, 2015

Take a look at deflaux/dataflow-java@33f0cff so see how this change could be used downstream. (but I plan to refactor that refactor; it needs a bit more work)

public static Iterable<Reference> getReferences(String referenceSetId, GenomicsFactory.OfflineAuth auth)
throws IOException, GeneralSecurityException {
Genomics genomics = auth.getGenomics(auth.getDefaultFactory());
Iterable<Reference> references = Paginator.References.create(
Copy link
Contributor

Choose a reason for hiding this comment

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

Local variable seems unnecessary here.

@dionloy dionloy assigned deflaux and unassigned dionloy Oct 13, 2015
@deflaux
Copy link
Contributor Author

deflaux commented Oct 13, 2015

Thanks for the feedback @calbach. PTAL

I switched to Coverage Buckets for read group set sharding. Its much better to use something available for all read group sets. I left the getReferenceId and getReference methods in the utility class since they're generally useful.

public static List<CoverageBucket> getCoverageBuckets(String readGroupSetId, GenomicsFactory.OfflineAuth auth)
throws IOException, GeneralSecurityException {
Genomics genomics = auth.getGenomics(auth.getDefaultFactory());
// Not using a Paginator here because requests of this form return one result per
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't agree that this is a safe assumption. If there is already a paginator I would strongly prefer it were used. Otherwise, you should at least throw an exception if nextPageToken is set.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no Paginator for that method. I added the exception.

@calbach
Copy link
Contributor

calbach commented Oct 13, 2015

LGTM

genomics.readgroupsets().coveragebuckets().list(readGroupSetId).execute();
// Requests of this form return one result per reference name, so therefore many fewer than
// the default page size, but verify that the assumption holds true.
if(null != response.getNextPageToken()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: space after 'if'

Copy link
Contributor

Choose a reason for hiding this comment

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

Strings.isNullOrEmpty() would probably be safer

@dionloy
Copy link

dionloy commented Oct 13, 2015

LGTM
On Oct 13, 2015 1:15 PM, "Nicole Deflaux" notifications@github.com wrote:

Thanks for the feedback @calbach https://github.com/calbach. PTAL

I switched to Coverage Buckets for read group set sharding. Its much
better to use something available for all read group sets. I left the
getReferenceId and getReference methods in the utility class since they're
generally useful.


Reply to this email directly or view it on GitHub
#64 (comment)
.

deflaux added a commit that referenced this pull request Oct 13, 2015
Shard readGroupSets using the associated referenceSet.
@deflaux deflaux merged commit 7c0b1e2 into googlegenomics:master Oct 13, 2015
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