本文整理汇总了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();
}