Fix getMergedReadGroupsByReaders so that it provides read groups in the same way Picard does so that it works correctly when input read files have no clashes in their read groups and retain their original read group names.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1737 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
andrewk 2009-09-29 06:35:50 +00:00
parent 5662a88ee1
commit 5dab95aa5a
1 changed files with 8 additions and 3 deletions

View File

@ -327,9 +327,14 @@ public class GenomeAnalysisEngine {
rg_sets.add(groups);
for ( SAMReadGroupRecord g : r.getFileHeader().getReadGroups() ) {
// use HeaderMerger to translate original read group id from the reader into the read group id in the
// merged stream, and save that remapped read group id to associate it with specific reader
groups.add( hm.getReadGroupId(r, g.getReadGroupId()) );
if (hm.hasGroupIdDuplicates()) { // Check if there were read group clashes with hasGroupIdDuplicates and if so:
// use HeaderMerger to translate original read group id from the reader into the read group id in the
// merged stream, and save that remapped read group id to associate it with specific reader
groups.add( hm.getReadGroupId(r, g.getReadGroupId()) );
}else{
// otherwise, pass through the unmapped read groups since this is what Picard does as well
groups.add( g.getReadGroupId() );
}
}
}