Skip to content

Commit

Permalink
Fix FastqToSam regression. (#1811)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmnbroad authored Jun 1, 2022
1 parent 923403d commit fc91208
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 20,008 deletions.
6 changes: 1 addition & 5 deletions src/main/java/picard/sam/FastqToSam.java
Original file line number Diff line number Diff line change
Expand Up @@ -435,11 +435,7 @@ protected int doPaired(final FastqReader freader1, final FastqReader freader2, f
}

private FastqReader fileToFastqReader(final Path path) throws PicardException {
try {
return new FastqReader(null, Files.newBufferedReader(path), ALLOW_AND_IGNORE_EMPTY_LINES);
} catch (IOException e){
throw new PicardException("cannot create a reader for " + path, e);
}
return new FastqReader(null, IOUtil.openFileForBufferedReading(path), ALLOW_AND_IGNORE_EMPTY_LINES);
}

private SAMRecord createSamRecord(final SAMFileHeader header, final String baseName, final FastqRecord frec, final boolean paired) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/picard/sam/CramCompatibilityTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class CramCompatibilityTest {
public static final String CRAM_FILE_QUERY_SORTED = "testdata/picard/sam/test_cram_file_query_sorted.cram";

public static final String REFERENCE_FILE = "testdata/picard/sam/test_cram_file.ref.fa";
public static final String FASTQ_FILE = "testdata/picard/sam/fastq2bam/fastq-sanger/5k-v1-Rhodobacter_LW1.sam.fastq";
public static final String FASTQ_FILE = "testdata/picard/sam/fastq2bam/fastq-sanger/5k-v1-Rhodobacter_LW1.sam.fastq.gz";

public static final String CRAM_UNMAPPED = "testdata/picard/sam/SamFormatConverterTest/unmapped.cram";
public static final String CRAM_UNMAPPED_WITH_OQ_TAG = "testdata/picard/sam/unmapped_with_oq_tag.cram";
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/picard/sam/FastqToSamTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public String getCommandLineProgramName() {
@DataProvider(name = "okVersionFiles")
public Object[][] okVersionFiles() {
return new Object[][] {
{"fastq-sanger/5k-v1-Rhodobacter_LW1.sam.fastq", FastqQualityFormat.Standard },
{"fastq-sanger/5k-v1-Rhodobacter_LW1.sam.fastq.gz", FastqQualityFormat.Standard },
{"fastq-sanger/5k-30BB2AAXX.3.aligned.sam.fastq", FastqQualityFormat.Standard },
{"fastq-sanger/sanger_full_range_as_sanger-63.fastq", FastqQualityFormat.Standard }, // all sanger chars

Expand Down
Loading

0 comments on commit fc91208

Please sign in to comment.