org.bdgenomics.adam.io

## Class InterleavedFastqInputFormat

- java.lang.Object
- - org.apache.hadoop.mapreduce.InputFormat<K,V>
  - - org.apache.hadoop.mapreduce.lib.input.FileInputFormat<Void,org.apache.hadoop.io.Text>
    - - org.bdgenomics.adam.io.InterleavedFastqInputFormat

    public final class InterleavedFastqInputFormat
    extends org.apache.hadoop.mapreduce.lib.input.FileInputFormat<Void,org.apache.hadoop.io.Text>

This class is a Hadoop reader for "interleaved fastq" -- that is, fastq with paired reads in the same file, interleaved, rather than in two separate files. This makes it much easier to Hadoopily slice up a single file and feed the slices into an aligner. The format is the same as fastq, but records are expected to alternate between /1 and /2. As a precondition, we assume that the interleaved FASTQ files are always uncompressed; if the files are compressed, they cannot be split, and thus there is no reason to use the interleaved format. This reader is based on the FastqInputFormat that's part of Hadoop-BAM, found at https://github.com/HadoopGenomics/Hadoop-BAM/blob/master/src/main/java/org/seqdoop/hadoop_bam/FastqInputFormat.java

### Nested Class Summary

### Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.lib.input.FileInputFormat

`org.apache.hadoop.mapreduce.lib.input.FileInputFormat.Counter`

### Field Summary

### Fields inherited from class org.apache.hadoop.mapreduce.lib.input.FileInputFormat

`DEFAULT_LIST_STATUS_NUM_THREADS, INPUT_DIR, INPUT_DIR_RECURSIVE, LIST_STATUS_NUM_THREADS, NUM_INPUT_FILES, PATHFILTER_CLASS, SPLIT_MAXSIZE, SPLIT_MINSIZE`

### Constructor Summary

Constructors
Constructor and Description
`InterleavedFastqInputFormat()`

### Method Summary

All Methods Instance Methods Concrete Methods
`org.apache.hadoop.mapreduce.RecordReader<Void,org.apache.hadoop.io.Text>` `createRecordReader(org.apache.hadoop.mapreduce.InputSplit genericSplit, org.apache.hadoop.mapreduce.TaskAttemptContext context)` Creates the new record reader that underlies this input format.
`protected boolean` `isSplitable(org.apache.hadoop.mapreduce.JobContext context, org.apache.hadoop.fs.Path filename)` For now, we do not support splittable compression codecs.

### Methods inherited from class org.apache.hadoop.mapreduce.lib.input.FileInputFormat

`addInputPath, addInputPathRecursively, addInputPaths, computeSplitSize, getBlockIndex, getFormatMinSplitSize, getInputDirRecursive, getInputPathFilter, getInputPaths, getMaxSplitSize, getMinSplitSize, getSplits, listStatus, makeSplit, makeSplit, setInputDirRecursive, setInputPathFilter, setInputPaths, setInputPaths, setMaxInputSplitSize, setMinInputSplitSize`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### InterleavedFastqInputFormat

    public InterleavedFastqInputFormat()

### Method Detail

#### isSplitable

    protected boolean isSplitable(org.apache.hadoop.mapreduce.JobContext context,
                                  org.apache.hadoop.fs.Path filename)

For now, we do not support splittable compression codecs. As in, we will read the compressed data, but we will not allow it to be splittable. We will fix this in #1457.

Overrides:
  `isSplitable` in class `org.apache.hadoop.mapreduce.lib.input.FileInputFormat<Void,org.apache.hadoop.io.Text>`
Parameters:
  `context` - The job context to get the configuration from.
  `filename` - The path the input file is saved at.
Returns:
  Returns false if this file is compressed.

#### createRecordReader

    public org.apache.hadoop.mapreduce.RecordReader<Void,org.apache.hadoop.io.Text> createRecordReader(org.apache.hadoop.mapreduce.InputSplit genericSplit,
                                                                                                       org.apache.hadoop.mapreduce.TaskAttemptContext context)
                                                                                                throws IOException,
                                                                                                       InterruptedException

Creates the new record reader that underlies this input format.

Specified by:
  `createRecordReader` in class `org.apache.hadoop.mapreduce.InputFormat<Void,org.apache.hadoop.io.Text>`
Parameters:
  `genericSplit` - The split that the record reader should read.
  `context` - The Hadoop task context.
Returns:
  Returns the interleaved FASTQ record reader.
Throws:
  `IOException`
  `InterruptedException`