Package org.broad.igv.feature

Examples of org.broad.igv.feature.BasicFeature


                    if (feature instanceof IGVFeature) {
                        IGVFeature f = (IGVFeature) feature;
                        int genStart = (int) ((offset + f.getStart()) / 1000);
                        int genEnd = (int) ((offset + f.getEnd()) / 1000);
                        if (genEnd > lastFeaturePosition + sampleLength) {
                            BasicFeature f2 = new BasicFeature(Globals.CHR_ALL, genStart, genEnd);
                            if (f instanceof BasicFeature) {
                                BasicFeature bf = (BasicFeature) f;
                                f2.setThickEnd((int) ((offset + bf.getThickEnd()) / 1000));
                                f2.setThickStart((int) ((offset + bf.getThickStart()) / 1000));
                                f2.setName(f.getName());
                            }
                            chrAllFeatures.add(f2);

                            lastFeaturePosition = genEnd;
View Full Code Here


             * @return
             */
            public boolean hasNext() {
                while (buffer.isEmpty() && origIter.hasNext())
                {
                    BasicFeature feature = (BasicFeature) origIter.next();
                    if (feature.getStrand() == strand)
                        buffer.add(feature);
                    else
                        otherBuffer.add(feature);
                }
                return !buffer.isEmpty();
View Full Code Here

             * @return
             */
            public Feature next() {
                while (buffer.isEmpty() && origIter.hasNext())
                {
                    BasicFeature feature = (BasicFeature) origIter.next();
                    if (feature.getStrand() == strand)
                        buffer.add(feature);
                    else
                        otherBuffer.add(feature);
                }
                if (buffer.isEmpty())
View Full Code Here

    public Object readActualHeader(LineIterator reader) throws IOException {
        return null;
    }

    public BasicFeature decode(String[] tokens) {
        BasicFeature feat;

        if (hasSplit) {
            //When we split, the returned feature still has the exons
            //We don't want to plot them all a zillion times
            tokens = Arrays.copyOfRange(tokens, 0, Math.min(6, tokens.length));
View Full Code Here

            pw = new PrintWriter(new BufferedWriter(new FileWriter(outputFile)));
            pw.println("#gffTags");
            for(Feature feature : features) {

                BasicFeature bf = (BasicFeature) feature;
                String line = codec.encode(bf);
                pw.println(line);
            }

View Full Code Here

                        if (feature instanceof IGVFeature) {
                            IGVFeature f = (IGVFeature) feature;
                            int genStart = (int) ((offset + f.getStart()) / 1000);
                            int genEnd = (int) ((offset + f.getEnd()) / 1000);
                            if (genEnd > lastFeaturePosition + sampleLength) {
                                BasicFeature f2 = new BasicFeature(Globals.CHR_ALL, genStart, genEnd);
                                if (f instanceof BasicFeature) {
                                    BasicFeature bf = (BasicFeature) f;
                                    f2.setThickEnd((int) ((offset + bf.getThickEnd()) / 1000));
                                    f2.setThickStart((int) ((offset + bf.getThickStart()) / 1000));
                                    f2.setName(f.getName());
                                }
                                chrAllFeatures.add(f2);

                                lastFeaturePosition = genEnd;
View Full Code Here

        double score = -1;
        if (features == null) return score;

        FeatureIterator iter = getFeatureIterator(features, longest, frameBPWidth);
        while (iter.hasNext()) {
            BasicFeature f = iter.next();
            score = Math.max(t.getSignal(f), score);
        }
        return score;
    }
View Full Code Here

        private void advance() {
            // We have to look back at least as far as the longest feature for overlap.
            nextFeature = null;
            while (features.hasNext()) {
                BasicFeature f = features.next();
                if (f.getStart() >= bpEnd) {
                    break;
                }

                if (f.getEnd() >= bpStart && f.getStart() < bpEnd) {
                    nextFeature = f;
                    break;
                }
            }
        }
View Full Code Here

            return nextFeature != null;
        }

        @Override
        public BasicFeature next() {
            BasicFeature retValue = nextFeature;
            advance();
            return retValue;
        }
View Full Code Here

            while ((nextLine = br.readLine()) != null) {
                if (nextLine.startsWith("track")) {
                    props = new TrackProperties();
                    ParsingUtils.parseTrackLine(nextLine, props);
                } else {
                    BasicFeature f = (BasicFeature) codec.decode(nextLine);
                    if (f != null) {
                        String chr = f.getChr();
                        List<BasicFeature> featureList = featureMap.get(chr);
                        if (featureList == null) {
                            featureList = new ArrayList<BasicFeature>();
                            featureMap.put(chr, featureList);
                        }
View Full Code Here

TOP

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

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.