Exemple #1
0
    def __call__(self, track, slice):
        fold_matrix, rownames, colnames = IOTools.readMatrix(
            IOTools.openFile("hypergeometric.dir/%s.dir/alldesc.%s.fold" %
                             (track, slice)))

        return odict((('matrix', fold_matrix), ('rows', rownames), ('columns',
                                                                    colnames)))
    def __call__(self, track, slice):
        fold_matrix, rownames, colnames = IOTools.readMatrix(
            IOTools.openFile(
                "hypergeometric.dir/%s.dir/alldesc.%s.fold" %
                (track, slice)))

        return odict((('matrix', fold_matrix),
                      ('rows', rownames),
                      ('columns', colnames)))
    def __call__(self, track, slice = None):

        fn = os.path.join( DATADIR, "peakshapes.dir", "%(track)s.peakshape.tsv.gz.matrix_%(slice)s.gz" % locals() )
        if not os.path.exists( fn ): return

        matrix, rownames, colnames = IOTools.readMatrix( IOTools.openFile( fn ))

        nrows = len(rownames)
        if nrows < 2: return

        if nrows > 1000:
            take = numpy.array( numpy.floor( numpy.arange( 0, nrows, nrows / 1000 ) ), dtype = int )
            rownames = [ rownames[x] for x in take ]
            matrix = matrix[ take ]
            
        

        return odict( (('matrix', matrix),
                       ('rows', rownames),
                       ('columns', colnames)) )
Exemple #4
0
    def __call__(self, track, slice=None):

        fn = os.path.join(
            DATADIR, "peakshapes.dir",
            "%(track)s.peakshape.tsv.gz.matrix_%(slice)s.gz" % locals())
        if not os.path.exists(fn): return

        matrix, rownames, colnames = IOTools.readMatrix(IOTools.openFile(fn))

        nrows = len(rownames)
        if nrows < 2: return

        if nrows > 1000:
            take = numpy.array(numpy.floor(numpy.arange(
                0, nrows, nrows / 1000)),
                               dtype=int)
            rownames = [rownames[x] for x in take]
            matrix = matrix[take]

        return odict(
            (('matrix', matrix), ('rows', rownames), ('columns', colnames)))