Index associated with GCS-path bam not working properly #749

Open
kcibul opened this Issue Nov 21, 2016 · 2 comments

Comments

Projects
None yet
3 participants
Contributor

kcibul commented Nov 21, 2016

When attempting to access a BAM in GCS using GATK PrintReads, although the index is found initially it appears to be lost in SamReaderFactory.

Your environment

GATK 4.alpha.2-103-g4d29cf7

Steps to reproduce

./gatk-launch PrintReads --input gs://public-dream-data/synthetic.challenge.set1.normal.v2.bam --output k.bam --intervals 1:1000000-1001000

Expected behaviour

k.bam would contain the reads in the specified interval

Actual behaviour

***********************************************************************
A USER ERROR has occurred: Traversal by intervals was requested but some input files are not indexed.
Please index all input files:
samtools index /synthetic.challenge.set1.normal.v2.bam
***********************************************************************

This area may be part of the problem in SamReaderFactory as it tries to treat the index like a file

                    final File indexFile = indexMaybe == null ? null : indexMaybe.asFile();
                    if (SamStreams.isBAMFile(bufferedStream)) {
                        if (sourceFile == null || !sourceFile.isFile()) {
                            // Handle case in which file is a named pipe, e.g. /dev/stdin or created by mkfifo
                            primitiveSamReader = new BAMFileReader(bufferedStream, indexFile, false, asynchronousIO, validationStringency, this.samRecordFactory);
                        } else {
                            bufferedStream.close();
                            primitiveSamReader = new BAMFileReader(sourceFile, indexFile, false, asynchronousIO, validationStringency, this.samRecordFactory);
                        }
Contributor

droazen commented Nov 21, 2016

@tomwhite Can you have a look? Should be a simple patch.

droazen self-assigned this Nov 21, 2016

jean-philippe-martin referenced this issue Nov 29, 2016

Merged

Path index #762

5 of 5 tasks complete
Contributor

jean-philippe-martin commented Dec 5, 2016

Fixed by #762

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment