protected ReadDestination(final SAMFileHeader header, final String readGroupID) { // prepare the bam header if (header == null) throw new IllegalArgumentException("header cannot be null"); bamHeader = new SAMFileHeader(); bamHeader.setSequenceDictionary(header.getSequenceDictionary()); bamHeader.setSortOrder(SAMFileHeader.SortOrder.coordinate); // include the original read groups plus a new artificial one for the haplotypes final List<SAMReadGroupRecord> readGroups = new ArrayList<SAMReadGroupRecord>(header.getReadGroups()); final SAMReadGroupRecord rg = new SAMReadGroupRecord(readGroupID); rg.setSample("HC"); rg.setSequencingCenter("BI"); readGroups.add(rg); bamHeader.setReadGroups(readGroups); }
@BeforeClass private void init() throws IOException { reference = new CachingIndexedFastaSequenceFile(new File(b37KGReference)); dictionary = reference.getSequenceDictionary(); genomeLocParser = new GenomeLocParser(dictionary); header = ArtificialSAMUtils.createDefaultReadGroup(new SAMFileHeader(), "test", "test"); header.setSequenceDictionary(dictionary); header.setSortOrder(SAMFileHeader.SortOrder.coordinate); readGroup = new GATKSAMReadGroupRecord(header.getReadGroup("test")); final List<GATKSAMRecord> reads = new ArrayList<>(); for (final String contig : contigs) { for (int i = 1; i <= numReadsPerContig; i++) { reads.add(buildSAMRecord("read" + contig + "_" + i, contig, i)); } } createBAM(reads); }