/** * Create a CRAMFileReader from an input stream and optional index stream using the supplied reference * source and validation stringency. * * @param inputStream CRAM stream to read. May not be null. * @param indexInputStream index stream to be used for random access. May be null. * @param referenceSource a {@link htsjdk.samtools.cram.ref.CRAMReferenceSource source} of * reference sequences. May not be null. * @param validationStringency Validation stringency to be used when reading * * @throws IllegalArgumentException if the {@code inputStream} or the {@code CRAMReferenceSource} is null */ public CRAMFileReader(final InputStream inputStream, final SeekableStream indexInputStream, final CRAMReferenceSource referenceSource, final ValidationStringency validationStringency) throws IOException { if (inputStream == null) { throw new IllegalArgumentException("Input stream can not be null for CRAM reader"); } if (referenceSource == null) { throw new IllegalArgumentException("A reference is required for CRAM readers"); } this.referenceSource = referenceSource; initWithStreams(inputStream, indexInputStream, validationStringency); }
/** * Create a CRAMFileReader from an input stream and optional index stream using the supplied reference * source and validation stringency. * * @param inputStream CRAM stream to read. May not be null. * @param indexInputStream index stream to be used for random access. May be null. * @param referenceSource a {@link htsjdk.samtools.cram.ref.CRAMReferenceSource source} of * reference sequences. May not be null. * @param validationStringency Validation stringency to be used when reading * * @throws IllegalArgumentException if the {@code inputStream} or the {@code CRAMReferenceSource} is null */ public CRAMFileReader(final InputStream inputStream, final SeekableStream indexInputStream, final CRAMReferenceSource referenceSource, final ValidationStringency validationStringency) throws IOException { if (inputStream == null) { throw new IllegalArgumentException("Input stream can not be null for CRAM reader"); } if (referenceSource == null) { throw new IllegalArgumentException("A reference is required for CRAM readers"); } this.referenceSource = referenceSource; initWithStreams(inputStream, indexInputStream, validationStringency); }
/** * Create a CRAMFileReader from a CRAM file and optional index file using the supplied reference * source and validation stringency. * * @param cramFile CRAM stream to read. May not be null. * @param indexFile index file to be used for random access. May be null. * @param referenceSource a {@link htsjdk.samtools.cram.ref.CRAMReferenceSource source} of * reference sequences. May not be null. * @param validationStringency Validation stringency to be used when reading * * @throws IllegalArgumentException if the {@code cramFile} or the {@code CRAMReferenceSource} is null */ public CRAMFileReader(final File cramFile, final File indexFile, final CRAMReferenceSource referenceSource, final ValidationStringency validationStringency) throws IOException { if (cramFile == null) { throw new IllegalArgumentException("Input file can not be null for CRAM reader"); } if (referenceSource == null) { throw new IllegalArgumentException("A reference is required for CRAM readers"); } this.cramFile = cramFile; this.referenceSource = referenceSource; this.mIndexFile = findIndexForFile(indexFile, cramFile); final SeekableFileStream indexStream = this.mIndexFile == null ? null : new SeekableFileStream(this.mIndexFile); initWithStreams(new FileInputStream(cramFile), indexStream, validationStringency); }
/** * Create a CRAMFileReader from a CRAM file and optional index file using the supplied reference * source and validation stringency. * * @param cramFile CRAM stream to read. May not be null. * @param indexFile index file to be used for random access. May be null. * @param referenceSource a {@link htsjdk.samtools.cram.ref.CRAMReferenceSource source} of * reference sequences. May not be null. * @param validationStringency Validation stringency to be used when reading * * @throws IllegalArgumentException if the {@code cramFile} or the {@code CRAMReferenceSource} is null */ public CRAMFileReader(final File cramFile, final File indexFile, final CRAMReferenceSource referenceSource, final ValidationStringency validationStringency) throws IOException { if (cramFile == null) { throw new IllegalArgumentException("Input file can not be null for CRAM reader"); } if (referenceSource == null) { throw new IllegalArgumentException("A reference is required for CRAM readers"); } this.cramFile = cramFile; this.referenceSource = referenceSource; this.mIndexFile = findIndexForFile(indexFile, cramFile); final SeekableFileStream indexStream = this.mIndexFile == null ? null : new SeekableFileStream(this.mIndexFile); initWithStreams(new FileInputStream(cramFile), indexStream, validationStringency); }