本文整理了Java中htsjdk.samtools.util.Log.setGlobalLogLevel()
方法的一些代码示例,展示了Log.setGlobalLogLevel()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Log.setGlobalLogLevel()
方法的具体详情如下:
包路径:htsjdk.samtools.util.Log
类名称:Log
方法名:setGlobalLogLevel
[英]Set the log level.
[中]设置日志级别。
代码示例来源:origin: samtools/htsjdk
@BeforeClass
public void initClass() {
Log.setGlobalLogLevel(LogLevel.ERROR);
}
代码示例来源:origin: samtools/htsjdk
@BeforeClass
public void initClass() {
Log.setGlobalLogLevel(LogLevel.ERROR);
}
代码示例来源:origin: samtools/htsjdk
@BeforeClass
public void initClass() {
Log.setGlobalLogLevel(Log.LogLevel.ERROR);
}
代码示例来源:origin: enasequence/cramtools
public static void main(String[] args) throws Exception {
Params params = new Params();
JCommander jc = new JCommander(params);
try {
jc.parse(args);
} catch (Exception e) {
System.out.println("Failed to parse parameteres, detailed message below: ");
System.out.println(e.getMessage());
System.out.println();
System.out.println("See usage: -h");
System.exit(1);
}
if (args.length == 0 || params.help) {
printUsage(jc);
System.exit(1);
}
Log.setGlobalLogLevel(params.logLevel);
dist(params.inputFile, (byte) (0xFF & params.defaultQualityScore));
}
代码示例来源:origin: broadgsa/gatk
Log.setGlobalLogLevel(htsjdkLevel);
代码示例来源:origin: enasequence/cramtools
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) {
if (slice.sequenceId == Slice.MULTI_REFERENCE) {
System.out.println("Read feature B detected.");
System.exit(1);
}
}
}
}
}
代码示例来源:origin: samtools/htsjdk
@BeforeTest
public void beforeTest() {
Log.setGlobalLogLevel(Log.LogLevel.ERROR);
}
代码示例来源:origin: samtools/htsjdk
@BeforeTest
public void beforeTest() {
Log.setGlobalLogLevel(Log.LogLevel.ERROR);
}
代码示例来源:origin: enasequence/cramtools
Log.setGlobalLogLevel(params.logLevel);
代码示例来源:origin: enasequence/cramtools
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));
代码示例来源:origin: enasequence/cramtools
public static void main(String[] args) throws IOException {
Log.setGlobalLogLevel(LogLevel.INFO);
File bamFile = new File(args[0]);
File outCramFile = new File(args[1]);
ReferenceSource source = new ReferenceSource(new File(args[2]));
int maxThreads = Integer.valueOf(args[3]);
BAMFileReader reader = new BAMFileReader(bamFile, null, false, false, ValidationStringency.SILENT,
new DefaultSAMRecordFactory());
OutputStream os = new FileOutputStream(outCramFile);
CRAMFileWriter writer = new CRAMFileWriter(os, source, reader.getFileHeader(), outCramFile.getName(),
maxThreads);
CloseableIterator<SAMRecord> iterator = reader.getIterator();
while (iterator.hasNext()) {
SAMRecord record = iterator.next();
writer.addAlignment(record);
}
writer.close();
reader.close();
}
代码示例来源:origin: samtools/htsjdk
@Test
public void testLogToFile() throws IOException {
final File logFile = File.createTempFile(getClass().getSimpleName(), ".tmp");
logFile.deleteOnExit();
final Log.LogLevel originalLogLevel = Log.getGlobalLogLevel();
final PrintStream originalStream = Log.getGlobalPrintStream();
try (final PrintStream stream = new PrintStream(new FileOutputStream(logFile.getPath(), true))) {
Log.setGlobalPrintStream(stream);
Log.setGlobalLogLevel(Log.LogLevel.DEBUG);
final String words = "Hello World";
log.info(words);
final List<String> list = Files.readAllLines(logFile.toPath());
Assert.assertEquals(Log.getGlobalLogLevel(), Log.LogLevel.DEBUG);
Assert.assertEquals(list.size(), 1);
Assert.assertTrue(list.get(0).contains(words));
} finally {
Log.setGlobalLogLevel(originalLogLevel);
Log.setGlobalPrintStream(originalStream);
}
}
}
代码示例来源:origin: enasequence/cramtools
Log.setGlobalLogLevel(Log.LogLevel.INFO);
代码示例来源:origin: enasequence/cramtools
System.setProperty("reference", params.referenceFasta.getAbsolutePath());
Log.setGlobalLogLevel(params.logLevel);
代码示例来源:origin: enasequence/cramtools
jc.parse(args);
Log.setGlobalLogLevel(params.logLevel);
代码示例来源:origin: enasequence/cramtools
Log.setGlobalLogLevel(params.logLevel);
代码示例来源:origin: samtools/htsjdk
@BeforeTest
public void prepare() throws IOException {
Log.setGlobalLogLevel(Log.LogLevel.ERROR);
source = new ReferenceSource(new FakeReferenceSequenceFile(SamReaderFactory.makeDefault().getFileHeader(BAM_FILE).getSequenceDictionary().getSequences()));
cramBytes = cramFromBAM(BAM_FILE, source);
cramFile = File.createTempFile(BAM_FILE.getName(), ".cram") ;
cramFile.deleteOnExit();
indexFile = new File (cramFile.getAbsolutePath() + ".bai");
indexFile.deleteOnExit();
FileOutputStream fos = new FileOutputStream(cramFile);
fos.write(cramBytes);
fos.close();
CRAMBAIIndexer.createIndex(new SeekableFileStream(cramFile), indexFile, null, ValidationStringency.STRICT);
baiBytes = readFile(indexFile);
}
代码示例来源:origin: enasequence/cramtools
Log.setGlobalLogLevel(params.logLevel);
代码示例来源:origin: samtools/htsjdk
@BeforeTest
public void prepare() throws IOException {
Log.setGlobalLogLevel(Log.LogLevel.ERROR);
source = new ReferenceSource(new FakeReferenceSequenceFile(
SamReaderFactory.makeDefault().getFileHeader(BAM_FILE).getSequenceDictionary().getSequences()));
tmpCramFile = File.createTempFile(BAM_FILE.getName(), ".cram") ;
tmpCramFile.deleteOnExit();
tmpCraiFile = new File (tmpCramFile.getAbsolutePath() + ".crai");
tmpCraiFile.deleteOnExit();
cramBytes = cramFromBAM(BAM_FILE, source);
FileOutputStream fos = new FileOutputStream(tmpCramFile);
fos.write(cramBytes);
fos.close();
FileOutputStream fios = new FileOutputStream(tmpCraiFile);
CRAMCRAIIndexer.writeIndex(new SeekableFileStream(tmpCramFile), fios);
craiBytes = readFile(tmpCraiFile);
}
代码示例来源:origin: samtools/htsjdk
@BeforeTest
public void beforeTest() throws Exception {
Log.setGlobalLogLevel(Log.LogLevel.ERROR);
内容来源于网络,如有侵权,请联系作者删除!