• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Read类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getReadPCollection

import com.google.api.services.genomics.model.Read; //导入依赖的package包/类
/**
 * Create a {@link PCollection<GATKRead>} containing all the reads overlapping the given intervals.
 * Reads that are unmapped are ignored.
 * @param intervals a list of SimpleIntervals.  These must be non-overlapping intervals or the results are undefined.
 * @param stringency how to react to malformed reads.
 * @param includeUnmappedReads to include unmapped reads.
 * @return a PCollection containing all the reads that overlap the given intervals.
 */
public PCollection<GATKRead> getReadPCollection(List<SimpleInterval> intervals, ValidationStringency stringency, boolean includeUnmappedReads) {
    PCollection<GATKRead> preads;
    if(cloudStorageUrl){
        Iterable<Contig> contigs = intervals.stream()
                .map(i -> new Contig(i.getContig(), i.getStart(), i.getEnd()))
                .collect(Collectors.toList());
        try {
            PCollection<Read> rawReads = ReadBAMTransform.getReadsFromBAMFilesSharded(pipeline, auth,contigs, new ReaderOptions(stringency, includeUnmappedReads), bam, ShardingPolicy.LOCI_SIZE_POLICY);
            preads = rawReads.apply(new GoogleGenomicsReadToGATKRead());
        } catch (IOException ex) {
            throw new UserException.CouldNotReadInputFile("Unable to read "+bam, ex);
        }
    } else if (hadoopUrl) {
        preads = DataflowUtils.getReadsFromHadoopBam(pipeline, intervals, stringency, bam);
    } else {
        preads = DataflowUtils.getReadsFromLocalBams(pipeline, intervals, stringency, ImmutableList.of(new File(bam)));
    }
    return preads;
}
 
开发者ID:broadinstitute,项目名称:gatk-dataflow,代码行数:28,代码来源:ReadsDataflowSource.java


示例2: bases

import com.google.api.services.genomics.model.Read; //导入依赖的package包/类
@DataProvider(name = "bases")
public Object[][] bases() {
    Object[][] data = new Object[2][];
    List<Class<?>> classes = Arrays.asList(Read.class, SAMRecord.class);
    for (int i = 0; i < classes.size(); ++i) {
        Class<?> c = classes.get(i);
        ReadsPreprocessingPipelineTestData testData = new ReadsPreprocessingPipelineTestData(c);

        List<GATKRead> reads = testData.getReads();
        List<KV<GATKRead, ReferenceBases>> kvReadRefBases = testData.getKvReadsRefBases();
        List<SimpleInterval> intervals = testData.getAllIntervals();
        List<Variant> variantList = testData.getVariants();
        List<KV<GATKRead, Iterable<Variant>>> kvReadiVariant = testData.getKvReadiVariantBroken();
        List<KV<GATKRead, ReadContextData>> kvReadContextData = testData.getKvReadContextData();
        data[i] = new Object[]{reads, variantList, kvReadRefBases, kvReadContextData, intervals, kvReadiVariant};
    }
    return data;
}
 
开发者ID:broadinstitute,项目名称:gatk-dataflow,代码行数:19,代码来源:AddContextDataToReadUnitTest.java


示例3: addContextDataWithCustomReferenceWindowFunctionTestData

import com.google.api.services.genomics.model.Read; //导入依赖的package包/类
@DataProvider(name = "AddContextDataWithCustomReferenceWindowFunctionTestData")
public Object[][] addContextDataWithCustomReferenceWindowFunctionTestData() throws IOException {

    final List<Object[]> testCases = new ArrayList<>();
    for ( final Class<?> readImplementation : Arrays.asList(SAMRecord.class, Read.class) ) {
        // Test case layout: read, mock reference source, reference window function to apply, expected ReferenceBases for read

        // Read at start of contig, identity function
        testCases.add(new Object[]{ makeRead("1", 1, 10, 0, readImplementation), ReferenceWindowFunctions.IDENTITY_FUNCTION, new ReferenceBases("AGCCTTTCGA".getBytes(), new SimpleInterval("1", 1, 10)) });
        // Read at start of contig, expand by 1 base on each side (goes off contig bounds)
        testCases.add(new Object[]{ makeRead("1", 1, 10, 0, readImplementation), new ReferenceWindowFunctions.FixedWindowFunction(1, 1), new ReferenceBases("AGCCTTTCGAA".getBytes(), new SimpleInterval("1", 1, 11)) });
        // Read at start of contig, expand by 3 bases on the left and 5 bases on the right (goes off contig bounds)
        testCases.add(new Object[]{ makeRead("1", 1, 10, 0, readImplementation), new ReferenceWindowFunctions.FixedWindowFunction(3, 5), new ReferenceBases("AGCCTTTCGAACTGA".getBytes(), new SimpleInterval("1", 1, 15)) });
        // Read in middle of contig, identity function
        testCases.add(new Object[]{ makeRead("1", 20, 11, 0, readImplementation), ReferenceWindowFunctions.IDENTITY_FUNCTION, new ReferenceBases("GTTCCTGGGGT".getBytes(), new SimpleInterval("1", 20, 30)) });
        // Read in middle of contig, expand by 1 base on each side
        testCases.add(new Object[]{ makeRead("1", 20, 11, 0, readImplementation), new ReferenceWindowFunctions.FixedWindowFunction(1, 1), new ReferenceBases("CGTTCCTGGGGTT".getBytes(), new SimpleInterval("1", 19, 31)) });
        // Read in middle of contig, expand by 3 bases on the left and 5 bases on the right
        testCases.add(new Object[]{ makeRead("1", 20, 11, 0, readImplementation), new ReferenceWindowFunctions.FixedWindowFunction(3, 5), new ReferenceBases("CCCGTTCCTGGGGTTATAC".getBytes(), new SimpleInterval("1", 17, 35)) });
        // Read in middle of contig, expand by 30 bases on the left and 10 bases on the right (goes off contig bounds)
        testCases.add(new Object[]{ makeRead("1", 20, 11, 0, readImplementation), new ReferenceWindowFunctions.FixedWindowFunction(30, 10), new ReferenceBases("AGCCTTTCGAACTGAGCCCGTTCCTGGGGTTATACCCGGC".getBytes(), new SimpleInterval("1", 1, 40)) });
    }
    return testCases.toArray(new Object[][]{});
}
 
开发者ID:broadinstitute,项目名称:gatk-dataflow,代码行数:25,代码来源:AddContextDataToReadUnitTest.java


示例4: variantsAndReads

import com.google.api.services.genomics.model.Read; //导入依赖的package包/类
@DataProvider(name = "variantsAndReads")
public Object[][] variantsAndReads(){
    Object[][] data = new Object[2][];
    List<Class<?>> classes = Arrays.asList(Read.class, SAMRecord.class);
    for (int i = 0; i < classes.size(); ++i) {
        Class<?> c = classes.get(i);
        ReadsPreprocessingPipelineTestData testData = new ReadsPreprocessingPipelineTestData(c);

        List<GATKRead> reads = testData.getReads();
        List<Variant> variantList = testData.getVariants();
        List<KV<GATKRead, Iterable<Variant>>> kvReadiVariant = testData.getKvReadiVariantBroken();

        data[i] = new Object[]{reads, variantList, kvReadiVariant};
    }
    return data;
}
 
开发者ID:broadinstitute,项目名称:gatk-dataflow,代码行数:17,代码来源:KeyVariantsByReadUnitTest.java


示例5: keyedReads

import com.google.api.services.genomics.model.Read; //导入依赖的package包/类
@DataProvider(name = "keyedVariantShardsReads")
public Object[][] keyedReads(){
    Object[][] data = new Object[2][];
    List<Class<?>> classes = Arrays.asList(Read.class, SAMRecord.class);
    for (int i = 0; i < classes.size(); ++i) {
        Class<?> c = classes.get(i);
        ReadsPreprocessingPipelineTestData testData = new ReadsPreprocessingPipelineTestData(c);

        List<GATKRead> reads = testData.getReads();
        List<KV<UUID, GATKRead>> expected = Arrays.asList(
                KV.of(reads.get(0).getUUID(), reads.get(0)),
                KV.of(reads.get(1).getUUID(), reads.get(1)),
                KV.of(reads.get(2).getUUID(), reads.get(2)),
                KV.of(reads.get(3).getUUID(), reads.get(3)),
                KV.of(reads.get(4).getUUID(), reads.get(4))
        );
        data[i] = new Object[]{reads, expected};
    }
    return data;
}
 
开发者ID:broadinstitute,项目名称:gatk-dataflow,代码行数:21,代码来源:KeyReadsByUUIDUnitTest.java


示例6: keyReadsByRefShardWithCustomWindowFunctionTestData

import com.google.api.services.genomics.model.Read; //导入依赖的package包/类
@DataProvider(name = "KeyReadsByRefShardWithCustomWindowFunctionTestData")
public Object[][] keyReadsByRefShardWithCustomWindowFunctionTestData() {
    final List<GATKRead> samReads = ReadsPreprocessingPipelineTestData.makeReferenceShardBoundaryReads(2, 3, SAMRecord.class);
    final List<GATKRead> googleReads = ReadsPreprocessingPipelineTestData.makeReferenceShardBoundaryReads(2, 3, Read.class);

    return new Object[][] {
            // Test case layout: reads, reference window function to apply, expected shard + reads pairs

            // Identity function, SAM reads
            { samReads, ReferenceWindowFunctions.IDENTITY_FUNCTION, generateExpectedCustomWindowResult(samReads, 0, 0) },
            // Identity function, google reads
            { googleReads, ReferenceWindowFunctions.IDENTITY_FUNCTION, generateExpectedCustomWindowResult(googleReads, 0, 0) },
            // Expand reads by 1 base on each side, SAM reads
            { samReads, new ReferenceWindowFunctions.FixedWindowFunction(1, 1), generateExpectedCustomWindowResult(samReads, 1, 1) },
            // Expand reads by 1 base on each side, google reads
            { googleReads, new ReferenceWindowFunctions.FixedWindowFunction(1, 1), generateExpectedCustomWindowResult(googleReads, 1, 1) },
            // Expand reads by 3 bases on the left and 5 bases on the right, SAM reads
            { samReads, new ReferenceWindowFunctions.FixedWindowFunction(3, 5), generateExpectedCustomWindowResult(samReads, 3, 5) },
            // Expand reads by 3 bases on the left and 5 bases on the right, google reads
            { googleReads, new ReferenceWindowFunctions.FixedWindowFunction(3, 5), generateExpectedCustomWindowResult(googleReads, 3, 5) },
    };
}
 
开发者ID:broadinstitute,项目名称:gatk-dataflow,代码行数:23,代码来源:KeyReadsByRefShardUnitTest.java


示例7: testEquality

import com.google.api.services.genomics.model.Read; //导入依赖的package包/类
@Test
public void testEquality() {
    Read read1 = new Read();
    Read read2 = new Read();

    read1.setAlignment(new LinearAlignment());
    read1.getAlignment().setPosition(new Position());
    read1.getAlignment().getPosition().setReferenceName("FOO");

    read2.setAlignment(new LinearAlignment());
    read2.getAlignment().setPosition(new Position());
    read2.getAlignment().getPosition().setReferenceName("FOO");

    Assert.assertEquals(read1, read2, "equal reads not equal");

    read2.getAlignment().getPosition().setReferenceName("BAR");
    Assert.assertNotEquals(read1, read2, "unequal reads are equal");
}
 
开发者ID:broadinstitute,项目名称:gatk-dataflow,代码行数:19,代码来源:ReadEqualityUnitTest.java


示例8: testCodingInIterable

import com.google.api.services.genomics.model.Read; //导入依赖的package包/类
/**
 * Tests what happens when trying to read two concatenated JSON objects using GenericJsonCoder
 */
@Test
public void testCodingInIterable() throws IOException {
  Read read = new Read();
  read.setId("TEST_READ_1");

  GenericJsonCoder<Read> coder = GenericJsonCoder.of(Read.class);
  ByteArrayOutputStream output = new ByteArrayOutputStream();
  coder.encode(read, output);
  read.setId("TEST_READ_2");
  coder.encode(read, output);

  InputStream input = new ByteArrayInputStream(output.toByteArray());
  Read out = coder.decode(input);
  assertTrue(out.getId().equals("TEST_READ_1"));
  out = coder.decode(input);
  assertTrue(out.getId().equals("TEST_READ_2"));
}
 
开发者ID:googlegenomics,项目名称:dataflow-java,代码行数:21,代码来源:GenericJsonCoderTest.java


示例9: bases

import com.google.api.services.genomics.model.Read; //导入依赖的package包/类
@DataProvider(name = "bases")
public Object[][] bases() {
    List<Class<?>> classes = Arrays.asList(Read.class, SAMRecord.class);
    JoinStrategy[] strategies = JoinStrategy.values();
    Object[][] data = new Object[classes.size() * strategies.length][];
    for (int i = 0; i < classes.size(); ++i) {
        Class<?> c = classes.get(i);
        ReadsPreprocessingPipelineSparkTestData testData = new ReadsPreprocessingPipelineSparkTestData(c);

        List<GATKRead> reads = testData.getReads();
        List<GATKVariant> variantList = testData.getVariants();
        List<KV<GATKRead, ReadContextData>> expectedReadContextData = testData.getKvReadContextData();
        for (int j = 0; j < strategies.length; j++) {
            data[i * strategies.length + j] = new Object[]{reads, variantList, expectedReadContextData, strategies[j]};
        }
    }
    return data;
}
 
开发者ID:broadinstitute,项目名称:gatk,代码行数:19,代码来源:AddContextDataToReadSparkUnitTest.java


示例10: pairedReadsAndVariants

import com.google.api.services.genomics.model.Read; //导入依赖的package包/类
@DataProvider(name = "pairedReadsAndVariants")
public Object[][] pairedReadsAndVariants(){
    List<Object[]> testCases = new ArrayList<>();

    for ( JoinStrategy joinStrategy : JoinStrategy.values() ) {
        for ( Class<?> readImplementation : Arrays.asList(Read.class, SAMRecord.class) ) {
            ReadsPreprocessingPipelineSparkTestData testData = new ReadsPreprocessingPipelineSparkTestData(readImplementation);
            List<GATKRead> reads = testData.getReads();
            List<GATKVariant> variantList = testData.getVariants();
            List<KV<GATKRead, Iterable<GATKVariant>>> kvReadiVariant = testData.getKvReadiVariant();

            testCases.add(new Object[]{reads, variantList, kvReadiVariant, joinStrategy});
        }
    }
    return testCases.toArray(new Object[][]{});
}
 
开发者ID:broadinstitute,项目名称:gatk,代码行数:17,代码来源:JoinReadsWithVariantsSparkUnitTest.java


示例11: basicGoogleGenomicsRead

import com.google.api.services.genomics.model.Read; //导入依赖的package包/类
/**
 * Creates a basic mapped Google read with a mapped mate.
 * @return GoogleGenomicsRead
 */
private static Read basicGoogleGenomicsRead() {
    final Read read = ArtificialReadUtils.createArtificialGoogleGenomicsRead(
            BASIC_READ_NAME,
            BASIC_READ_CONTIG,
            BASIC_READ_START,
            BASIC_READ_BASES,
            BASIC_READ_BASE_QUALITIES,
            BASIC_READ_CIGAR
    );
    read.setReadGroupId(BASIC_READ_GROUP);
    read.getAlignment().getPosition().setReverseStrand(false);
    read.getAlignment().setMappingQuality(BASIC_READ_MAPPING_QUALITY);
    read.setNextMatePosition(new Position());
    read.getNextMatePosition().setReferenceName(BASIC_READ_MATE_CONTIG);
    read.getNextMatePosition().setPosition((long) BASIC_READ_MATE_START - 1);
    read.getNextMatePosition().setReverseStrand(false);
    read.setNumberReads(2);
    read.setReadNumber(0);
    read.setProperPlacement(false);
    Map<String, List<Object>> infoMap = new LinkedHashMap<>();
    infoMap.put(SAMTag.PG.name(), Collections.singletonList(BASIC_PROGRAM));
    read.setInfo(infoMap);

    return read;
}
 
开发者ID:broadinstitute,项目名称:gatk,代码行数:30,代码来源:GATKReadAdaptersUnitTest.java


示例12: getUnclippedStartAndEndData

import com.google.api.services.genomics.model.Read; //导入依赖的package包/类
@DataProvider(name = "GetUnclippedStartAndEndData")
public Object[][] getUnclippedStartAndEndData() {
    final SAMRecord softClippedSam = basicSAMRecord();
    softClippedSam.setCigarString("1S2M1S");

    final SAMRecord hardClippedSam = basicSAMRecord();
    hardClippedSam.setCigarString("3H2M2H");

    final Read softClippedGoogleRead = basicGoogleGenomicsRead();
    softClippedGoogleRead.getAlignment().setCigar(CigarConversionUtils.convertSAMCigarToCigarUnitList(TextCigarCodec.decode("1S2M1S")));

    final Read hardClippedGoogleRead = basicGoogleGenomicsRead();
    hardClippedGoogleRead.getAlignment().setCigar(CigarConversionUtils.convertSAMCigarToCigarUnitList(TextCigarCodec.decode("3H2M2H")));

    return new Object[][]{
            { new SAMRecordToGATKReadAdapter(softClippedSam), BASIC_READ_START - 1, BASIC_READ_START + 2 },
            { new SAMRecordToGATKReadAdapter(hardClippedSam), BASIC_READ_START - 3, BASIC_READ_START + 3 },
            { new GoogleGenomicsReadToGATKReadAdapter(softClippedGoogleRead), BASIC_READ_START - 1, BASIC_READ_START + 2 },
            { new GoogleGenomicsReadToGATKReadAdapter(hardClippedGoogleRead), BASIC_READ_START - 3, BASIC_READ_START + 3 }
    };
}
 
开发者ID:broadinstitute,项目名称:gatk,代码行数:22,代码来源:GATKReadAdaptersUnitTest.java


示例13: getAndSetMappingQualityData

import com.google.api.services.genomics.model.Read; //导入依赖的package包/类
@DataProvider(name = "GetAndSetMappingQualityData")
public Object[][] getAndSetMappingQualityData() {
    final SAMRecord samWithMappingQualityZero = basicSAMRecord();
    samWithMappingQualityZero.setMappingQuality(0);

    final Read googleReadWithMappingQualityZero = basicGoogleGenomicsRead();
    googleReadWithMappingQualityZero.getAlignment().setMappingQuality(0);

    final Read googleReadWithNoMappingQuality = basicGoogleGenomicsRead();
    googleReadWithNoMappingQuality.getAlignment().setMappingQuality(null);

    return new Object[][]{
            { basicReadBackedBySam(), BASIC_READ_MAPPING_QUALITY },
            { basicReadBackedByGoogle(), BASIC_READ_MAPPING_QUALITY },
            { new SAMRecordToGATKReadAdapter(samWithMappingQualityZero), 0 },
            { new GoogleGenomicsReadToGATKReadAdapter(googleReadWithMappingQualityZero), 0 },
            { new GoogleGenomicsReadToGATKReadAdapter(googleReadWithNoMappingQuality), ReadConstants.NO_MAPPING_QUALITY }
    };
}
 
开发者ID:broadinstitute,项目名称:gatk,代码行数:20,代码来源:GATKReadAdaptersUnitTest.java


示例14: getAndSetBaseQualitiesData

import com.google.api.services.genomics.model.Read; //导入依赖的package包/类
@DataProvider(name = "GetAndSetBaseQualitiesData")
public Object[][] getAndSetBaseQualitiesData() {
    final SAMRecord noQualsSam = basicSAMRecord();
    noQualsSam.setBaseQualities(null);

    final SAMRecord emptyQualsSam = basicSAMRecord();
    emptyQualsSam.setBaseQualities(new byte[0]);

    final Read noQualsGoogleRead = basicGoogleGenomicsRead();
    noQualsGoogleRead.setAlignedQuality(null);

    final Read emptyQualsGoogleRead = basicGoogleGenomicsRead();
    emptyQualsGoogleRead.setAlignedQuality(new ArrayList<>());

    return new Object[][]{
            { basicReadBackedBySam(), BASIC_READ_BASE_QUALITIES },
            { basicReadBackedByGoogle(), BASIC_READ_BASE_QUALITIES },
            { new SAMRecordToGATKReadAdapter(noQualsSam), new byte[0] },
            { new SAMRecordToGATKReadAdapter(emptyQualsSam), new byte[0] },
            { new GoogleGenomicsReadToGATKReadAdapter(noQualsGoogleRead), new byte[0] },
            { new GoogleGenomicsReadToGATKReadAdapter(emptyQualsGoogleRead), new byte[0] }
    };
}
 
开发者ID:broadinstitute,项目名称:gatk,代码行数:24,代码来源:GATKReadAdaptersUnitTest.java


示例15: getAndSetCigarData

import com.google.api.services.genomics.model.Read; //导入依赖的package包/类
@DataProvider(name = "GetAndSetCigarData")
public Object[][] getAndSetCigarData() {

    SAMRecord noCigarSam = basicSAMRecord();
    noCigarSam.setCigar(null);

    SAMRecord emptyCigarSam = basicSAMRecord();
    emptyCigarSam.setCigar(new Cigar());

    Read noCigarRead = basicGoogleGenomicsRead();
    noCigarRead.getAlignment().setCigar(null);

    Read emptyCigarRead = basicGoogleGenomicsRead();
    emptyCigarRead.getAlignment().setCigar(null);

    return new Object[][]{
            { basicReadBackedBySam(), TextCigarCodec.decode(BASIC_READ_CIGAR) },
            { basicReadBackedByGoogle(), TextCigarCodec.decode(BASIC_READ_CIGAR) },
            { new SAMRecordToGATKReadAdapter(noCigarSam), new Cigar() },
            { new SAMRecordToGATKReadAdapter(emptyCigarSam), new Cigar() },
            { new GoogleGenomicsReadToGATKReadAdapter(noCigarRead), new Cigar() },
            { new GoogleGenomicsReadToGATKReadAdapter(emptyCigarRead), new Cigar() }
    };
}
 
开发者ID:broadinstitute,项目名称:gatk,代码行数:25,代码来源:GATKReadAdaptersUnitTest.java


示例16: readNumberTestData

import com.google.api.services.genomics.model.Read; //导入依赖的package包/类
@DataProvider(name = "ReadNumberTestData")
public Object[][] readNumberTestData() {
    SAMRecord secondOfPairSam = basicSAMRecord();
    secondOfPairSam.setSecondOfPairFlag(true);
    secondOfPairSam.setFirstOfPairFlag(false);

    Read secondOfPairGoogleRead = basicGoogleGenomicsRead();
    secondOfPairGoogleRead.setReadNumber(1);

    return new Object[][] {
            { basicReadBackedBySam(), true, false },
            { basicReadBackedByGoogle(), true, false },
            { new SAMRecordToGATKReadAdapter(secondOfPairSam), false, true },
            { new GoogleGenomicsReadToGATKReadAdapter(secondOfPairGoogleRead), false, true }
    };
}
 
开发者ID:broadinstitute,项目名称:gatk,代码行数:17,代码来源:GATKReadAdaptersUnitTest.java


示例17: ReadSummary

import com.google.api.services.genomics.model.Read; //导入依赖的package包/类
/**
 * Init from list of reads at candidate position
 * @param reads
 * @param candidatePosition
 */
public ReadSummary(List<Read> reads, Long candidatePosition) {
  for (Read read : reads) {
    String alignedBases = read.getAlignedSequence();
    Integer offset = (int) (candidatePosition - read.getAlignment().getPosition().getPosition());
    String baseAtPos = alignedBases.substring(offset, offset + 1);
    
    if (baseAtPos.equals("-")) {
      continue;
    }
      
    Allele alleleAtPos = Allele.valueOf(baseAtPos);
    count.put(alleleAtPos,
        (count.containsKey(alleleAtPos) ? count.get(alleleAtPos) : 0) + 1);
  }
}
 
开发者ID:googlegenomics,项目名称:denovo-variant-caller-java,代码行数:21,代码来源:ReadSummary.java


示例18: runBayesDenovoInference

import com.google.api.services.genomics.model.Read; //导入依赖的package包/类
/**
 * Retreives Reads and makes a call to inference engine
 * @param callHolder container for storing candidate calls
 * @param writer print stream 
 * @throws IOException
 */
void runBayesDenovoInference(CallHolder callHolder, PrintWriter writer) throws IOException {
  // get reads for chromosome and position
  Map<TrioMember, List<Read>> readMap = getReadMap(callHolder.chromosome, callHolder.position);

  // Extract the relevant bases for the currrent position
  Map<TrioMember, ReadSummary> readSummaryMap = getReadSummaryMap(callHolder.position, readMap);

  // Call the bayes inference algorithm to generate likelihood
  BayesInfer.BayesCallResult result =
      bayesInferrer.infer(readSummaryMap, shared.getInferMethod());

  if (result.isDenovo()) {
    shared.getLogger().fine(String.format(
        "%s,%d,%s", callHolder.chromosome, callHolder.position, result.getDetails()));
    synchronized (this) {
      writeCalls(writer, String.format("%s,%d,%s%n", callHolder.chromosome, callHolder.position,
          result.getDetails()));
    }
  }
}
 
开发者ID:googlegenomics,项目名称:denovo-variant-caller-java,代码行数:27,代码来源:ReadCaller.java


示例19: getFlags

import com.google.api.services.genomics.model.Read; //导入依赖的package包/类
public static int getFlags(Read read) {
  Position position = read.getAlignment() == null ? null : read.getAlignment().getPosition();
  Position nextMatePosition = read.getNextMatePosition();

  int flags = 0;

  boolean paired = Integer.valueOf(2).equals(read.getNumberReads());
  flags += paired ? 1 : 0; // read_paired
  flags += Boolean.TRUE.equals(read.getProperPlacement()) ? 2 : 0; // read_proper_pair
  flags += isUnmapped(position) ? 4 : 0; // read_unmapped
  flags += paired && isUnmapped(nextMatePosition) ? 8 : 0; // mate_unmapped
  flags += isReverseStrand(position) ? 16 : 0 ; // read_reverse_strand
  flags += isReverseStrand(nextMatePosition) ? 32 : 0; // mate_reverse_strand
  flags += Integer.valueOf(0).equals(read.getReadNumber()) ? 64 : 0; // first_in_pair
  flags += Integer.valueOf(1).equals(read.getReadNumber()) ? 128 : 0; // second_in_pair
  flags += Boolean.TRUE.equals(read.getSecondaryAlignment()) ? 256 : 0; // secondary_alignment
  flags += Boolean.TRUE.equals(read.getFailedVendorQualityChecks()) ? 512 : 0; // failed_quality
  flags += Boolean.TRUE.equals(read.getDuplicateFragment()) ? 1024 : 0; // duplicate_read
  flags += Boolean.TRUE.equals(read.getSupplementaryAlignment()) ? 2048 : 0; // supplementary

  return flags;
}
 
开发者ID:googlegenomics,项目名称:utils-java,代码行数:23,代码来源:ReadUtils.java


示例20: createSearch

import com.google.api.services.genomics.model.Read; //导入依赖的package包/类
@Override Genomics.Reads.Search createSearch(Genomics.Reads api, final SearchReadsRequest request,
    Optional<String> pageToken) throws IOException {

  if(shardBoundary == ShardBoundary.Requirement.STRICT) {
    // TODO: When this is supported server-side, instead verify that request.getIntersectionType
    // will yield a strict shard.
    shardPredicate = new Predicate<Read>() {
      @Override
      public boolean apply(Read read) {
        return read.getAlignment().getPosition().getPosition() >= request.getStart();
      }
    };
  }

  return api.search(pageToken
      .transform(
          new Function<String, SearchReadsRequest>() {
            @Override public SearchReadsRequest apply(String token) {
              return request.setPageToken(token);
            }
          })
      .or(request));
}
 
开发者ID:googlegenomics,项目名称:utils-java,代码行数:24,代码来源:Paginator.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ResultSet类代码示例发布时间:2022-05-22
下一篇:
Java DocumentImpl类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap