/** Gets a string system property, prefixed with "samjdk." using the default * if the property does not exist or if the java.security manager raises an exception for * applications started with -Djava.security.manager . */ private static String getStringProperty(final String name, final String def) { try { return System.getProperty("samjdk." + name, def); } catch (final java.security.AccessControlException error) { log.warn(error,"java Security Manager forbids 'System.getProperty(\"" + name + "\")' , returning default value: " + def ); return def; } }
/** Gets a string system property, prefixed with "samjdk." using the default * if the property does not exist or if the java.security manager raises an exception for * applications started with -Djava.security.manager . */ private static String getStringProperty(final String name, final String def) { try { return System.getProperty("samjdk." + name, def); } catch (final java.security.AccessControlException error) { log.warn(error,"java Security Manager forbids 'System.getProperty(\"" + name + "\")' , returning default value: " + def ); return def; } }
/** Checks whether a string system property, prefixed with "samjdk.", exists. * If the property does not exist or if the java.security manager raises an exception for * applications started with -Djava.security.manager this method returns false. */ private static boolean hasProperty(final String name){ try { return null != System.getProperty("samjdk." + name); } catch (final java.security.AccessControlException error) { log.warn(error,"java Security Manager forbids 'System.getProperty(\"" + name + "\")' , returning false"); return false; } }
/** Checks whether a string system property, prefixed with "samjdk.", exists. * If the property does not exist or if the java.security manager raises an exception for * applications started with -Djava.security.manager this method returns false. */ private static boolean hasProperty(final String name){ try { return null != System.getProperty("samjdk." + name); } catch (final java.security.AccessControlException error) { log.warn(error,"java Security Manager forbids 'System.getProperty(\"" + name + "\")' , returning false"); return false; } }
ExperimentalCodec(final BitInputStream coreBlockInputStream, final BitOutputStream coreBlockOutputStream) { super(coreBlockInputStream, coreBlockOutputStream); final String subclass = this.getClass().getName(); final String warning = String.format( "Using the experimental codec %s which is untested and scheduled for removal from the CRAM spec", subclass); final Log log = Log.getInstance(ExperimentalCodec.class); log.warn(warning); } }
ExperimentalEncoding(final EncodingID encodingID) { super(encodingID); final String subclass = this.getClass().getName(); final String warning = String.format( "Using the experimental encoding %s which is untested and scheduled for removal from the CRAM spec", subclass); final Log log = Log.getInstance(ExperimentalEncoding.class); log.warn(warning); } }
private File findIndexForFile(File indexFile, final File cramFile) { indexFile = indexFile == null ? SamFiles.findIndex(cramFile) : indexFile; if (indexFile != null && indexFile.lastModified() < cramFile.lastModified()) { log.warn("CRAM index file " + indexFile.getAbsolutePath() + " is older than CRAM " + cramFile.getAbsolutePath()); } return indexFile; }
private File findIndexForFile(File indexFile, final File cramFile) { indexFile = indexFile == null ? SamFiles.findIndex(cramFile) : indexFile; if (indexFile != null && indexFile.lastModified() < cramFile.lastModified()) { log.warn("CRAM index file " + indexFile.getAbsolutePath() + " is older than CRAM " + cramFile.getAbsolutePath()); } return indexFile; }
ExperimentalEncoding(final EncodingID encodingID) { super(encodingID); final String subclass = this.getClass().getName(); final String warning = String.format( "Using the experimental encoding %s which is untested and scheduled for removal from the CRAM spec", subclass); final Log log = Log.getInstance(ExperimentalEncoding.class); log.warn(warning); } }
ExperimentalCodec(final BitInputStream coreBlockInputStream, final BitOutputStream coreBlockOutputStream) { super(coreBlockInputStream, coreBlockOutputStream); final String subclass = this.getClass().getName(); final String warning = String.format( "Using the experimental codec %s which is untested and scheduled for removal from the CRAM spec", subclass); final Log log = Log.getInstance(ExperimentalCodec.class); log.warn(warning); } }
private static void eofNotFound(htsjdk.samtools.cram.common.Version version) { if (version.major >= 2 && version.minor >= 1) { log.error("Incomplete data: EOF marker not found."); if (quitOnMissingEOF) System.exit(1); } else { log.warn("EOF marker not found, possibly incomplete file/stream."); } }
/** * @return true if we have surpassed the maximum accumulation threshold for the first locus in the accumulator, false otherwise */ private boolean surpassedAccumulationThreshold() { final boolean surpassesThreshold = !accumulator.isEmpty() && accumulator.get(0).getRecordAndOffsets().size() >= maxReadsToAccumulatePerLocus; if (surpassesThreshold && !enforcedAccumulationLimit) { LOG.warn("We have encountered greater than " + maxReadsToAccumulatePerLocus + " reads at position " + accumulator.get(0).toString() + " and will ignore the remaining reads at this position. Note that further warnings will be suppressed."); enforcedAccumulationLimit = true; } return surpassesThreshold; }
/** * @return true if we have surpassed the maximum accumulation threshold for the first locus in the accumulator, false otherwise */ private boolean surpassedAccumulationThreshold() { final boolean surpassesThreshold = !accumulator.isEmpty() && accumulator.get(0).getRecordAndOffsets().size() >= maxReadsToAccumulatePerLocus; if (surpassesThreshold && !enforcedAccumulationLimit) { LOG.warn("We have encountered greater than " + maxReadsToAccumulatePerLocus + " reads at position " + accumulator.get(0).toString() + " and will ignore the remaining reads at this position. Note that further warnings will be suppressed."); enforcedAccumulationLimit = true; } return surpassesThreshold; }
/** * Main method for the program. Checks that input file is present and * readable, then iterates through the index printing meta data to stdout. */ protected int doWork() { if (INPUT.getName().endsWith(BAMIndex.BAMIndexSuffix)) log.warn("INPUT should be the BAM file name, not its index file"); IOUtil.assertFileIsReadable(INPUT); BAMIndexMetaData.printIndexStats(INPUT); return 0; } }
/** * Main method for the program. Checks that input file is present and * readable, then iterates through the index printing meta data to stdout. */ protected int doWork() { if (INPUT.getName().endsWith(BAMIndex.BAMIndexSuffix)) log.warn("INPUT should be the BAM file name, not its index file"); IOUtil.assertFileIsReadable(INPUT); BAMIndexMetaData.printIndexStats(INPUT); return 0; } }
@Override public void close() { log.debug("Closing UntemplatedSequenceAnnotator"); // TODO: close feeding thread more cleanly than just shutting down the process vcfStream.close(); try { aligner.close(); } catch (IOException e) { log.warn(e); } } }
@Override protected void setup(final SAMFileHeader header, final File samFile) { IOUtil.assertFileIsWritable(OUTPUT); if (header.getSequenceDictionary().isEmpty()) { log.warn(INPUT.getAbsoluteFile() + " has no sequence dictionary. If any reads " + "in the file are aligned, then alignment summary metrics collection will fail."); } final boolean doRefMetrics = REFERENCE_SEQUENCE != null; collector = new AlignmentSummaryMetricsCollector(METRIC_ACCUMULATION_LEVEL, header.getReadGroups(), doRefMetrics, ADAPTER_SEQUENCE, MAX_INSERT_SIZE, EXPECTED_PAIR_ORIENTATIONS, IS_BISULFITE_SEQUENCED); }
@Override protected void setup(final SAMFileHeader header, final File samFile) { IOUtil.assertFileIsWritable(OUTPUT); if (header.getSequenceDictionary().isEmpty()) { log.warn(INPUT.getAbsoluteFile() + " has no sequence dictionary. If any reads " + "in the file are aligned, then alignment summary metrics collection will fail."); } final boolean doRefMetrics = REFERENCE_SEQUENCE != null; collector = new AlignmentSummaryMetricsCollector(METRIC_ACCUMULATION_LEVEL, header.getReadGroups(), doRefMetrics, ADAPTER_SEQUENCE, MAX_INSERT_SIZE, EXPECTED_PAIR_ORIENTATIONS, IS_BISULFITE_SEQUENCED); }
private void warnIfReferenceIsTooLargeForBinField(final SAMRecord rec) { final SAMSequenceRecord sequence = rec.getHeader() != null ? rec.getHeader().getSequence(rec.getReferenceName()) : null; if (!isReferenceSizeWarningShowed && sequence != null && SAMUtils.isReferenceSequenceCompatibleWithBAI(sequence) && rec.getValidationStringency() != ValidationStringency.SILENT) { LOG.warn("Reference length is too large for BAM bin field. Values in the bin field could be incorrect."); isReferenceSizeWarningShowed = true; } }
private void warnIfReferenceIsTooLargeForBinField(final SAMRecord rec) { final SAMSequenceRecord sequence = rec.getHeader() != null ? rec.getHeader().getSequence(rec.getReferenceName()) : null; if (!isReferenceSizeWarningShowed && sequence != null && SAMUtils.isReferenceSequenceCompatibleWithBAI(sequence) && rec.getValidationStringency() != ValidationStringency.SILENT) { LOG.warn("Reference length is too large for BAM bin field. Values in the bin field could be incorrect."); isReferenceSizeWarningShowed = true; } }