Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
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)