fixing read group name collision: before writing the read into respective stream in nway-out mode we now retrieve the original rg, not the merged/modified one

This commit is contained in:
Andrey Sivachenko 2011-08-16 10:55:51 -04:00
parent d0d2e9eb2a
commit 9e1d443c47
1 changed files with 5 additions and 0 deletions

View File

@ -135,6 +135,11 @@ public class NWaySAMFileWriter implements SAMFileWriter {
public void addAlignment(SAMRecord samRecord) {
final SAMReaderID id = toolkit.getReaderIDForRead(samRecord);
String rg = samRecord.getStringAttribute("RG");
if ( rg != null ) {
String rg_orig = toolkit.getReadsDataSource().getOriginalReadGroupId(rg);
samRecord.setAttribute("RG",rg_orig);
}
writerMap.get(id).addAlignment(samRecord);
}