Examples of makeSAMOrBAMWriter()


Examples of htsjdk.samtools.SAMFileWriterFactory.makeSAMOrBAMWriter()

        for (Map.Entry<String, List<SAMReadGroupRecord>> entry : libraryToRg.entrySet()) {
            String lib = entry.getKey();
            SAMFileHeader header = reader.getFileHeader().clone();
            header.setReadGroups(entry.getValue());
            libraryToWriter.put(lib, factory.makeSAMOrBAMWriter(header, true,
                    new File(OUTPUT, IOUtil.makeFileNameSafe(lib) + extension)));
        }

        for (Iterator<SAMRecord> it = reader.iterator(); it.hasNext(); ) {
            SAMRecord sam = it.next();
View Full Code Here

Examples of htsjdk.samtools.SAMFileWriterFactory.makeSAMOrBAMWriter()

            if (rg != null && rg.getLibrary() != null) {
                libraryToWriter.get(rg.getLibrary()).addAlignment(sam);
            }
            else {
                if (unknown == null) {
                    unknown = factory.makeSAMOrBAMWriter(unknownHeader, true,
                            new File(OUTPUT, "unknown" + extension));
                }
                unknown.addAlignment(sam);
            }
        }
View Full Code Here

Examples of htsjdk.samtools.SAMFileWriterFactory.makeSAMOrBAMWriter()

        header.setSortOrder(SORT_ORDER);
        final SAMFileWriterFactory samFileWriterFactory = new SAMFileWriterFactory();
        if (USE_THREADING) {
            samFileWriterFactory.setUseAsyncIo(true);
        }
        final SAMFileWriter out = samFileWriterFactory.makeSAMOrBAMWriter(header, presorted, OUTPUT);

        // Lastly loop through and write out the records
        final ProgressLogger progress = new ProgressLogger(log, PROGRESS_INTERVAL);
        while (iterator.hasNext()) {
            final SAMRecord record = iterator.next();
View Full Code Here

Examples of net.sf.samtools.SAMFileWriterFactory.makeSAMOrBAMWriter()

      String temp = tempDir + "/temp" + (i+1);
      mkdir(temp);
      tempDirs[i] = temp;

      // init BAM writer
      writers[i] = writerFactory.makeSAMOrBAMWriter(
          samHeaders[i], false, new File(outputFiles[i]));
    }
   
    // Start pre-processing reads on separate thread for each input file.
    // This happens in parallel with assembly, provided there are enough threads.
View Full Code Here

Examples of net.sf.samtools.SAMFileWriterFactory.makeSAMOrBAMWriter()

    SAMFileWriterFactory writerFactory = new SAMFileWriterFactory();
   
    SAMFileReader reader = new SAMFileReader(new File(input));
    reader.setValidationStringency(ValidationStringency.SILENT);
   
    SAMFileWriter writer = writerFactory.makeSAMOrBAMWriter(
        reader.getFileHeader(), false, new File(output));
   
    for (SAMRecord read : reader) {
      writer.addAlignment(read);
    }
View Full Code Here

Examples of net.sf.samtools.SAMFileWriterFactory.makeSAMOrBAMWriter()

    reader.close();
    header.setSortOrder(SortOrder.unsorted);
   
    SAMFileWriterFactory writerFactory = new SAMFileWriterFactory();
    writerFactory.setUseAsyncIo(false);
    SAMFileWriter writer = writerFactory.makeSAMOrBAMWriter(
        header, false, new File("/home/lmose/dev/abra/1076/test.bam"));

   
    BetaPairValidatingRealignmentWriter w = new BetaPairValidatingRealignmentWriter(null,
        writer, "foofi", 0, 200000);
View Full Code Here

Examples of net.sf.samtools.SAMFileWriterFactory.makeSAMOrBAMWriter()

    SAMFileWriterFactory writerFactory = new SAMFileWriterFactory();
//    writerFactory.setUseAsyncIo(true);
   
    header.setSortOrder(SortOrder.unsorted);
   
    SAMFileWriter writer = writerFactory.makeSAMOrBAMWriter(
        header, false, new File("/home/lmose/dev/abra/region_tracker/out.bam"));
   
    Sam2Fastq s2f = new Sam2Fastq();
   
   
View Full Code Here

Examples of net.sf.samtools.SAMFileWriterFactory.makeSAMOrBAMWriter()

    SAMFileWriterFactory writerFactory = new SAMFileWriterFactory();
    writerFactory.setUseAsyncIo(false);
   
    // Farm each chromosome out to its own thread.
    for (SAMSequenceRecord chr : rdr.getFileHeader().getSequenceDictionary().getSequences()) {   
      SAMFileWriter writer = writerFactory.makeSAMOrBAMWriter(
          rdr.getFileHeader(), false, new File(outputDirectory + "/" + chr.getSequenceName() + ".bam"));
     
      outputWriterMap.put(chr.getSequenceName(), writer);
     
      BamSplitterThread thread = new BamSplitterThread(threads, filename, chr.getSequenceName(), writer);
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.