Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FastqToSam now breaks with gzipped FASTQ input #1810

Closed
2 of 3 tasks
mjhipp opened this issue May 25, 2022 · 1 comment · Fixed by #1811
Closed
2 of 3 tasks

FastqToSam now breaks with gzipped FASTQ input #1810

mjhipp opened this issue May 25, 2022 · 1 comment · Fixed by #1811

Comments

@mjhipp
Copy link
Contributor

mjhipp commented May 25, 2022

Bug Report

After #1794, FastqToSam no longer works with gzipped input.

Affected tool(s)

  • FastqToSam

Affected version(s)

  • Latest public release version
  • Latest development/master branch as of 5/25/2022
  • d784ca3 and after

Not affected: 9eafe4e and before

Description

Steps to reproduce

Run FastqToSam with gzipped input.

❯ java -jar picard.jar FastqToSam \
   FASTQ= sample.R1.fastq.gz \
   FASTQ2= sample.R2.fastq.gz \
   SO=queryname \
   O= out.bam \
   SAMPLE_NAME=sample

If you unzip and run again with unzipped fastqs, it works as expected.

Expected behavior

Gzipped FASTQs should be converted to SAM/BAM as in previous versions.

Even after updates, the help string says that gzipped input is supported:

FASTQ=PicardHtsPath
F1=PicardHtsPath              Input fastq file (optionally gzipped) for single end data, or first read in paired end
                              data.  Required.

FASTQ2=PicardHtsPath
F2=PicardHtsPath              Input fastq file (optionally gzipped) for the second read of paired end data.  Default
                              value: null.

Actual behavior

Failure when creating/referencing the FastqReader.

[Wed May 25 13:32:52 PDT 2022] FastqToSam FASTQ=sample.R1.fastq.gz FASTQ2=sample.R2.fastq.gz OUTPUT=out.bam SAMPLE_NAME=sample SORT_ORDER=queryname    USE_SEQUENTIAL_FASTQS=false READ_GROUP_NAME=A MIN_Q=0 MAX_Q=93 STRIP_UNPAIRED_MATE_NUMBER=false ALLOW_AND_IGNORE_EMPTY_LINES=false VERBOSITY=INFO QUIET=false VALIDATION_STRINGENCY=STRICT COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=false CREATE_MD5_FILE=false GA4GH_CLIENT_SECRETS=client_secrets.json USE_JDK_DEFLATER=false USE_JDK_INFLATER=false
[Wed May 25 13:32:52 PDT 2022] Executing as *** on Mac OS X 10.16 x86_64; OpenJDK 64-Bit Server VM 1.8.0_292-b10; Deflater: Intel; Inflater: Intel; Provider GCS is not available; Picard version: 2.27.1-1-gd784ca3-SNAPSHOT
[Wed May 25 13:32:52 PDT 2022] picard.sam.FastqToSam done. Elapsed time: 0.00 minutes.
Runtime.totalMemory()=257425408
To get help, see http://broadinstitute.github.io/picard/index.html#GettingHelp
Exception in thread "main" htsjdk.samtools.SAMException: Input length = 1 at line 1 in fastq
	at htsjdk.samtools.fastq.FastqReader.readNextRecord(FastqReader.java:139)
	at htsjdk.samtools.fastq.FastqReader.<init>(FastqReader.java:94)
	at picard.sam.FastqToSam.fileToFastqReader(FastqToSam.java:439)
	at picard.sam.FastqToSam.doWork(FastqToSam.java:328)
	at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:306)
	at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:103)
	at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:113)
Caused by: java.nio.charset.MalformedInputException: Input length = 1
	at java.nio.charset.CoderResult.throwException(CoderResult.java:281)
	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:339)
	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
	at java.io.InputStreamReader.read(InputStreamReader.java:184)
	at java.io.BufferedReader.fill(BufferedReader.java:161)
	at java.io.BufferedReader.readLine(BufferedReader.java:324)
	at java.io.BufferedReader.readLine(BufferedReader.java:389)
	at htsjdk.samtools.fastq.FastqReader.readLineConditionallySkippingBlanks(FastqReader.java:207)
	at htsjdk.samtools.fastq.FastqReader.readNextRecord(FastqReader.java:104)
	... 6 more
@mjhipp mjhipp changed the title FastqToSam no longer accepts gzipped input FastqToSam now breaks with gzipped FASTQ input May 26, 2022
@cmnbroad
Copy link
Contributor

Oh yeah, I see how this happened in #1794. I'll make a PR - it's an easy fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants