Example #1
0
  @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);
  }
Example #2
0
 public static GATKSAMRecord createRandomRead(int length, boolean allowNs) {
   byte[] quals = ReadUtils.createRandomReadQuals(length);
   byte[] bbases = ReadUtils.createRandomReadBases(length, allowNs);
   return ArtificialSAMUtils.createArtificialRead(bbases, quals, bbases.length + "M");
 }