Package htsjdk.samtools

Examples of htsjdk.samtools.SAMFileHeader


            args[index++] = "ATTRIBUTE_TO_CLEAR=" + attr;
        }
        runPicardCommandLine(args);

        final SAMFileReader reader = new SAMFileReader(output);
        final SAMFileHeader header = reader.getFileHeader();
        Assert.assertEquals(header.getSortOrder(), SAMFileHeader.SortOrder.queryname);
        Assert.assertEquals(header.getProgramRecords().size(), removeAlignmentInfo ? 0 : 1);
        for (final SAMReadGroupRecord rg : header.getReadGroups()) {
            if (sample != null) {
                Assert.assertEquals(rg.getSample(), sample);
            }
            else {
                Assert.assertEquals(rg.getSample(), "Hi,Mom!");
View Full Code Here


    }

    @Test(dataProvider="clipPairedTestData")
    public void testPairedEndClip(final String testName, final String read1, final String read2, final AdapterPair expected) {

        final SAMRecord rec1 = new SAMRecord(new SAMFileHeader());
        rec1.setReadString(read1);
        rec1.setFirstOfPairFlag(true);
        final SAMRecord rec2 = new SAMRecord(new SAMFileHeader());
        rec2.setReadString(read2);
        rec2.setSecondOfPairFlag(true);

        final AdapterPair result = ClippingUtility.adapterTrimIlluminaPairedReads(rec1, rec2,
                IlluminaAdapterPair.INDEXED, IlluminaAdapterPair.PAIRED_END);
View Full Code Here

    @Test
    public void testAddCommentsToBam() throws Exception {
        final File outputFile = File.createTempFile("addCommentsToBamTest.", BamFileIoUtils.BAM_FILE_EXTENSION);
        runIt(INPUT_FILE, outputFile, commentList);

        final SAMFileHeader newHeader = new SAMFileReader(outputFile).getFileHeader();

        // The original comments are massaged when they're added to the header. Perform the same massaging here,
        // and then compare the lists
        final List<String> massagedComments = new LinkedList<String>();
        for (final String comment : commentList) {
            massagedComments.add(SAMTextHeaderCodec.COMMENT_PREFIX + comment);
        }

        Assert.assertEquals(newHeader.getComments(), massagedComments);
    }
View Full Code Here

TOP

Related Classes of htsjdk.samtools.SAMFileHeader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.