/** Create a ReadDestination that writes to a BAM file */
    public ToBAM(
        final StingSAMFileWriter stingSAMWriter,
        final SAMFileHeader header,
        final String readGroupID) {
      super(header, readGroupID);
      if (stingSAMWriter == null) throw new IllegalArgumentException("writer cannot be null");

      bamWriter = stingSAMWriter;
      stingSAMWriter.setPresorted(false);
      stingSAMWriter.writeHeader(getHeader());
    }
예제 #2
0
파일: Utils.java 프로젝트: GinYan/gatk
 /**
  * Creates a program record for the program, adds it to the list of program records (@PG tags) in
  * the bam file and sets up the writer with the header and presorted status.
  *
  * @param writer BAM file writer
  * @param toolkit the engine
  * @param preSorted whether or not the writer can assume reads are going to be added are already
  *     sorted
  * @param KEEP_ALL_PG_RECORDS whether or not to keep all the other program records already
  *     existing in this BAM file
  * @param walker the walker object (so we can extract the command line)
  * @param PROGRAM_RECORD_NAME the name for the PG tag
  */
 public static void setupWriter(
     StingSAMFileWriter writer,
     GenomeAnalysisEngine toolkit,
     SAMFileHeader originalHeader,
     boolean preSorted,
     boolean KEEP_ALL_PG_RECORDS,
     Object walker,
     String PROGRAM_RECORD_NAME) {
   SAMFileHeader header =
       setupWriter(toolkit, originalHeader, KEEP_ALL_PG_RECORDS, walker, PROGRAM_RECORD_NAME);
   writer.writeHeader(header);
   writer.setPresorted(preSorted);
 }