Package org.broad.igv.util.index

Examples of org.broad.igv.util.index.Interval


        IntervalTree iv = intervalTrees.get(lastChr);
        if (iv == null) {
            iv = new IntervalTree();
            intervalTrees.put(lastChr, iv);
        }
        iv.insert(new Interval(intervalStart, intervalEnd, value));
    }
View Full Code Here


                    } else if (iv != null) {
                        String[] info = Globals.tabPattern.split(line);
                        int start = Integer.parseInt(info[0]);
                        int end = Integer.parseInt(info[1]) + start;
                        long offset = Long.parseLong(info[2]);
                        iv.insert(new Interval(start, end, offset));
                    } else {
                        // log.info("Skipping line " + line);
                    }
                }

            } else {
                // A "legacy" index, created for Broad hosted files that are separated by chromosome.
                // Every alignment is indexed, which is overkill.  Below we lump them into blocks of 50.
                IntervalTree iv = new IntervalTree();
                int l = 0;
                int intervalStart = 0;
                int intervalEnd = 0;
                long lastOffset = 0;
                while ((line = br.readLine()) != null) {
                    String[] info = Globals.tabPattern.split(line);
                    int start = Integer.parseInt(info[0]);
                    intervalEnd = Integer.parseInt(info[1]) + start;
                    if (l % 50 == 0) {
                        iv.insert(new Interval(intervalStart, intervalEnd, lastOffset));
                        intervalStart = intervalEnd;
                        lastOffset = Long.parseLong(info[2]);
                    }
                    l++;
                }

                if(intervalEnd > intervalStart) {
                    iv.insert(new Interval(intervalStart, intervalEnd, lastOffset));
                }

                index.putIntervalTree("*", iv);
            }
        } finally {
View Full Code Here

TOP

Related Classes of org.broad.igv.util.index.Interval

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.