本文整理汇总了Java中htsjdk.samtools.ValidationStringency.SILENT属性的典型用法代码示例。如果您正苦于以下问题:Java ValidationStringency.SILENT属性的具体用法?Java ValidationStringency.SILENT怎么用?Java ValidationStringency.SILENT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类htsjdk.samtools.ValidationStringency
的用法示例。
在下文中一共展示了ValidationStringency.SILENT属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testMissingPhasingValuesSilent
/** Silently continue if we encounter a tile without phasing/pre-phasing metrics. */
@Test
public void testMissingPhasingValuesSilent() throws IOException {
final ReadStructure readStructure = new ReadStructure("151T8B8B151T");
for (final boolean useReadStructure : Arrays.asList(true, false)) {
final File runDirectory = TEST_MISSING_PHASING_DIRECTORY;
final CollectIlluminaLaneMetrics clp = new CollectIlluminaLaneMetrics();
clp.OUTPUT_DIRECTORY = IOUtil.createTempDir("illuminaLaneMetricsCollectorTest", null);
clp.RUN_DIRECTORY = runDirectory;
clp.OUTPUT_PREFIX = "test";
clp.VALIDATION_STRINGENCY = ValidationStringency.SILENT;
if (useReadStructure) clp.READ_STRUCTURE = readStructure;
clp.doWork();
final File phasingMetricsFile = buildOutputFile(clp.OUTPUT_DIRECTORY, clp.OUTPUT_PREFIX, IlluminaPhasingMetrics.getExtension());
final File canonicalPhasingFile = buildOutputFile(runDirectory, runDirectory.getName(), IlluminaPhasingMetrics.getExtension());
IOUtil.assertFilesEqual(canonicalPhasingFile, phasingMetricsFile);
final File laneMetricsFile = buildOutputFile(clp.OUTPUT_DIRECTORY, clp.OUTPUT_PREFIX, IlluminaLaneMetrics.getExtension());
final File canonicalLaneFile = buildOutputFile(runDirectory, runDirectory.getName(), IlluminaLaneMetrics.getExtension());
IOUtil.assertFilesEqual(canonicalLaneFile, laneMetricsFile);
IOUtil.deleteDirectoryTree(clp.OUTPUT_DIRECTORY);
}
}
示例2: align
private void align(Context context) throws IOException, InterruptedException {
result = mem.align(L1, L2);
for (int i = 0; i < result.length; i++) {
String read = result[i];
String sample = ((SingleRead) L1.get(i / 2)).getFilename();
/**
* hack to write a valid SAM since BWA MEM outputs tabs at the end,
* samtools can not handle this
*/
read = read.replaceAll("\\t+$", "");
read = read.replaceAll("\\s+$", "");
String tiles[] = read.split("\t+\n");
for (String tile : tiles) {
SAMLineParser parser = new SAMLineParser(new DefaultSAMRecordFactory(),
ValidationStringency.SILENT, new SAMFileHeader(),
null, null);
SAMRecord samRecord = parser.parseLine(tile);
if(samRecord.getIntegerAttribute("AS")<30){
continue;
}
out.clear();
out.set(tile);
context.write(new Text(sample), out);
}
}
L1.clear();
L2.clear();
}
示例3: decodeAll
@Override
public Iterator<PicardAlignment> decodeAll(InputStream is, boolean strictParsing) throws IOException {
SAMFileReader reader = new SAMFileReader(is);
ValidationStringency stringency =
strictParsing ? ValidationStringency.STRICT : ValidationStringency.SILENT;
reader.setValidationStringency(stringency);
return new WrappedIterator(reader.iterator());
}
示例4: testReadFromFileFn
@Test
public void testReadFromFileFn(){
List<SimpleInterval> intervals = Arrays.asList(new SimpleInterval("chr7:1-202"), new SimpleInterval("chr8:2-202"));
DoFn<File, GATKRead> readfn = new DataflowUtils.LoadReadsFromFileFn(intervals, ValidationStringency.SILENT);
File inputFile = new File(getToolTestDataDir(), "example_reads.bam");
List<GATKRead> expected = getReadsFromFile(intervals, inputFile, false);
DoFnTester<File, GATKRead> tester = DoFnTester.of(readfn);
List<GATKRead> output = tester.processBatch(inputFile);
Assert.assertTrue(ReadUtils.readListsAreEqualIgnoreUUID(output, expected), "Actual reads do not match expected reads");
}
示例5: main
public static void main(String[] args) throws IOException, IllegalArgumentException, IllegalAccessException {
Log.setGlobalLogLevel(LogLevel.INFO);
File cramFile = new File(args[0]);
InputStream is = new BufferedInputStream(new FileInputStream(cramFile));
CramHeader header = CramIO.readCramHeader(is);
Container c = null;
while ((c = ContainerIO.readContainer(header.getVersion(), is)) != null && !c.isEOF()) {
for (Slice slice : c.slices) {
final DataReaderFactory dataReaderFactory = new DataReaderFactory();
final Map<Integer, InputStream> inputMap = new HashMap<Integer, InputStream>();
for (final Integer exId : slice.external.keySet()) {
inputMap.put(exId, new ByteArrayInputStream(slice.external.get(exId).getRawContent()));
}
final CramRecordReader reader = new CramRecordReader(ValidationStringency.SILENT);
dataReaderFactory.buildReader(reader, new DefaultBitInputStream(new ByteArrayInputStream(
slice.coreBlock.getRawContent())), inputMap, c.header, slice.sequenceId);
for (int i = 0; i < slice.nofRecords; i++) {
CramCompressionRecord record = new CramCompressionRecord();
reader.read(record);
if (record.isSegmentUnmapped() || record.readFeatures == null || record.readFeatures.isEmpty())
continue;
for (ReadFeature rf : record.readFeatures) {
if (rf.getOperator() == ReadBase.operator) {
System.out.println("Read feature B detected.");
System.exit(1);
}
}
}
}
}
}
示例6: getMutliRefEntries
private static Collection<Entry> getMutliRefEntries(CompressionHeader header, Slice slice, long containerOffset,
int[] landmarks) throws IllegalArgumentException, IllegalAccessException, IOException {
final DataReaderFactory dataReaderFactory = new DataReaderFactory();
final Map<Integer, InputStream> inputMap = new HashMap<Integer, InputStream>();
for (final Integer exId : slice.external.keySet()) {
inputMap.put(exId, new ByteArrayInputStream(slice.external.get(exId).getRawContent()));
}
final RefSeqIdReader reader = new RefSeqIdReader(slice.sequenceId, slice.alignmentStart,
ValidationStringency.SILENT);
dataReaderFactory.buildReader(reader,
new DefaultBitInputStream(new ByteArrayInputStream(slice.coreBlock.getRawContent())), inputMap, header,
slice.sequenceId);
reader.APDelta = header.APDelta;
for (int i = 0; i < slice.nofRecords; i++) {
final CramCompressionRecord record = new CramCompressionRecord();
record.sliceIndex = slice.index;
record.index = i;
reader.read();
if (record.sequenceId == slice.sequenceId) {
record.sequenceId = slice.sequenceId;
} else {
if (record.sequenceId == SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX)
record.sequenceName = SAMRecord.NO_ALIGNMENT_REFERENCE_NAME;
}
}
Map<Integer, AlignmentSpan> spans = reader.getReferenceSpans();
List<Entry> entries = new ArrayList<CramIndex.Entry>(spans.size());
for (int seqId : spans.keySet()) {
Entry e = new Entry();
e.sequenceId = seqId;
AlignmentSpan span = spans.get(seqId);
e.alignmentStart = span.getStart();
e.alignmentSpan = span.getSpan();
e.sliceSize = slice.size;
e.sliceIndex = slice.index;
e.containerStartOffset = containerOffset;
e.sliceOffset = landmarks[slice.index];
entries.add(e);
}
return entries;
}