Skip to content

Commit

Permalink
[ADAM-1992] Make maximum FASTQ read length configurable.
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Austin Nothaft committed Jul 6, 2018
1 parent e85ec15 commit cf1204d
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 2 deletions.
Expand Up @@ -42,7 +42,7 @@
* a single Text output. This is then fed into the FastqConverter, which
* converts the single Text instance into two AlignmentRecords.
*/
abstract class FastqRecordReader extends RecordReader<Void, Text> {
public abstract class FastqRecordReader extends RecordReader<Void, Text> {
/*
* fastq format:
* <fastq> := <block>+
Expand All @@ -60,6 +60,13 @@ abstract class FastqRecordReader extends RecordReader<Void, Text> {
* application. We'll see if someone complains in other applications.
*/

public static final String MAX_READ_LENGTH_PROPERTY = "org.bdgenomics.adam.io.FastqRecordReader.MAX_READ_LENGTH";

public static void setMaxReadLength(Configuration conf,
int maxReadLength) {
conf.setInt(MAX_READ_LENGTH_PROPERTY, maxReadLength);
}

/**
* First valid data index in the stream.
*/
Expand Down Expand Up @@ -104,7 +111,7 @@ abstract class FastqRecordReader extends RecordReader<Void, Text> {
/**
* Maximum length for a read string.
*/
private static final int MAX_LINE_LENGTH = 10000;
private int MAX_LINE_LENGTH;

/**
* True if the underlying data is splittable.
Expand Down Expand Up @@ -135,6 +142,8 @@ abstract class FastqRecordReader extends RecordReader<Void, Text> {
*/
protected FastqRecordReader(final Configuration conf,
final FileSplit split) throws IOException {
MAX_LINE_LENGTH = conf.getInt(MAX_READ_LENGTH_PROPERTY, 10000);

file = split.getPath();
start = split.getStart();
end = start + split.getLength();
Expand Down

0 comments on commit cf1204d

Please sign in to comment.