How to use the cellbrowser.runCommand function in cellbrowser

To help you get started, we’ve selected a few cellbrowser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github maximilianh / cellBrowser / src / cbPyLib / cellbrowser / hubmaker.py View on Github external
bedRow.append(str(len(medianList)))
            bedRow.append(",".join(medianList))
            bedRow.append(str(offset))
            bedRow.append(str(lineLen))

            bedFh.write("\t".join(bedRow))
            bedFh.write("\n")

    bedFh.close()

    if skipCount != 0:
        logging.info("Could not place %d genes, these were skipped" % skipCount)

    bedFname2 = bedFname.replace(".bed", ".sorted.bed")
    cmd = "LC_COLLATE=C sort -k1,1 -k2,2n %s > %s" % (bedFname, bedFname2)
    cellbrowser.runCommand(cmd)

    # convert to .bb using .as file
    # from https://genome.ucsc.edu/goldenpath/help/examples/barChart/barChartBed.as
    #asFname = join(dataDir, )
    asFname = cellbrowser.getStaticFile(["genomes", "barChartBed.as"])
    sizesFname = cellbrowser.getSizesFname(genome)

    cmd = "bedToBigBed -as=%s -type=bed6+5 -tab %s %s %s" % (asFname, bedFname2, sizesFname, bbFname)
    cellbrowser.runCommand(cmd)
github maximilianh / cellBrowser / src / cbPyLib / cellbrowser / hubmaker.py View on Github external
if skipCount != 0:
        logging.info("Could not place %d genes, these were skipped" % skipCount)

    bedFname2 = bedFname.replace(".bed", ".sorted.bed")
    cmd = "LC_COLLATE=C sort -k1,1 -k2,2n %s > %s" % (bedFname, bedFname2)
    cellbrowser.runCommand(cmd)

    # convert to .bb using .as file
    # from https://genome.ucsc.edu/goldenpath/help/examples/barChart/barChartBed.as
    #asFname = join(dataDir, )
    asFname = cellbrowser.getStaticFile(["genomes", "barChartBed.as"])
    sizesFname = cellbrowser.getSizesFname(genome)

    cmd = "bedToBigBed -as=%s -type=bed6+5 -tab %s %s %s" % (asFname, bedFname2, sizesFname, bbFname)
    cellbrowser.runCommand(cmd)