Package net.sf.samtools.util

Examples of net.sf.samtools.util.SeekableFileStream


          SAMFileReader reader = new SAMFileReader(file);
          source.reader = reader;
          if (query == null)
            source.it = reader.iterator();
          else {
            SeekableFileStream is = new SeekableFileStream(file);

            FileInputStream fis = new FileInputStream(index);
            GZIPInputStream gis = new GZIPInputStream(
                new BufferedInputStream(fis));
            BufferedInputStream bis = new BufferedInputStream(gis);
            List<CramIndex.Entry> full = CramIndex.readIndex(gis);

            List<CramIndex.Entry> entries = new LinkedList<CramIndex.Entry>();
            SAMSequenceRecord sequence = reader.getFileHeader()
                .getSequence(query.sequence);
            if (sequence == null)
              throw new RuntimeException("Sequence not found: "
                  + query.sequence);

            entries.addAll(CramIndex.find(full,
                sequence.getSequenceIndex(), query.start,
                query.end - query.start));

            bis.close();

            SAMIterator it = new SAMIterator(is, refFile);
            is.seek(entries.get(0).containerStartOffset);
            BAMQueryFilteringIterator bit = new BAMQueryFilteringIterator(
                it, query.sequence, query.start, query.end,
                BAMQueryFilteringIterator.QueryType.CONTAINED,
                reader.getFileHeader());
            source.it = bit;
View Full Code Here


    if (params.cramFile != null) {
      FileInputStream fis = new FileInputStream(params.cramFile);
      if (params.locations == null || params.locations.isEmpty())
        is = new BufferedInputStream(fis);
      else
        is = new SeekableFileStream(params.cramFile);
    } else
      is = System.in;

    if (params.decrypt) {
      CipherInputStream_256 cipherInputStream_256 = new CipherInputStream_256(
          is, pass, 128);
      is = cipherInputStream_256.getCipherInputStream();
      if (params.locations != null && !params.locations.isEmpty()) {
        is = new SeekableCipherStream_256(new SeekableFileStream(
            params.cramFile), pass, 1, 128);
      }
    }

    long offset = 0;
View Full Code Here

      return emptyIterator;

    SeekableStream s = null;
    if (file != null) {
      try {
        s = new SeekableFileStream(file);
      } catch (FileNotFoundException e) {
        throw new RuntimeException(e);
      }
    } else if (is instanceof SeekableStream)
      s = (SeekableStream) is;
View Full Code Here

    final long startOfLastLinearBin = getIndex().getStartOfLastLinearBin();

    SeekableStream s = null;
    if (file != null) {
      try {
        s = new SeekableFileStream(file);
      } catch (FileNotFoundException e) {
        throw new RuntimeException(e);
      }
    } else if (is instanceof SeekableStream)
      s = (SeekableStream) is;
View Full Code Here

TOP

Related Classes of net.sf.samtools.util.SeekableFileStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.