Search in sources :

Example 6 with Position

use of com.google.api.services.genomics.model.Position in project gatk by broadinstitute.

the class GATKReadAdaptersUnitTest method mateIsUnmappedData.

@DataProvider(name = "MateIsUnmappedData")
public Object[][] mateIsUnmappedData() {
    SAMRecord samWithUnmappedMate = basicSAMRecord();
    samWithUnmappedMate.setMateUnmappedFlag(true);
    SAMRecord samWithUnmappedMate2 = basicSAMRecord();
    samWithUnmappedMate2.setMateReferenceName(SAMRecord.NO_ALIGNMENT_REFERENCE_NAME);
    SAMRecord samWithUnmappedMate3 = basicSAMRecord();
    samWithUnmappedMate3.setMateAlignmentStart(SAMRecord.NO_ALIGNMENT_START);
    Read googleReadWithUnmappedMate = basicGoogleGenomicsRead();
    // We have to explicitly set the mate reverse strand flag in order to ensure that we can call getSAMString
    // on the read once its been wrapped by the adapter; if it hasn't been explicitly set the adapter will
    // throw when we query for the flags.
    Position newPosition = new Position();
    newPosition.setReverseStrand(false);
    googleReadWithUnmappedMate.setNextMatePosition(newPosition);
    Read googleReadWithUnmappedMate2 = basicGoogleGenomicsRead();
    googleReadWithUnmappedMate2.getNextMatePosition().setReferenceName(SAMRecord.NO_ALIGNMENT_REFERENCE_NAME);
    Read googleReadWithUnmappedMate3 = basicGoogleGenomicsRead();
    googleReadWithUnmappedMate3.getNextMatePosition().setPosition(-1l);
    Read googleReadWithUnmappedMate4 = basicGoogleGenomicsRead();
    googleReadWithUnmappedMate4.getNextMatePosition().setReferenceName(null);
    Read googleReadWithUnmappedMate5 = basicGoogleGenomicsRead();
    googleReadWithUnmappedMate5.getNextMatePosition().setPosition(null);
    return new Object[][] { { basicReadBackedBySam(), false }, { basicReadBackedByGoogle(), false }, { new SAMRecordToGATKReadAdapter(samWithUnmappedMate), true }, { new SAMRecordToGATKReadAdapter(samWithUnmappedMate2), true }, { new SAMRecordToGATKReadAdapter(samWithUnmappedMate3), true }, { new GoogleGenomicsReadToGATKReadAdapter(googleReadWithUnmappedMate), true }, { new GoogleGenomicsReadToGATKReadAdapter(googleReadWithUnmappedMate2), true }, { new GoogleGenomicsReadToGATKReadAdapter(googleReadWithUnmappedMate3), true }, { new GoogleGenomicsReadToGATKReadAdapter(googleReadWithUnmappedMate4), true }, { new GoogleGenomicsReadToGATKReadAdapter(googleReadWithUnmappedMate5), true } };
}
Also used : Read(com.google.api.services.genomics.model.Read) Position(com.google.api.services.genomics.model.Position) DataProvider(org.testng.annotations.DataProvider)

Aggregations

Position (com.google.api.services.genomics.model.Position)6 Read (com.google.api.services.genomics.model.Read)5 DataProvider (org.testng.annotations.DataProvider)3 LinearAlignment (com.google.api.services.genomics.model.LinearAlignment)2 SAMFileHeader (htsjdk.samtools.SAMFileHeader)1 SAMRecord (htsjdk.samtools.SAMRecord)1