public static String getTypeID( SAMReadGroupRecord r, DoCOutputType.Partition type ) { if ( type == DoCOutputType.Partition.sample ) { return r.getSample(); } else if ( type == DoCOutputType.Partition.readgroup ) { return String.format("%s_rg_%s",r.getSample(),r.getReadGroupId()); } else if ( type == DoCOutputType.Partition.library ) { return r.getLibrary(); } else if ( type == DoCOutputType.Partition.center ) { return r.getSequencingCenter(); } else if ( type == DoCOutputType.Partition.platform ) { return r.getPlatform(); } else if ( type == DoCOutputType.Partition.sample_by_center ) { return String.format("%s_cn_%s",r.getSample(),r.getSequencingCenter()); } else if ( type == DoCOutputType.Partition.sample_by_platform) { return String.format("%s_pl_%s",r.getSample(),r.getPlatform()); } else if ( type == DoCOutputType.Partition.sample_by_platform_by_center ) { return String.format("%s_pl_%s_cn_%s",r.getSample(),r.getPlatform(),r.getSequencingCenter()); } else { throw new ReviewedGATKException("Invalid type ID sent to getTypeID. This is a BUG!"); } }
partition.add(rg.getSequencingCenter()); partition.add(String.format("%s_cn_%s",rg.getSample(),rg.getSequencingCenter())); partition.add(String.format("%s_pl_%s_cn_%s",rg.getSample(),rg.getPlatform(),rg.getSequencingCenter()));
setTableValue(table, rgID, "library", rg.getLibrary()); setTableValue(table, rgID, "platform", rg.getPlatform()); setTableValue(table, rgID, "center", rg.getSequencingCenter()); try { setTableValue(table, rgID, "date", rg.getRunDate() != null ? dateFormatter.format(rg.getRunDate()) : "NA");