本文整理匯總了Java中com.google.genomics.v1.StreamReadsResponse類的典型用法代碼示例。如果您正苦於以下問題:Java StreamReadsResponse類的具體用法?Java StreamReadsResponse怎麽用?Java StreamReadsResponse使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
StreamReadsResponse類屬於com.google.genomics.v1包,在下文中一共展示了StreamReadsResponse類的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testBasic
import com.google.genomics.v1.StreamReadsResponse; //導入依賴的package包/類
@Test
public void testBasic() throws IOException, GeneralSecurityException {
ImmutableList<StreamReadsRequest> requests =
ShardUtils.getReadRequests(Collections.singletonList(PROTOTYPE),
100L, REFERENCES);
assertEquals(1, requests.size());
Iterator<StreamReadsResponse> iter =
ReadStreamIterator.enforceShardBoundary(IntegrationTestHelper.getAuthFromApplicationDefaultCredential(),
requests.get(0),
ShardBoundary.Requirement.OVERLAPS, null);
assertTrue(iter.hasNext());
StreamReadsResponse readResponse = iter.next();
assertEquals(63, readResponse.getAlignmentsList().size());
assertFalse(iter.hasNext());
iter = ReadStreamIterator.enforceShardBoundary(IntegrationTestHelper.getAuthFromApplicationDefaultCredential(),
requests.get(0),
ShardBoundary.Requirement.STRICT, null);
assertTrue(iter.hasNext());
readResponse = iter.next();
assertEquals(2, readResponse.getAlignmentsList().size());
assertFalse(iter.hasNext());
}
示例2: testPartialResponses
import com.google.genomics.v1.StreamReadsResponse; //導入依賴的package包/類
@Test
public void testPartialResponses() throws IOException, GeneralSecurityException {
ImmutableList<StreamReadsRequest> requests =
ShardUtils.getReadRequests(Collections.singletonList(PROTOTYPE),
100L, REFERENCES);
assertEquals(1, requests.size());
Iterator<StreamReadsResponse> iter =
ReadStreamIterator.enforceShardBoundary(IntegrationTestHelper.getAuthFromApplicationDefaultCredential(),
requests.get(0),
ShardBoundary.Requirement.STRICT, "alignments(alignment)");
assertTrue(iter.hasNext());
StreamReadsResponse readResponse = iter.next();
List<Read> reads = readResponse.getAlignmentsList();
assertEquals(2, reads.size());
assertFalse(iter.hasNext());
assertEquals("chr13", reads.get(0).getAlignment().getPosition().getReferenceName());
assertEquals(33628135, reads.get(0).getAlignment().getPosition().getPosition());
assertTrue(Strings.isNullOrEmpty(reads.get(0).getAlignedSequence()));
}
示例3: testPartialResponsesInsufficientFields
import com.google.genomics.v1.StreamReadsResponse; //導入依賴的package包/類
@Test
public void testPartialResponsesInsufficientFields() throws IOException, GeneralSecurityException {
thrown.expect(IllegalArgumentException.class);
thrown.expectMessage(containsString("Insufficient fields requested in partial response. "
+ "At a minimum include 'alignments(alignment)' to enforce a strict shard boundary."));
ImmutableList<StreamReadsRequest> requests =
ShardUtils.getReadRequests(Collections.singletonList(PROTOTYPE),
100L, REFERENCES);
assertEquals(1, requests.size());
Iterator<StreamReadsResponse> iter =
ReadStreamIterator.enforceShardBoundary(IntegrationTestHelper.getAuthFromApplicationDefaultCredential(),
requests.get(0),
ShardBoundary.Requirement.STRICT, "alignments(alignedSequence)");
}
示例4: processElement
import com.google.genomics.v1.StreamReadsResponse; //導入依賴的package包/類
@ProcessElement
public void processElement(ProcessContext c) throws IOException, GeneralSecurityException {
Metrics.counter(RetrieveReads.class, "Initialized Shard Count").inc();
Stopwatch stopWatch = Stopwatch.createStarted();
Iterator<StreamReadsResponse> iter = ReadStreamIterator.enforceShardBoundary(auth, c.element(), shardBoundary, fields);
while (iter.hasNext()) {
StreamReadsResponse readResponse = iter.next();
c.output(readResponse.getAlignmentsList());
}
stopWatch.stop();
Metrics.distribution(RetrieveReads.class, "Shard Processing Time (sec)")
.update(stopWatch.elapsed(TimeUnit.SECONDS));
Metrics.counter(RetrieveReads.class, "Finished Shard Count").inc();
}
示例5: streamReads
import com.google.genomics.v1.StreamReadsResponse; //導入依賴的package包/類
@Override
public void streamReads(StreamReadsRequest request,
StreamObserver<StreamReadsResponse> responseObserver) {
StreamReadsResponse response = StreamReadsResponse.newBuilder()
.addAlignments(TestHelper.makeRead(400, 510))
.addAlignments(TestHelper.makeRead(450, 505))
.addAlignments(TestHelper.makeRead(499, 600))
.build();
responseObserver.onNext(response);
responseObserver.onCompleted();
}
示例6: streamReadsResponseToReadsIterator
import com.google.genomics.v1.StreamReadsResponse; //導入依賴的package包/類
private Iterable<Read> streamReadsResponseToReadsIterator(
final Iterator<StreamReadsResponse> responseIterator, final int endPos) {
return new Iterable<Read>() {
@Override
public Iterator<Read> iterator() {
return new ReadResponsesIterator(responseIterator, endPos);
}
};
}
示例7: createIteratorFromStub
import com.google.genomics.v1.StreamReadsResponse; //導入依賴的package包/類
@Override
Iterator<StreamReadsResponse> createIteratorFromStub(StreamReadsRequest request) {
return stub.streamReads(request);
}
示例8: getDataList
import com.google.genomics.v1.StreamReadsResponse; //導入依賴的package包/類
@Override
List<Read> getDataList(StreamReadsResponse response) {
return response.getAlignmentsList();
}
示例9: buildResponse
import com.google.genomics.v1.StreamReadsResponse; //導入依賴的package包/類
@Override
StreamReadsResponse buildResponse(StreamReadsResponse response, Iterable<Read> dataList) {
return StreamReadsResponse.newBuilder(response).clearAlignments().addAllAlignments(dataList)
.build();
}
示例10: streamReads
import com.google.genomics.v1.StreamReadsResponse; //導入依賴的package包/類
@Override
public void streamReads(StreamReadsRequest request,
StreamObserver<StreamReadsResponse> responseObserver) {
faultInjector.respondWithFaults(responseObserver, READ_RESPONSES);
}
示例11: ReadResponsesIterator
import com.google.genomics.v1.StreamReadsResponse; //導入依賴的package包/類
public ReadResponsesIterator(Iterator<StreamReadsResponse> responses, int endPos) {
this.responses = responses;
this.endPos = endPos;
nextRead = peek();
}