Package htsjdk.samtools

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


            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

        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

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.