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 13:45:40 -04:00
parent 9ddbfdcb9f
commit 9f3328db53
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);
}