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


Java Reference类代码示例

本文整理汇总了Java中com.google.genomics.v1.Reference的典型用法代码示例。如果您正苦于以下问题:Java Reference类的具体用法?Java Reference怎么用?Java Reference使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Reference类属于com.google.genomics.v1包,在下文中一共展示了Reference类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ReferenceInfo

import com.google.genomics.v1.Reference; //导入依赖的package包/类
public ReferenceInfo(Reference reference, ReferenceSet referenceSet) {
  this.reference = reference;
  this.referenceSet = referenceSet;
}
 
开发者ID:googlegenomics,项目名称:dataflow-java,代码行数:5,代码来源:HeaderInfo.java

示例2: getReferences

import com.google.genomics.v1.Reference; //导入依赖的package包/类
private static List<ReferenceInfo> getReferences(Channel channel, ReadGroupSet readGroupSet) {
  Set<String> referenceSetIds = Sets.newHashSet();
  if (readGroupSet.getReferenceSetId() != null && !readGroupSet.getReferenceSetId().isEmpty()) {
    LOG.fine("Found reference set from read group set " +
        readGroupSet.getReferenceSetId());
    referenceSetIds.add(readGroupSet.getReferenceSetId());
  }
  if (readGroupSet.getReadGroupsCount() > 0) {
    LOG.fine("Found read groups");
    for (ReadGroup readGroup : readGroupSet.getReadGroupsList()) {
      if (readGroup.getReferenceSetId() != null && !readGroup.getReferenceSetId().isEmpty()) {
        LOG.fine("Found reference set from read group: " +
            readGroup.getReferenceSetId());
        referenceSetIds.add(readGroup.getReferenceSetId());
      }
    }
  }

  ReferenceServiceV1BlockingStub referenceSetStub =
      ReferenceServiceV1Grpc.newBlockingStub(channel);

  List<ReferenceInfo> references = Lists.newArrayList();
  for (String referenceSetId : referenceSetIds) {
    LOG.fine("Getting reference set " + referenceSetId);
    GetReferenceSetRequest getReferenceSetRequest = GetReferenceSetRequest
        .newBuilder().setReferenceSetId(referenceSetId).build();
    ReferenceSet referenceSet =
        referenceSetStub.getReferenceSet(getReferenceSetRequest);
    if (referenceSet == null || referenceSet.getReferenceIdsCount() == 0) {
      continue;
    }
    for (String referenceId : referenceSet.getReferenceIdsList()) {
      LOG.fine("Getting reference  " + referenceId);
      GetReferenceRequest getReferenceRequest = GetReferenceRequest
          .newBuilder().setReferenceId(referenceId).build();
      Reference reference = referenceSetStub.getReference(getReferenceRequest);
      if (reference.getName() != null && !reference.getName().isEmpty()) {
        references.add(new ReferenceInfo(reference, referenceSet));
        LOG.fine("Adding reference  " + reference.getName());
      }
    }
  }
  return references;
}
 
开发者ID:googlegenomics,项目名称:dataflow-java,代码行数:45,代码来源:HeaderInfo.java

示例3: makeSAMRecord

import com.google.genomics.v1.Reference; //导入依赖的package包/类
public static final SAMRecord makeSAMRecord(Read read,
                                            ReadGroupSet readGroupSet, List<Reference> references,
                                            boolean forceSetMatePositionToThisPosition) {
  return makeSAMRecord(read, makeSAMFileHeader(readGroupSet, references));
}
 
开发者ID:googlegenomics,项目名称:utils-java,代码行数:6,代码来源:ReadUtils.java

示例4: ReadIteratorResource

import com.google.genomics.v1.Reference; //导入依赖的package包/类
public ReadIteratorResource(ReadGroupSet readGroupSet, List<Reference> references,
    UnmappedReads<Read> unmappedReads, 
    Iterable<Read> iterable) {
  super(readGroupSet, references, unmappedReads, iterable, 
      new GenomicsConverter());
}
 
开发者ID:googlegenomics,项目名称:gatk-tools-java,代码行数:7,代码来源:ReadIteratorResource.java

示例5: getReads

import com.google.genomics.v1.Reference; //导入依赖的package包/类
@Override
public ReadIteratorResource getReads(
    String readsetId, 
    String sequenceName, int sequenceStart, int sequenceEnd) 
        throws IOException, GeneralSecurityException {
  LOG.info("Getting readset from GRPC:" + readsetId + ", sequence " + sequenceName + 
      ", start=" + sequenceStart + ", end=" + sequenceEnd);
  final Channel channel = getChannel();
  
  ReadServiceV1BlockingStub readStub = ReadServiceV1Grpc.newBlockingStub(channel);
  GetReadGroupSetRequest getReadGroupSetRequest = GetReadGroupSetRequest
      .newBuilder()
      .setReadGroupSetId(readsetId)
      .build();

  ReadGroupSet readGroupSet = readStub.getReadGroupSet(getReadGroupSetRequest);
  String datasetId = readGroupSet.getDatasetId();
  LOG.info("Found readset " + readsetId + ", dataset " + datasetId);
  
  final Map<String, Reference> references = 
      getReferences(readGroupSet);
  
  final Reference reference = references.get(sequenceName);
  if (reference != null) {
      LOG.info("Reference for sequence name " + sequenceName + " is found, length="
          + String.valueOf(reference.getLength()));
  } else {
    LOG.warning("Reference for sequence name " + sequenceName + " not found");
  }
  LOG.info("Searching for reads in sequence " + sequenceName + " " +
      String.valueOf(sequenceStart) + "-" + String.valueOf(sequenceEnd));
  
  com.google.cloud.genomics.gatk.common.UnmappedReads<Read> unmappedReads = null;
  if (sequenceName.isEmpty()) {
    unmappedReads = getUnmappedMatesOfMappedReads(readsetId);
  }
  
  StreamingReadServiceBlockingStub streamingReadStub = 
      StreamingReadServiceGrpc.newBlockingStub(getChannel());
  StreamReadsRequest.Builder streamReadsRequestBuilder = StreamReadsRequest.newBuilder()
      .setReadGroupSetId(readsetId)
      .setReferenceName(sequenceName);
  if (sequenceStart != 0) {
    streamReadsRequestBuilder.setStart(Long.valueOf(sequenceStart));
  }
  if (sequenceEnd != 0) {
    streamReadsRequestBuilder.setEnd(Long.valueOf(sequenceEnd));
  }
  final StreamReadsRequest streamReadRequest = streamReadsRequestBuilder.build();
  final Iterable<Read> reads = streamReadsResponseToReadsIterator(
      streamingReadStub.streamReads(streamReadRequest), sequenceEnd);
  return new ReadIteratorResource(readGroupSet, 
      Lists.newArrayList(references.values()), unmappedReads, reads);

}
 
开发者ID:googlegenomics,项目名称:gatk-tools-java,代码行数:56,代码来源:GenomicsDataSource.java

示例6: getReferences

import com.google.genomics.v1.Reference; //导入依赖的package包/类
/**
 * Collect a list of references mentioned in this Readgroupset and get their meta data.
 * @throws GeneralSecurityException 
 * @throws IOException 
 */
private Map<String, Reference> getReferences(ReadGroupSet readGroupSet) 
    throws IOException, GeneralSecurityException {
  Set<String> referenceSetIds = Sets.newHashSet();
  if (!Strings.isNullOrEmpty(readGroupSet.getReferenceSetId())) {
    LOG.info("Found reference set from read group set " + 
        readGroupSet.getReferenceSetId());
    referenceSetIds.add(readGroupSet.getReferenceSetId());
  }
  if (readGroupSet.getReadGroupsCount() > 0) {
    LOG.info("Found read groups");
    for (ReadGroup readGroup : readGroupSet.getReadGroupsList()) {
      if (!Strings.isNullOrEmpty(readGroup.getReferenceSetId())) {
        LOG.info("Found reference set from read group: " + 
            readGroup.getReferenceSetId());
        referenceSetIds.add(readGroup.getReferenceSetId());
      }
    }
  }
  
  ReferenceServiceV1BlockingStub referenceSetStub = 
      ReferenceServiceV1Grpc.newBlockingStub(getChannel());
      
  Map<String, Reference> references = Maps.newHashMap();
  for (String referenceSetId : referenceSetIds) {
    LOG.info("Getting reference set " + referenceSetId);
    GetReferenceSetRequest getReferenceSetRequest = GetReferenceSetRequest
        .newBuilder().setReferenceSetId(referenceSetId).build();
    ReferenceSet referenceSet = 
        referenceSetStub.getReferenceSet(getReferenceSetRequest);
    if (referenceSet == null || referenceSet.getReferenceIdsCount() == 0) {
      continue;
    }
    for (String referenceId : referenceSet.getReferenceIdsList()) {
      LOG.fine("Getting reference  " + referenceId);
      GetReferenceRequest getReferenceRequest = GetReferenceRequest
          .newBuilder().setReferenceId(referenceId).build();
      Reference reference = referenceSetStub.getReference(getReferenceRequest);
      if (!Strings.isNullOrEmpty(reference.getName())) {
        references.put(reference.getName(), reference);
        LOG.fine("Adding reference  " + reference.getName());
      }
    }
  }
  return references;
}
 
开发者ID:googlegenomics,项目名称:gatk-tools-java,代码行数:51,代码来源:GenomicsDataSource.java

示例7: makeSAMFileHeader

import com.google.genomics.v1.Reference; //导入依赖的package包/类
@Override
public SAMFileHeader makeSAMFileHeader(ReadGroupSet readGroupSet,
    List<Reference> references) {
    return ReadUtils.makeSAMFileHeader(readGroupSet, references);
}
 
开发者ID:googlegenomics,项目名称:gatk-tools-java,代码行数:6,代码来源:GenomicsConverter.java


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