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


Java SamFileValidator.validateSamFileVerbose方法代码示例

本文整理汇总了Java中htsjdk.samtools.SamFileValidator.validateSamFileVerbose方法的典型用法代码示例。如果您正苦于以下问题:Java SamFileValidator.validateSamFileVerbose方法的具体用法?Java SamFileValidator.validateSamFileVerbose怎么用?Java SamFileValidator.validateSamFileVerbose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在htsjdk.samtools.SamFileValidator的用法示例。


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

示例1: testCleanSam

import htsjdk.samtools.SamFileValidator; //导入方法依赖的package包/类
@Test(dataProvider = "testCleanSamDataProvider")
public void testCleanSam(final String samFile, final String expectedCigar) throws IOException {
    final File cleanedFile = File.createTempFile(samFile + ".", ".sam");
    cleanedFile.deleteOnExit();
    final String[] args = new String[]{
            "INPUT=" + new File(TEST_DATA_DIR, samFile).getAbsolutePath(),
            "OUTPUT=" + cleanedFile.getAbsolutePath()
    };
    Assert.assertEquals(runPicardCommandLine(args), 0);

    final SamFileValidator validator = new SamFileValidator(new PrintWriter(System.out), 8000);
    validator.setIgnoreWarnings(true);
    validator.setVerbose(true, 1000);
    validator.setErrorsToIgnore(Arrays.asList(SAMValidationError.Type.MISSING_READ_GROUP));
    SamReader samReader = SamReaderFactory.makeDefault().validationStringency(ValidationStringency.LENIENT).open(cleanedFile);
    final SAMRecord rec = samReader.iterator().next();
    samReader.close();
    Assert.assertEquals(rec.getCigarString(), expectedCigar);
    samReader = SamReaderFactory.makeDefault().validationStringency(ValidationStringency.LENIENT).open(cleanedFile);
    final boolean validated = validator.validateSamFileVerbose(samReader, null);
    samReader.close();
    Assert.assertTrue(validated, "ValidateSamFile failed");
}
 
开发者ID:broadinstitute,项目名称:picard,代码行数:24,代码来源:CleanSamTest.java

示例2: test

import htsjdk.samtools.SamFileValidator; //导入方法依赖的package包/类
protected void test() {
    try {
        final SamFileValidator validator = new SamFileValidator(new PrintWriter(System.out), 8000);

        // Validate it has the expected cigar
        validator.setIgnoreWarnings(true);
        validator.setVerbose(true, 1000);
        validator.setErrorsToIgnore(Arrays.asList(SAMValidationError.Type.MISSING_READ_GROUP));
        SamReaderFactory factory = SamReaderFactory.makeDefault().validationStringency(ValidationStringency.LENIENT);
        SamReader samReader = factory.open(getOutput());
        final SAMRecordIterator iterator = samReader.iterator();
        while (iterator.hasNext()) {
            final SAMRecord rec = iterator.next();
            Assert.assertEquals(rec.getCigarString(), expectedCigar);
            if (SAMUtils.hasMateCigar(rec)) {
                Assert.assertEquals(SAMUtils.getMateCigarString(rec), expectedCigar);
            }
        }
        CloserUtil.close(samReader);

        // Run validation on the output file
        samReader = factory.open(getOutput());
        final boolean validated = validator.validateSamFileVerbose(samReader, null);
        CloserUtil.close(samReader);

        Assert.assertTrue(validated, "ValidateSamFile failed");
    } finally {
        TestUtil.recursiveDelete(getOutputDir());
    }
}
 
开发者ID:broadinstitute,项目名称:picard,代码行数:31,代码来源:CleanSamTester.java

示例3: assertSamValid

import htsjdk.samtools.SamFileValidator; //导入方法依赖的package包/类
/**
 * causes an exception if the given sam isn't valid
 * @param reference is allowed to be null
 */
public static void assertSamValid(final File sam, final ValidationStringency validationStringency, final File reference) throws IOException {
    assertCRAMContentsIfCRAM(sam);
    try (final SamReader samReader = getReader(sam, validationStringency, reference)) {
        final SamFileValidator validator = new SamFileValidator(new PrintWriter(System.out), 8000);
        validator.setIgnoreWarnings(true);
        validator.setVerbose(true, 1000);
        validator.setErrorsToIgnore(Arrays.asList(SAMValidationError.Type.MISSING_READ_GROUP));
        final boolean validated = validator.validateSamFileVerbose(samReader, null);
        Assert.assertTrue(validated, "SAM file validation failed");
    }
}
 
开发者ID:broadinstitute,项目名称:gatk,代码行数:16,代码来源:SamAssertionUtils.java


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