當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。