use of org.broadinstitute.hellbender.utils.fasta.CachingIndexedFastaSequenceFile in project gatk by broadinstitute.
the class ReadUtilsUnitTest method testReadWithNsRefIndexInDeletion.
@Test
public void testReadWithNsRefIndexInDeletion() throws FileNotFoundException {
final IndexedFastaSequenceFile seq = new CachingIndexedFastaSequenceFile(new File(exampleReference));
final SAMFileHeader header = ArtificialReadUtils.createArtificialSamHeader(seq.getSequenceDictionary());
final int readLength = 76;
final GATKRead read = ArtificialReadUtils.createArtificialRead(header, "myRead", 0, 8975, readLength);
read.setBases(Utils.dupBytes((byte) 'A', readLength));
read.setBaseQualities(Utils.dupBytes((byte) 30, readLength));
read.setCigar("3M414N1D73M");
final int result = ReadUtils.getReadCoordinateForReferenceCoordinateUpToEndOfRead(read, 9392, ReadUtils.ClippingTail.LEFT_TAIL);
Assert.assertEquals(result, 2);
}
use of org.broadinstitute.hellbender.utils.fasta.CachingIndexedFastaSequenceFile in project gatk by broadinstitute.
the class ReadUtilsUnitTest method testReadWithNsRefAfterDeletion.
@Test
public void testReadWithNsRefAfterDeletion() throws FileNotFoundException {
final IndexedFastaSequenceFile seq = new CachingIndexedFastaSequenceFile(new File(exampleReference));
final SAMFileHeader header = ArtificialReadUtils.createArtificialSamHeader(seq.getSequenceDictionary());
final int readLength = 76;
final GATKRead read = ArtificialReadUtils.createArtificialRead(header, "myRead", 0, 8975, readLength);
read.setBases(Utils.dupBytes((byte) 'A', readLength));
read.setBaseQualities(Utils.dupBytes((byte) 30, readLength));
read.setCigar("3M414N1D73M");
final int result = ReadUtils.getReadCoordinateForReferenceCoordinateUpToEndOfRead(read, 9393, ReadUtils.ClippingTail.LEFT_TAIL);
Assert.assertEquals(result, 3);
}
use of org.broadinstitute.hellbender.utils.fasta.CachingIndexedFastaSequenceFile in project gatk-protected by broadinstitute.
the class HaplotypeCaller method getReferenceReader.
private static CachingIndexedFastaSequenceFile getReferenceReader(ReferenceInputArgumentCollection referenceArguments) {
final CachingIndexedFastaSequenceFile referenceReader;
final File reference = new File(referenceArguments.getReferenceFileName());
try {
referenceReader = new CachingIndexedFastaSequenceFile(reference);
} catch (FileNotFoundException e) {
throw new UserException.CouldNotReadInputFile(reference, e);
}
return referenceReader;
}
use of org.broadinstitute.hellbender.utils.fasta.CachingIndexedFastaSequenceFile in project gatk by broadinstitute.
the class ActivityProfileUnitTest method init.
@BeforeClass
public void init() throws FileNotFoundException {
// sequence
ReferenceSequenceFile seq = new CachingIndexedFastaSequenceFile(new File(b37_reference_20_21));
genomeLocParser = new GenomeLocParser(seq);
startLoc = genomeLocParser.createGenomeLoc("20", 0, 1, 100);
header = new SAMFileHeader();
seq.getSequenceDictionary().getSequences().forEach(sequence -> header.addSequence(sequence));
}
use of org.broadinstitute.hellbender.utils.fasta.CachingIndexedFastaSequenceFile in project gatk by broadinstitute.
the class BandPassActivityProfileUnitTest method init.
@BeforeClass
public void init() throws FileNotFoundException {
// sequence
ReferenceSequenceFile seq = new CachingIndexedFastaSequenceFile(new File(b37_reference_20_21));
genomeLocParser = new GenomeLocParser(seq);
header = new SAMFileHeader();
seq.getSequenceDictionary().getSequences().forEach(sequence -> header.addSequence(sequence));
}
Aggregations