@Override public SeekableStream asUnbufferedSeekableStream() { return lazySeekableStream.get(); }
/** * Simple constructor; all writers are pre-initialized.. */ private FastqWriters(final FastqWriter firstOfPair, final FastqWriter secondOfPair, final FastqWriter unpaired) { this(firstOfPair, new Lazy<>(() -> secondOfPair), unpaired); }
private void closeAll() { final Set<FastqWriter> fastqWriters = new HashSet<>(); fastqWriters.add(firstOfPair); fastqWriters.add(unpaired); // Make sure this is a no-op if the second writer was never fetched. if (secondOfPair.isInitialized()) { fastqWriters.add(secondOfPair.get()); } for (final FastqWriter fastqWriter : fastqWriters) { fastqWriter.close(); } } }
@Override public SeekableStream asUnbufferedSeekableStream() { return lazySeekableStream.get(); }
private void closeAll() { final Set<FastqWriter> fastqWriters = new HashSet<>(); fastqWriters.add(firstOfPair); fastqWriters.add(unpaired); // Make sure this is a no-op if the second writer was never fetched. if (secondOfPair.isInitialized()) { fastqWriters.add(secondOfPair.get()); } for (final FastqWriter fastqWriter : fastqWriters) { fastqWriter.close(); } } }
/** * Simple constructor; all writers are pre-initialized.. */ private FastqWriters(final FastqWriter firstOfPair, final FastqWriter secondOfPair, final FastqWriter unpaired) { this(firstOfPair, new Lazy<>(() -> secondOfPair), unpaired); }
@Override public SeekableStream asUnbufferedSeekableStream() { return lazySeekableStream.get(); }
final Lazy<FastqWriter> lazySecondOfPairWriter = new Lazy<>(() -> INTERLEAVE ? firstOfPairWriter : factory.newWriter(makeReadGroupFile(rg, "_2")));
@Override public SeekableStream asUnbufferedSeekableStream() { return lazySeekableStream.get(); }
final Lazy<FastqWriter> lazySecondOfPairWriter = new Lazy<>(() -> INTERLEAVE ? firstOfPairWriter : factory.newWriter(makeReadGroupFile(rg, "_2")));
@Override public SeekableStream asUnbufferedSeekableStream() { return lazySeekableStream.get(); }
@Override public SeekableStream asUnbufferedSeekableStream() { return lazySeekableStream.get(); }
private FastqWriter getSecondOfPair() { return secondOfPair.get(); }
private FastqWriter getSecondOfPair() { return secondOfPair.get(); }
@Override public SeekableStream asUnbufferedSeekableStream() { //if the file doesn't exist, the try to open the stream anyway because users might be expecting the exception //if it not a regular file than we won't be able to seek on it, so return null if (!fileResource.exists() || fileResource.isFile()) { return lazySeekableStream.get(); } else { return null; } }
@Override public SeekableStream asUnbufferedSeekableStream() { //if the file doesn't exist, the try to open the stream anyway because users might be expecting the exception //if it not a regular file than we won't be able to seek on it, so return null if (!fileResource.exists() || fileResource.isFile()) { return lazySeekableStream.get(); } else { return null; } }
private MendelianViolationDetector buildDetector() { return new MendelianViolationDetector( ImmutableSet.copyOf(SKIP_CHROMS), ImmutableSet.copyOf(MALE_CHROMS), ImmutableSet.copyOf(FEMALE_CHROMS), MIN_HET_FRACTION, MIN_GQ, MIN_DP, generateTrioMetricsBase(), ImmutableList.copyOf(parIntervals.get()), progressLogger ); }
private MendelianViolationDetector buildDetector() { return new MendelianViolationDetector( ImmutableSet.copyOf(SKIP_CHROMS), ImmutableSet.copyOf(MALE_CHROMS), ImmutableSet.copyOf(FEMALE_CHROMS), MIN_HET_FRACTION, MIN_GQ, MIN_DP, generateTrioMetricsBase(), ImmutableList.copyOf(parIntervals.get()), progressLogger ); }
/** * Method for creating JexlVCMatchExp from input walker arguments mapping from names to exps. These two arrays contain * the name associated with each JEXL expression. initializeMatchExps will parse each expression and return * a list of JexlVCMatchExp, in order, that correspond to the names and exps. These are suitable input to * match() below. * * @param names_and_exps mapping of names to expressions * @return list of matches */ public static List<JexlVCMatchExp> initializeMatchExps(Map<String, String> names_and_exps) { List<JexlVCMatchExp> exps = new ArrayList<>(); for ( Map.Entry<String, String> elt : names_and_exps.entrySet() ) { String name = elt.getKey(); String expStr = elt.getValue(); if ( name == null || expStr == null ) throw new IllegalArgumentException("Cannot create null expressions : " + name + " " + expStr); try { Expression exp = engine.get().createExpression(expStr); exps.add(new JexlVCMatchExp(name, exp)); } catch (Exception e) { throw new IllegalArgumentException("Argument " + name + "has a bad value. Invalid expression used (" + expStr + "). Please see the JEXL docs for correct syntax.") ; } } return exps; }
/** * Method for creating JexlVCMatchExp from input walker arguments mapping from names to exps. These two arrays contain * the name associated with each JEXL expression. initializeMatchExps will parse each expression and return * a list of JexlVCMatchExp, in order, that correspond to the names and exps. These are suitable input to * match() below. * * @param names_and_exps mapping of names to expressions * @return list of matches */ public static List<JexlVCMatchExp> initializeMatchExps(Map<String, String> names_and_exps) { List<JexlVCMatchExp> exps = new ArrayList<JexlVCMatchExp>(); for ( Map.Entry<String, String> elt : names_and_exps.entrySet() ) { String name = elt.getKey(); String expStr = elt.getValue(); if ( name == null || expStr == null ) throw new IllegalArgumentException("Cannot create null expressions : " + name + " " + expStr); try { Expression exp = engine.get().createExpression(expStr); exps.add(new JexlVCMatchExp(name, exp)); } catch (Exception e) { throw new IllegalArgumentException("Argument " + name + "has a bad value. Invalid expression used (" + expStr + "). Please see the JEXL docs for correct syntax.") ; } } return exps; }