Question: using SAMTOOLs API i am trying to get BAM ...follwing Excption occur..How to Handle it Any suggestion...
gravatar for mnmujawar007
4.7 years ago by
mnmujawar0070 wrote:

i am Writing Following Method to get Seq..but it throws Exception....need help .

private static List<SAMRecord> scan(String chromosome, int start, int end) throws IOException {
    List<SAMRecord> records = new ArrayList<SAMRecord>();
    CloseableIterator<SAMRecord> iter = null;
    try {
      iter = inputSam.query(chromosome, start, (start+70), containsbamRecord);
System.out.println("herer : Floe");
      System.out.println("Value Of Start : "+start+"\t"+"VAlue of End : "+(start+70)+"Value Of iter : "+s.getSAMString());

      while (iter.hasNext()) {
        SAMRecord rec =;
           //System.out.println("Value Of Start : "+start+"\t"+"VAlue of End : "+end+"Value Of iter : "+rec.get);

      return records;
    } catch (Exception e) {
      throw new IOException(e);
    } finally {
      if (iter != null)


    at java.nio.Buffer.nextGetIndex(
    at java.nio.DirectByteBuffer.getInt(
    at net.sf.samtools.AbstractBAMFileIndex$MemoryMappedFileBuffer.readInteger(
    at net.sf.samtools.AbstractBAMFileIndex.readInteger(
    at net.sf.samtools.AbstractBAMFileIndex.query(
    at net.sf.samtools.DiskBasedBAMFileIndex.getSpanOverlapping(
    at net.sf.samtools.BAMFileReader.createIndexIterator(
    at net.sf.samtools.BAMFileReader.query(
    at net.sf.samtools.SAMFileReader.query(
    at WrapperMain.scan(
    at WrapperMain.getDataforPosition(


ADD COMMENTlink modified 4.6 years ago by Istvan Albert ♦♦ 84k • written 4.7 years ago by mnmujawar0070

give us the full strack trace and the line numbers.

ADD REPLYlink written 4.7 years ago by Pierre Lindenbaum128k

i already provide stacktrace

ADD REPLYlink written 4.6 years ago by mnmujawar0070
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1101 users visited in the last hour