use of htsjdk.samtools.SAMSequenceRecord in project gatk by broadinstitute.
the class TandemRepeatUnitTest method testUsingVCNoRepeat.
@Test
public void testUsingVCNoRepeat() {
// - [ref] / ATC from 20-20
final String insLoc = "chr1";
final int insLocStart = 6;
final int insLocStop = 6;
final byte[] refBytes = "GTATCATCATCGGA".getBytes();
final Allele nullR = Allele.create("A", true);
final Allele atc = Allele.create("AATC", false);
// A*,ATC, context = ATC ATC ATC : (ATC)3 -> (ATC)4
final VariantContext vc = new VariantContextBuilder("foo", insLoc, insLocStart, insLocStop, Arrays.asList(nullR, atc)).make();
final SimpleInterval interval = new SimpleInterval(insLoc, insLocStart, insLocStop);
final SimpleInterval interval1 = new SimpleInterval(insLoc, 1, refBytes.length);
final ReferenceBases ref1 = new ReferenceBases(refBytes, interval1);
final SAMSequenceDictionary dict = new SAMSequenceDictionary(Arrays.asList(new SAMSequenceRecord(insLoc, refBytes.length)));
final ReferenceContext ref = new ReferenceContext(ReferenceDataSource.of(ref1, dict), interval, 0, 20);
final InfoFieldAnnotation ann = new TandemRepeat();
final Map<String, Object> a = ann.annotate(ref, vc, null);
Assert.assertTrue(a.isEmpty());
}
use of htsjdk.samtools.SAMSequenceRecord in project gatk by broadinstitute.
the class TandemRepeatUnitTest method testUsingVCNotIndel.
@Test
public void testUsingVCNotIndel() {
// - [ref] / ATC from 20-20
String insLoc = "chr1";
int insLocStart = 2;
int insLocStop = 2;
byte[] refBytes = "GTATCATCATCGGA".getBytes();
Allele nullR = Allele.create("A", true);
Allele atc = Allele.create("C", false);
// A*,ATC, context = ATC ATC ATC : (ATC)3 -> (ATC)4
VariantContext vc = new VariantContextBuilder("foo", insLoc, insLocStart, insLocStop, Arrays.asList(nullR, atc)).make();
final SimpleInterval interval = new SimpleInterval("chr1", insLocStart, insLocStop);
final String contigName = "chr1";
final SimpleInterval interval1 = new SimpleInterval(contigName, 1, refBytes.length);
final ReferenceBases ref1 = new ReferenceBases(refBytes, interval1);
final SAMSequenceDictionary dict = new SAMSequenceDictionary(Arrays.asList(new SAMSequenceRecord(contigName, refBytes.length)));
final ReferenceContext ref = new ReferenceContext(ReferenceDataSource.of(ref1, dict), interval, 0, 20);
final InfoFieldAnnotation ann = new TandemRepeat();
final Map<String, Object> a = ann.annotate(ref, vc, null);
Assert.assertTrue(a.isEmpty());
}
Aggregations