Skip to content

Commit

Permalink
Fixup whitespace missed or caused by formatter.
Browse files Browse the repository at this point in the history
  • Loading branch information
heuermh committed Sep 12, 2017
1 parent 4cc7b01 commit 3deb8e1
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 25 deletions.
7 changes: 5 additions & 2 deletions src/main/java/org/seqdoop/hadoop_bam/BAMInputFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,9 @@ private int addBAISplits(final List<InputSplit> splits,
if (fSplit.getStart() == 0) {
final SeekableStream inFile =
WrapSeekable.openPath(path.getFileSystem(conf), path);
SamReader open = SamReaderFactory.makeDefault().setUseAsyncIo(false)
SamReader open = SamReaderFactory
.makeDefault()
.setUseAsyncIo(false)
.open(SamInputResource.of(inFile));
SAMFileSpan span = open.indexing().getFilePointerSpanningReads();
long bamStart = ((BAMFileSpan) span).getFirstOffset();
Expand Down Expand Up @@ -576,7 +578,8 @@ private List<InputSplit> filterByInterval(final List<InputSplit> splits,
bamFiles.add(((FileVirtualSplit) split).getPath());
}
Map<Path, BAMFileSpan> fileToSpan = new LinkedHashMap<>();
SamReaderFactory readerFactory = SamReaderFactory.makeDefault()
SamReaderFactory readerFactory = SamReaderFactory
.makeDefault()
.setOption(SamReaderFactory.Option.CACHE_FILE_BASED_INDEXES, true)
.setOption(SamReaderFactory.Option.EAGERLY_DECODE, false)
.setUseAsyncIo(false);
Expand Down
10 changes: 6 additions & 4 deletions src/main/java/org/seqdoop/hadoop_bam/BAMSplitGuesser.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ public BAMSplitGuesser(final SeekableStream ss,
throws IOException {
inFile = ss;

referenceSequenceCount =
SAMHeaderReader.readSAMHeaderFrom(headerStream, conf)
.getSequenceDictionary().size();
referenceSequenceCount = SAMHeaderReader
.readSAMHeaderFrom(headerStream, conf)
.getSequenceDictionary().size();

bamCodec = new BAMRecordCodec(null, new LazyBAMRecordFactory());
}
Expand All @@ -110,7 +110,9 @@ public long guessNextBAMRecordStart(final long beg, final long end)
// on subsequent calls to this method.
if (beg == 0) {
this.inFile.seek(beg);
SamReader open = SamReaderFactory.makeDefault().setUseAsyncIo(false)
SamReader open = SamReaderFactory
.makeDefault()
.setUseAsyncIo(false)
.open(SamInputResource.of(inFile));
SAMFileSpan span = open.indexing().getFilePointerSpanningReads();
if (span instanceof BAMFileSpan) {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/seqdoop/hadoop_bam/BCFRecordWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ private void init(final OutputStream output,
final BCFStoppableOutputStream stopOut =
new BCFStoppableOutputStream(!writeHeader, output);

writer = new VariantContextWriterBuilder().clearOptions()
writer = new VariantContextWriterBuilder()
.clearOptions()
.setOption(Options.FORCE_BCF)
.setOutputBCFStream(stopOut).build();

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/seqdoop/hadoop_bam/BaseSplitGuesser.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public PosSize(final int p, final int s) {
// anything.
protected PosSize guessNextBGZFPos(int p, final int end) {
try {
for (; ; ) {
for (; ; ) {
for (;;) {
for (;;) {
in.seek(p);
IOUtils.readFully(in, buf.array(), 0, 4);
int n = buf.getInt(0);
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/seqdoop/hadoop_bam/FastaInputFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,7 @@ public FastaRecordReader(final Configuration conf, final FileSplit split) throws
CompressionCodecFactory codecFactory = new CompressionCodecFactory(conf);
CompressionCodec codec = codecFactory.getCodec(file);

if (codec == null) // no codec. Uncompressed file.
{
if (codec == null) { // no codec. Uncompressed file.
positionAtFirstRecord(fileIn);
inputStream = fileIn;
}
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/seqdoop/hadoop_bam/FastqInputFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ public FastqRecordReader(final Configuration conf, final FileSplit split) throws
CompressionCodecFactory codecFactory = new CompressionCodecFactory(conf);
CompressionCodec codec = codecFactory.getCodec(file);

if (codec == null) // no codec. Uncompressed file.
{
if (codec == null) { // no codec. Uncompressed file.
positionAtFirstRecord(fileIn);
inputStream = fileIn;
}
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/seqdoop/hadoop_bam/FormatConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ public enum BaseQualityEncoding {
Illumina, Sanger
}

;

private FormatConstants() {
} // no instantiation

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/seqdoop/hadoop_bam/QseqInputFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ public QseqRecordReader(final Configuration conf, final FileSplit split) throws
CompressionCodecFactory codecFactory = new CompressionCodecFactory(conf);
CompressionCodec codec = codecFactory.getCodec(file);

if (codec == null) // no codec. Uncompressed file.
{
if (codec == null) { // no codec. Uncompressed file.
positionAtFirstRecord(fileIn);
inputStream = fileIn;
}
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/seqdoop/hadoop_bam/QseqOutputFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ else if (baseQualityFormat == BaseQualityEncoding.Illumina) {
}
}
sBuilder.append(delim);
/////////
sBuilder.append((seq.getFilterPassed() == null || seq.getFilterPassed()) ? 1 : 0);

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ public long guessNextBGZFBlockStart(final long beg, final long end)
// Returns a negative number if it doesn't find anything.
private int guessNextBGZFPos(int p, final int end)
throws IOException {
for (; ; ) {
for (; ; ) {
for (;;) {
for (;;) {
in.seek(p);
in.read(buf.array(), 0, 4);
int n = buf.getInt(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ public static void main(final String[] args) throws IOException {
System.exit(1);
}

final SAMFileHeader h =
SamReaderFactory.makeDefault().validationStringency(ValidationStringency.SILENT)
.setUseAsyncIo(false)
.open(new File(args[0])).getFileHeader();
final SAMFileHeader h = SamReaderFactory
.makeDefault()
.validationStringency(ValidationStringency.SILENT)
.setUseAsyncIo(false)
.open(new File(args[0]))
.getFileHeader();
h.setSortOrder(SAMFileHeader.SortOrder.coordinate);

new SAMOutputPreparer().prepareForRecords(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ public static SAMFileHeader readSAMHeaderFrom(
final InputStream in, final Configuration conf) {
final ValidationStringency
stringency = getValidationStringency(conf);
SamReaderFactory readerFactory = SamReaderFactory.makeDefault()
SamReaderFactory readerFactory = SamReaderFactory
.makeDefault()
.setOption(SamReaderFactory.Option.EAGERLY_DECODE, false)
.setUseAsyncIo(false);
if (stringency != null) {
Expand Down

0 comments on commit 3deb8e1

Please sign in to comment.