Package net.sf.samtools

Examples of net.sf.samtools.SAMFileWriterFactory


    SamMultiMappingReader reader = new SamMultiMappingReader(input);
   
    SAMFileHeader header = reader.getFileHeader();
    header.setSortOrder(SortOrder.unsorted);
   
    SAMFileWriter outputReadsBam = new SAMFileWriterFactory().makeSAMOrBAMWriter(
        header, true, new File(output));

    for (List<SAMRecord> readList : reader) {
      List<SAMRecord> processedReads = processRead(readList);
     
View Full Code Here


    SAMFileReader reader = new SAMFileReader(new File(input));
   
    SAMFileHeader header = reader.getFileHeader();
    header.setSortOrder(SortOrder.unsorted);
   
    SAMFileWriter out = new SAMFileWriterFactory().makeSAMOrBAMWriter(
        header, true, new File(output));
   
    for (Feature region : regions) {
      Map<String, SAMRecord> chunks = chop(reader, region);
      chunks = clop(chunks);
View Full Code Here

//    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);
   
View Full Code Here

      SAMFileWriterFactory factoryOrNull, OutputStream os,
      SAMFileHeader header, boolean printHeader) throws IOException {
    SAMFileWriter writer = null;
    if (printHeader) {
      if (factoryOrNull == null)
        factoryOrNull = new SAMFileWriterFactory();
      writer = factoryOrNull.makeSAMWriter(header, true, os);
    } else {
      SwapOutputStream sos = new SwapOutputStream();

      final SAMTextWriter ret = new SAMTextWriter(sos);
View Full Code Here

    long offset = 0;
    CountingInputStream cis = new CountingInputStream(is);
    CramHeader cramHeader = ReadWrite.readCramHeader(cis);
    offset = cis.getCount();

    SAMFileWriterFactory samFileWriterFactory = new SAMFileWriterFactory();
    samFileWriterFactory.setAsyncOutputBufferSize(10000);
    samFileWriterFactory.setCreateIndex(false);
    samFileWriterFactory.setCreateMd5File(false);
    samFileWriterFactory.setUseAsyncIo(true);

    SAMFileWriter writer = createSAMFileWriter(params, cramHeader,
        samFileWriterFactory);

    Container c = null;
View Full Code Here

    header.addComment(mergeComment.toString());

    SAMFileWriter writer = null;
    if (params.outFile != null)
      if (!params.samFormat)
        writer = new SAMFileWriterFactory().makeBAMWriter(header, true,
            params.outFile);
      else
        writer = new SAMFileWriterFactory().makeSAMWriter(header, true,
            params.outFile);
    else if (!params.samFormat) {
      // hack to write BAM format to stdout:
      File file = File.createTempFile("bam", null);
      file.deleteOnExit();
View Full Code Here

TOP

Related Classes of net.sf.samtools.SAMFileWriterFactory

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.