Package org.broad.igv.feature

Examples of org.broad.igv.feature.Strand


            for (AlignmentBlock b : blocks) {
                if (b.getEnd() < start) continue;
                if (b.getStart() > end) break;

                //Strand strand = alignment.getFirstOfPairStrand();
                Strand strand = alignment.getReadStrand();

                // Don't count softclips
                if (!b.isSoftClipped() && strand != Strand.NONE) {
                    final boolean isNegativeStrand = strand == Strand.NEGATIVE;
View Full Code Here


                return al.getReadGroup();
            case TAG:
                Object tagValue = al.getAttribute(tag);
                return tagValue == null ? null : tagValue.toString();
            case FIRST_OF_PAIR_STRAND:
                Strand strand = al.getFirstOfPairStrand();
                String strandString = strand == Strand.NONE ? null : strand.toString();
                System.out.println(strandString);
                return strandString;
            case PAIR_ORIENTATION:
                PEStats peStats = AlignmentRenderer.getPEStats(al, renderOptions);
                AlignmentTrack.OrientationType type = AlignmentRenderer.getOrientationType(al, peStats);
View Full Code Here

    @Test
    public void testBasicSearchNegStrand_end() throws Exception{
        int posStart = 19389;
        //Motif is at the end of this sequence on the negative strand
        String motif = "CTGATC";
        Strand strand = Strand.NEGATIVE;

        Iterator<Feature> matchIter = MotifFinderSource.searchSingleStrand(motif, strand, null, posStart, shortSeq.getBytes());
        assertTrue("No matches found for motif " + motif, matchIter.hasNext());
        Feature feat = matchIter.next();
View Full Code Here

    public void testBasicSearchNegStrand_few() throws Exception{
        int posStart = 19389;
        //Should have several hits
        String motif = "TG";
        String revSeq = "CA";
        Strand strand = Strand.NEGATIVE;

        Iterator<Feature> matchIter = MotifFinderSource.searchSingleStrand(motif, strand, null, posStart, shortSeq.getBytes());
        assertTrue("No matches found for motif " + motif, matchIter.hasNext());

        while(matchIter.hasNext()){
View Full Code Here

    @Test
    public void testSearchSingleStrandPos() throws Exception{
        int posStart = 19389;
        String motif = "TCTG";
        Strand strand = Strand.POSITIVE;

        Iterator<Feature> matchIter = MotifFinderSource.searchSingleStrand(motif, strand, null, posStart, shortSeq.getBytes());
        assertTrue("No matches found for motif " + motif, matchIter.hasNext());
        Feature feat = matchIter.next();
View Full Code Here

                    int index = Integer.parseInt(tokens[numColumn]);

                    String chr1 = genome.getChromosomeAlias(tokens[chr1Column]);
                    int pos1 = Integer.parseInt(tokens[pos1Column]);
                    String str1 = tokens[str1Column];
                    Strand strand1 = (str1.equals("0") || str1.equals("(+)")) ? Strand.POSITIVE : Strand.NEGATIVE;

                    String chr2 = genome.getChromosomeAlias(tokens[chr2Column]);
                    int pos2 = Integer.parseInt(tokens[pos2Column]);
                    String str2 = tokens[str2Column];
                    Strand strand2 = (str2.equals("0") || str2.equals("(+)")) ? Strand.POSITIVE : Strand.NEGATIVE;

                    DRangerFeature feature = new DRangerFeature(chr1, pos1, strand1, chr2, pos2, strand2);
                    feature.setIndex(index);

                    if (tumreadsColumn > 0) {
View Full Code Here

                    int exonEnd = exonStart + 1;
                    if (tmp.length > 1) {
                        exonEnd = Integer.parseInt(tmp[1]);
                    }

                    Strand strand = isNegative ? Strand.NEGATIVE : Strand.POSITIVE;
                    Exon r = new Exon(chromosome, exonStart, exonEnd, strand);
                    start = Math.min(start, exonStart);
                    end = Math.max(end, exonEnd);
                    exons.add(r);
View Full Code Here

        String chr = genome == null ? StringUtils.intern(chrToken) : genome.getChromosomeAlias(chrToken);

        int start = Integer.parseInt(tokens[startColumn]);
        int end = Integer.parseInt(tokens[endColumn]);
        String strandString = tokens[strandColumn];
        Strand strand = Strand.NONE;
        if (strandString != null) {
            if (strandString.trim().equals("+")) {
                strand = Strand.POSITIVE;
            } else if (strandString.trim().equals("-")) {
                strand = Strand.NEGATIVE;
View Full Code Here

                Alignment alignment = iter.next();
                if (passFilter(alignment)) {
                    //Sort into the read strand or first-in-pair strand,
                    //depending on input flag. Note that this can
                    //be very unreliable depending on data
                    Strand strand;
                    if (firstInPair) {
                        strand = alignment.getFirstOfPairStrand();
                    } else if (secondInPair) {
                        strand = alignment.getSecondOfPairStrand();
                    } else {
                        strand = alignment.getReadStrand();
                    }
                    if (strand.equals(Strand.NONE)) {
                        //TODO move this into passFilter, or move passFilter here
                        continue;
                    }
                    boolean readNegStrand = alignment.isNegativeStrand();
View Full Code Here

        private MethylScore createUSCScore(BedFeature feat, String[] restOfFields) {
            //String name = restOfFields[0];
            //int score = Integer.parseInt(restOfFields[1]);
            char strandChar = restOfFields[2].charAt(0);
            Strand strand = strandChar == '+' ? Strand.POSITIVE : (strandChar == '-' ? Strand.NEGATIVE : Strand.NONE);
            float percentMethyl = Float.parseFloat(restOfFields[3]);
            int count = Integer.parseInt(restOfFields[4]);
            return new MethylScore(feat.getChromosome(), feat.getStartBase(), feat.getEndBase(), strand, percentMethyl, count);
        }
View Full Code Here

TOP

Related Classes of org.broad.igv.feature.Strand

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.