Our org.qcmg.picard.SAMFileReaderFactory can open SAM/BAM/CRAM files. There are several ways to open these files, here we make it consistent:
open SAM files as java.io.InputStream; the input file is in SAM format and can not be empty.
open BAM files as htsjdk.samtools.seekablestream.SeekableStream; The input file must be in the binary version of a SAM file and with a valid file extension name ".bam".
open CRAM file as htsjdk.samtools.seekablestream.SeekableStream and require an optional reference file or the default one by "-Dsamjdk.reference_fasta"; the input must be a compressed Reference-oriented Alignment Map file with extension name ".cram".
open SAM/BAM/CRAM as java.io.File. This way is not strict, it can open empty files as well. At moment only qsignature use this method because the unit tests require empty input.
Here are 53 Files changed, but Only the "SAMFileReaderFacotry.java " has big changes, the other changes are similar:
use "try(...){}" to open files.
change the file extension to ".sam" in unit tests, if the test data is a text SAM file
open SAM/BAM/CRAM files by calling the updated method and adding "throws IOException"
delete some debug code or unused imports
Type of change
[X] New feature (non-breaking change which adds functionality)
How Has This Been Tested?
all existing unit test has been updated and the new feature is working as expected.
Existing unit tests pass
Are WDL Updates Required?
No
Checklist:
[X] My code follows the style guidelines of this project
[X] I have performed a self-review of my own code
[X] I have commented my code, particularly in hard-to-understand areas
[X] My changes generate no new warnings
[X] I have added tests that prove my fix is effective or that my feature works
[X] New and existing unit tests pass locally with my changes
Description
Our org.qcmg.picard.SAMFileReaderFactory can open SAM/BAM/CRAM files. There are several ways to open these files, here we make it consistent:
Type of change
How Has This Been Tested?
all existing unit test has been updated and the new feature is working as expected. Existing unit tests pass
Are WDL Updates Required?
No
Checklist: