7cef739b740764fdd246db8182072142c1a6c011 lrnassar Mon Jun 17 15:23:09 2024 -0700 Chaning up some of the colors for the ENIGMA hub tracks as advised by Anna. diff --git src/hg/makeDb/scripts/enigma/BRCAfunctionalAssays.py src/hg/makeDb/scripts/enigma/BRCAfunctionalAssays.py index 8f1857f..6731b64 100644 --- src/hg/makeDb/scripts/enigma/BRCAfunctionalAssays.py +++ src/hg/makeDb/scripts/enigma/BRCAfunctionalAssays.py @@ -5,52 +5,51 @@ try: rawBashOutput = subprocess.run(cmd, check=True, shell=True,\ stdout=subprocess.PIPE, universal_newlines=True, stderr=subprocess.STDOUT) bashStdoutt = rawBashOutput.stdout except subprocess.CalledProcessError as e: raise RuntimeError("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output)) return(bashStdoutt) rawFilePath = "/hive/data/inside/enigmaTracksData/CSpec_BRCA12ACMG_Rules-Specifications_V1.1_Table-9_2023-11-22-1.txt" bash("tail -n +4 "+rawFilePath+" > /hive/data/inside/enigmaTracksData/CSpecDataMinusHeader.txt") rawFileNoHeader = open('/hive/data/inside/enigmaTracksData/CSpecDataMinusHeader.txt','r', encoding='latin-1') varsToConvertToVcf = open('/hive/data/inside/enigmaTracksData/varsToConvert.txt','w') def assignRGBcolor(assignedCode): if assignedCode == "PS3": - itemRgb = '255,0,0' #Red + itemRgb = '0,100,120' #Dark blue elif assignedCode == "BS3": - itemRgb = '0,128,0' #Green + itemRgb = '0,200,240' #Light blue elif assignedCode == "None": itemRgb = '0,0,0' #Black else: print("Error, no code match: "+assignedCode) return(itemRgb) -itemRgb = '0,128,0' #Green +#itemRgb = '0,128,0' #Green for line in rawFileNoHeader: line = line.rstrip().split("\t") if line[0].startswith("BRCA1"): varsToConvertToVcf.write("NM_007294.4:"+line[1]+"\n") elif line[0].startswith("BRCA2"): varsToConvertToVcf.write("NM_000059.4:"+line[1]+"\n") else: print("ERROR! Missing transcript") varsToConvertToVcf.close() rawFileNoHeader.close() -outputVcfFile.close() bash("hgvsToVcf -noLeftShift hg38 /hive/data/inside/enigmaTracksData/varsToConvert.txt /hive/data/inside/enigmaTracksData/tempVcfFile") tempVcfFile = open('/hive/data/inside/enigmaTracksData/tempVcfFile','r') vcfVarCoords = {} for line in tempVcfFile: line = line.rstrip().split("\t") if line[0].startswith("#"): continue else: #Have the dic be the hgnsc as key (e.g. NM_007294.3:c.1081T>C) with a list of chr + vcfLocation #Also subtracting 1 to make a chr chromStart chromEnd format vcfVarCoords[line[2]] = [line[0],str(int(line[1])-1),line[1]]