b48da38d4aa8dcb9dc75cc1a37b528a5b42b3265 max Thu Jul 18 03:41:35 2024 -0700 adding user suggested dash fix, refs #34121 diff --git src/utils/expMatrixToBarchartBed/expMatrixToBarchartBed src/utils/expMatrixToBarchartBed/expMatrixToBarchartBed index 3f0f45e..9b756bf 100755 --- src/utils/expMatrixToBarchartBed/expMatrixToBarchartBed +++ src/utils/expMatrixToBarchartBed/expMatrixToBarchartBed @@ -314,31 +314,31 @@ continue score = str(determineScore(tpmCutoffs, float(splitLine[-3]))) if autoSql: #skip the 4th field since we recalculated it #need a different ordering to account for possible extraFields bedLine = "\t".join(splitLine[:4] + [score] + splitLine[5:7] + splitLine[-2:] + splitLine[7:-3]) + "\n" else: #skip the 4th field since we recalculate it bedLine = "\t".join(splitLine[:4] + [score] + splitLine[5:7] + splitLine[8:]) + "\n" bedFile.write(bedLine) # Run Max's indexing script: TODO: add verbose options indexedBedFile = tempfile.NamedTemporaryFile(mode="w+", bufsize=1) cmd = "bedJoinTabOffset " + options.matrixFile.name + " " + bedFile.name + " " + indexedBedFile.name - if not options.verbose: cmd += " &>/dev/null" + if not options.verbose: cmd += " 2>&1 >/dev/null" os.system(cmd) # Prepend the bed info to the start of the file. cmd = "echo '" + bedInfo + "' > " + options.outputFile.name os.system(cmd) # any extra fields must come after the fields added by bedJoinTabOffset if autoSql: reorderedBedFile = tempfile.NamedTemporaryFile(mode="w+", bufsize=1) # first print the standard bed6+3 barChart fields # then print the two fields added by bedJoinTabOffset # then any extra fields at the end: cmd = "awk -F'\\t' -v \"OFS=\\t\" '" + \ "{for (i = 1; i < 10; i++) {if (i > 1) printf \"\\t\"; printf \"%s\", $i;}; " + \ "for (i = NF-1; i <= NF; i++) {printf \"\\t%s\", $i;} " + \