Examples of SAMFileReader


Examples of net.sf.samtools.SAMFileReader

//    String in = "/home/lmose/dev/abra/leftalign.sam";
//    String out = "/home/lmose/dev/abra/la.out.sam";
//    String ref = "/home/lmose/reference/chr1/chr1.fa";
   
    SAMFileReader reader = new SAMFileReader(new File(in));
   
    SAMFileWriter writer = new SAMFileWriterFactory().makeSAMOrBAMWriter(
        reader.getFileHeader(), false, new File(out));
   
    CompareToReference2 c2r = new CompareToReference2();
    c2r.init(ref);
   
    IndelShifter indelShifter = new IndelShifter();

    for (SAMRecord read : reader) {
      SAMRecord shiftedRead = indelShifter.shiftIndelsLeft(read, c2r);
      writer.addAlignment(shiftedRead);
    }
   
    writer.close();
    reader.close();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.