def indexVariants(variants): '''build index of variants for ranged retrieval.''' index = ncl.NCL() for start, end, reference, action, has_wildtype, variantseqs in variants: index.add(start, end, (reference, action, has_wildtype, variantseqs)) return index
def buildIndex(self, filename): """read and index.""" idx = {} infile = IOTools.openFile(filename, "r") for e in GTF.readFromFile(infile): if e.contig not in idx: idx[e.contig] = NCL.NCLSimple() idx[e.contig].add(e.start, e.end) infile.close() return idx
def nclpy_create_on_disk_and_flush(segmenter): index = ncl.NCL(filestem="tmp", force=True) for id, coords in enumerate(segmenter): index.add(coords[0], coords[1], id) del index return ncl.NCL(filestem="tmp")
def nclpy_create(segmenter): index = ncl.NCL() for id, coords in enumerate(segmenter): index.add(coords[0], coords[1], id) return index
def ncl_create(segmenter): index = ncl.IntervalDB() index.fromlist([(coords[0], coords[1], id) for id, coords in enumerate(segmenter)]) return index