当前位置: 首页>>代码示例>>Java>>正文


Java StreamReadsResponse类代码示例

本文整理汇总了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());
}
 
开发者ID:googlegenomics,项目名称:utils-java,代码行数:27,代码来源:ReadStreamIteratorITCase.java

示例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()));
}
 
开发者ID:googlegenomics,项目名称:utils-java,代码行数:23,代码来源:ReadStreamIteratorITCase.java

示例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)");
}
 
开发者ID:googlegenomics,项目名称:utils-java,代码行数:17,代码来源:ReadStreamIteratorITCase.java

示例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();
}
 
开发者ID:googlegenomics,项目名称:dataflow-java,代码行数:15,代码来源:ReadStreamer.java

示例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();
}
 
开发者ID:googlegenomics,项目名称:utils-java,代码行数:12,代码来源:GenomicsStreamIteratorTest.java

示例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);
    }
  };
}
 
开发者ID:googlegenomics,项目名称:gatk-tools-java,代码行数:10,代码来源:GenomicsDataSource.java

示例7: createIteratorFromStub

import com.google.genomics.v1.StreamReadsResponse; //导入依赖的package包/类
@Override
Iterator<StreamReadsResponse> createIteratorFromStub(StreamReadsRequest request) {
  return stub.streamReads(request);
}
 
开发者ID:googlegenomics,项目名称:utils-java,代码行数:5,代码来源:ReadStreamIterator.java

示例8: getDataList

import com.google.genomics.v1.StreamReadsResponse; //导入依赖的package包/类
@Override
List<Read> getDataList(StreamReadsResponse response) {
  return response.getAlignmentsList();
}
 
开发者ID:googlegenomics,项目名称:utils-java,代码行数:5,代码来源:ReadStreamIterator.java

示例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();
}
 
开发者ID:googlegenomics,项目名称:utils-java,代码行数:6,代码来源:ReadStreamIterator.java

示例10: streamReads

import com.google.genomics.v1.StreamReadsResponse; //导入依赖的package包/类
@Override
public void streamReads(StreamReadsRequest request,
    StreamObserver<StreamReadsResponse> responseObserver) {
  faultInjector.respondWithFaults(responseObserver, READ_RESPONSES);
}
 
开发者ID:googlegenomics,项目名称:utils-java,代码行数:6,代码来源:GenomicsStreamIteratorRetryTest.java

示例11: ReadResponsesIterator

import com.google.genomics.v1.StreamReadsResponse; //导入依赖的package包/类
public ReadResponsesIterator(Iterator<StreamReadsResponse> responses, int endPos) {
  this.responses = responses;
  this.endPos = endPos;
  nextRead = peek();
}
 
开发者ID:googlegenomics,项目名称:gatk-tools-java,代码行数:6,代码来源:GenomicsDataSource.java


注:本文中的com.google.genomics.v1.StreamReadsResponse类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。