AdamaJava / adamajava

Other
14 stars 5 forks source link

update SAMFileReaderFacotry #325

Closed ChristinaXu2017 closed 1 year ago

ChristinaXu2017 commented 1 year ago

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:

  1. open SAM files as java.io.InputStream; the input file is in SAM format and can not be empty.
  2. 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".
  3. 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".
  4. 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:

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:

holmeso commented 1 year ago

There seems to be a test.draft package in qpicard.

ChristinaXu2017 commented 1 year ago

sorry, my bad. they are deleted now