Merged bug fix from Stable into Unstable

This commit is contained in:
Ryan Poplin 2011-08-16 14:19:04 -04:00
commit 2d5bbecd9e
2 changed files with 9 additions and 3 deletions

View File

@ -484,6 +484,9 @@ public class UnifiedGenotyperEngine {
Map<String, AlignmentContext> stratifiedContexts = null;
if ( !BaseUtils.isRegularBase( refContext.getBase() ) )
return null;
if ( model == GenotypeLikelihoodsCalculationModel.Model.INDEL ) {
if (UAC.GenotypingMode == GenotypeLikelihoodsCalculationModel.GENOTYPING_MODE.GENOTYPE_GIVEN_ALLELES) {
@ -498,6 +501,7 @@ public class UnifiedGenotyperEngine {
stratifiedContexts = AlignmentContextUtils.splitContextBySampleName(pileup, UAC.ASSUME_SINGLE_SAMPLE);
} else {
// todo - tmp will get rid of extended events so this wont be needed
if (!rawContext.hasExtendedEventPileup())
return null;
@ -515,9 +519,6 @@ public class UnifiedGenotyperEngine {
}
} else if ( model == GenotypeLikelihoodsCalculationModel.Model.SNP ) {
if ( !BaseUtils.isRegularBase( refContext.getBase() ) )
return null;
// stratify the AlignmentContext and cut by sample
stratifiedContexts = AlignmentContextUtils.splitContextBySampleName(rawContext.getBasePileup(), UAC.ASSUME_SINGLE_SAMPLE);

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);
}