Examples of SAMReadGroupRecord


Examples of htsjdk.samtools.SAMReadGroupRecord

        SAMFileHeader header = record.getHeader();
        String flowOrder = null;
        if (header != null) {
            readGroup = (String) record.getAttribute("RG");
            if (readGroup != null) {
                SAMReadGroupRecord rgRec = header.getReadGroup(readGroup);
                if (rgRec != null) {
                    this.sample = rgRec.getSample();
                    this.library = rgRec.getLibrary();
                    flowOrder = rgRec.getFlowOrder();
                    keySequence = rgRec.getKeySequence();
                }
            }
        }

        Object colorTag = record.getAttribute("YC");
View Full Code Here

Examples of htsjdk.samtools.SAMReadGroupRecord

    private final Map<String, SAMReadGroupRecord> sample2RG = new HashMap<String, SAMReadGroupRecord>();

    private SAMReadGroupRecord sampleRG(String name) { return sample2RG.get(name); }

    private SAMReadGroupRecord createRG(String name) {
        SAMReadGroupRecord rg = new SAMReadGroupRecord(name);
        rg.setPlatform(rgPlatform.getDefaultPlatform());
        rg.setSample(name);
        return rg;
    }
View Full Code Here

Examples of htsjdk.samtools.SAMReadGroupRecord

    public void initialize() {

        // initialize sample -> read group map
        final List<SAMReadGroupRecord> sampleRGs = new ArrayList<SAMReadGroupRecord>();
        for ( final String sample : SampleUtils.getUniqueSamplesFromRods(getToolkit(), Arrays.asList(variantCollection.variants.getName())) ) {
            final SAMReadGroupRecord rg = createRG(sample);
            sampleRGs.add(rg);
            sample2RG.put(sample, rg);
        }

        // initialize BAM headers
View Full Code Here

Examples of htsjdk.samtools.SAMReadGroupRecord

        bamHeader.setSequenceDictionary(header.getSequenceDictionary());
        bamHeader.setSortOrder(SAMFileHeader.SortOrder.coordinate);

        // include the original read groups plus a new artificial one for the haplotypes
        final List<SAMReadGroupRecord> readGroups = new ArrayList<SAMReadGroupRecord>(header.getReadGroups());
        final SAMReadGroupRecord rg = new SAMReadGroupRecord(readGroupID);
        rg.setSample("HC");
        rg.setSequencingCenter("BI");
        readGroups.add(rg);
        bamHeader.setReadGroups(readGroups);
    }
View Full Code Here

Examples of htsjdk.samtools.SAMReadGroupRecord

    @DataProvider(name = "DownsamplingReadsIteratorTestDataProvider")
    public Object[][] createDownsamplingReadsIteratorTests() {
        SAMFileHeader header = ArtificialSAMUtils.createArtificialSamHeader(5, 1, 10000);
        String readGroupID = "testReadGroup";
        SAMReadGroupRecord readGroup = new SAMReadGroupRecord(readGroupID);
        readGroup.setSample("testSample");
        header.addReadGroup(readGroup);

        // Values that don't vary across tests
        int targetCoverage = 10;
        int minReadLength = 50;
View Full Code Here

Examples of htsjdk.samtools.SAMReadGroupRecord

    public void testFilterOutByReadGroup() {
        int recordsPerGroup = 3;
        List<SAMRecord> records = new ArrayList<SAMRecord>();
        int alignmentStart = 0;
        for (int x = 1; x <= getReadGroupCount(); x++) {
            SAMReadGroupRecord groupRecord = getHeader().getReadGroup(getReadGroupId(x));
            for (int y = 1; y <= recordsPerGroup; y++) {
                SAMRecord record = ArtificialSAMUtils.createArtificialRead(getHeader(), "readUno", 0, ++alignmentStart, 20);
                record.setAttribute("RG", groupRecord.getReadGroupId());
                records.add(record);
            }
        }

        List<String> filterList = new ArrayList<String>();
View Full Code Here

Examples of htsjdk.samtools.SAMReadGroupRecord

    public void testFilterOutByAttribute() {
        int recordsPerGroup = 3;
        List<SAMRecord> records = new ArrayList<SAMRecord>();
        int alignmentStart = 0;
        for (int x = 1; x <= getReadGroupCount(); x++) {
            SAMReadGroupRecord groupRecord = getHeader().getReadGroup(getReadGroupId(x));
            for (int y = 1; y <= recordsPerGroup; y++) {
                SAMRecord record = ArtificialSAMUtils.createArtificialRead(getHeader(), "readUno", 0, ++alignmentStart, 20);
                record.setAttribute("RG", groupRecord.getReadGroupId());
                records.add(record);
            }
        }

        List<String> filterList = new ArrayList<String>();
View Full Code Here

Examples of htsjdk.samtools.SAMReadGroupRecord

    public void testFilterOutByFile() {
        int recordsPerGroup = 3;
        List<SAMRecord> records = new ArrayList<SAMRecord>();
        int alignmentStart = 0;
        for (int x = 1; x <= getReadGroupCount(); x++) {
            SAMReadGroupRecord groupRecord = getHeader().getReadGroup(getReadGroupId(x));
            for (int y = 1; y <= recordsPerGroup; y++) {
                SAMRecord record = ArtificialSAMUtils.createArtificialRead(getHeader(), "readUno", 0, ++alignmentStart, 20);
                record.setAttribute("RG", groupRecord.getReadGroupId());
                records.add(record);
            }
        }

        List<String> filterList = new ArrayList<String>();
View Full Code Here

Examples of htsjdk.samtools.SAMReadGroupRecord

    public void testFilterOutByListFile() {
        int recordsPerGroup = 3;
        List<SAMRecord> records = new ArrayList<SAMRecord>();
        int alignmentStart = 0;
        for (int x = 1; x <= getReadGroupCount(); x++) {
            SAMReadGroupRecord groupRecord = getHeader().getReadGroup(getReadGroupId(x));
            for (int y = 1; y <= recordsPerGroup; y++) {
                SAMRecord record = ArtificialSAMUtils.createArtificialRead(getHeader(), "readUno", 0, ++alignmentStart, 20);
                record.setAttribute("RG", groupRecord.getReadGroupId());
                records.add(record);
            }
        }

        List<String> filterList = new ArrayList<String>();
View Full Code Here

Examples of htsjdk.samtools.SAMReadGroupRecord

public class SingleReadGroupFilter extends ReadFilter {
    @Argument(fullName = "read_group_to_keep", shortName = "goodRG", doc="The name of the read group to keep, filtering out all others", required=true)
    private String READ_GROUP_TO_KEEP = null;

    public boolean filterOut( final SAMRecord read ) {
        final SAMReadGroupRecord readGroup = read.getReadGroup();
        return !( readGroup != null && readGroup.getReadGroupId().equals( READ_GROUP_TO_KEEP ) );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.