@@ -0,0 +1,2318 @@
+// Copyright (c) 2010 Aalto University%0A//%0A// Permission is hereby granted, free of charge, to any person obtaining a copy%0A// of this software and associated documentation files (the %22Software%22), to%0A// deal in the Software without restriction, including without limitation the%0A// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or%0A// sell copies of the Software, and to permit persons to whom the Software is%0A// furnished to do so, subject to the following conditions:%0A//%0A// The above copyright notice and this permission notice shall be included in%0A// all copies or substantial portions of the Software.%0A//%0A// THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR%0A// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,%0A// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE%0A// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER%0A// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING%0A// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS%0A// IN THE SOFTWARE.%0A%0A// File created: 2012-02-23 12:53:50%0A%0Apackage fi.tkk.ics.hadoop.bam;%0A%0Aimport java.io.IOException;%0Aimport java.io.OutputStream;%0A%0Aimport org.apache.hadoop.fs.Path;%0Aimport org.apache.hadoop.mapreduce.TaskAttemptContext;%0A%0Aimport fi.tkk.ics.hadoop.bam.custom.samtools.SAMFileHeader;%0Aimport fi.tkk.ics.hadoop.bam.custom.samtools.SAMRecord;%0A%0A/** A convenience class that you can use as a RecordWriter for SAM files.%0A *%0A * %3Cp%3EThe write function ignores the key, just outputting the SAMRecord.%3C/p%3E%0A */%0Apublic class KeyIgnoringSAMRecordWriter%3CK%3E extends SAMRecordWriter%3CK%3E %7B%0A%09public KeyIgnoringSAMRecordWriter(%0A%09%09%09Path output, Path input, boolean writeHeader, TaskAttemptContext ctx)%0A%09%09throws IOException%0A%09%7B%0A%09%09super(output, input, writeHeader, ctx);%0A%09%7D%0A%09public KeyIgnoringSAMRecordWriter(%0A%09%09%09Path output, SAMFileHeader header, boolean writeHeader,%0A%09%09%09TaskAttemptContext ctx)%0A%09%09throws IOException%0A%09%7B%0A%09%09super(output, header, writeHeader, ctx);%0A%09%7D%0A%09public KeyIgnoringSAMRecordWriter(%0A%09%09%09OutputStream output, SAMFileHeader header, boolean writeHeader)%0A%09%09throws IOException%0A%09%7B%0A%09%09super(output, header, writeHeader);%0A%09%7D%0A%0A%09@Override public void write(K ignored, SAMRecordWritable rec) %7B%0A%09%09writeAlignment(rec.get());%0A%09%7D%0A%7D%0A

Add KeyIgnoringSAMRecordWriter