4Misc_Start yEROGI',,c z c z 4!*s,:winspoolMicrosoft Office Document Image WriterMicrosoft Document Imaging Writer Port:Microsoft Office Document Image/d,,Letterwidm yEROGI',,c z c z 4!*s,:winspoolMicrosoft Office Document Image WriterMicrosoft Document Imaging Writer Port:Microsoft Office Document Image/d,,Letterwidm yEROGI',,c z c z 4!*s,:winspoolMicrosoft Office Document Image WriterMicrosoft Document Imaging Writer Port:Microsoft Office Document Image/d,,Letterwidm yEROGI',,c z c z 4!*s,:winspoolMicrosoft Office Document Image WriterMicrosoft Document Imaging Writer Port:Microsoft Office Document Image/d,,Letterwidm yEROGI',,c z c z 4!*s,:winspoolMicrosoft Office Document Image WriterMicrosoft Document Imaging Writer Port:Microsoft Office Document Image/d,,Letterwidm Z& ROGI',, = ` M ` 4!*88 ! <D#winspoolhp psc 700 seriesDOT4_001hp psc 700 series@dvertr (8.5 x 11 in.)=0; mtIndex-=1) SNCGetDDGLists() SNCddgMenu() SNCddgSpace() SNCRawMenu() SNCRawSpace() endfor mtIndex = 0 SNCInputDialogues() sprintf tmpString, "Button AddData disable=0, help={\"Add patch data above to current patch data wave (PD_%s).\"}, title=\"Add above values to current patch data wave (PD_%s)\"", StringFromList(mtIndex,mtNameList), StringFromList(mtIndex,mtNameList) Execute tmpString sprintf tmpString, "Button ToggleDisplay disable=0" Execute tmpString sprintf tmpString, "PopupMenu mtSelect pos={10,25}, size={200,20}, mode=1, help={\"Select which mutant data from the currently loaded file you want to load.\"}, title=\"Select Mutant: \", value=globalMtNameList, proc=SNCMtSelect" Execute tmpString sprintf tmpString, "Button EditPDWave disable=0, title=\"Edit PD_\"+StringFromList(globalMtIndex,globalMtNameList)+\" Wave\"" Execute tmpString sprintf tmpString, "Button CreateDDGGraphs disable=0" Execute tmpString sprintf tmpString, "Button CreateOtherGraphs disable=0" Execute tmpString sprintf tmpString, "Button EditPDWave disable=0" Execute tmpString return err // Zero signifies no error. End // Function to open current patch data file in Notepad.exe for editing (Windows only) Function SNCEditFile(ctrlName) : ButtonControl String ctrlName SVAR path = globalPath String tmppath String cmd sprintf cmd, "Notepad.exe %s", path printf "%s\r", cmd ExecuteScriptText cmd end // Function to open current patch data wave in a table for editing Function SNCEditPDWave(ctrlName) : ButtonControl String ctrlName SVAR mtNameList = globalMtNameList NVAR mtIndex = globalMtIndex String tmpWaveName sprintf tmpWaveName, "PD_%s", StringFromList(mtIndex, mtNameList) Wave tmpWave = $tmpWaveName edit tmpWave end // Function to display a dropdown menu of which mutants are available from currently loaded patch data file, and allows user to select a mutant from the list Function SNCMtSelect(ctrlName,popNum,popStr) : PopupMenuControl String ctrlName Variable popNum // Which item is currently selected (1-based) String popStr // Contents of current popup item as string NVAR mtIndex = globalMtIndex SVAR mtNameList = globalMtNameList String tmpString mtIndex = popNum-1 SNCGetDDGLists() SNCddgMenu() SNCddgSpace() SNCRawMenu() SNCRawSpace() SNCInputDialogues() sprintf tmpString, "Button AddData help={\"Add patch data above to current patch data wave (PD_%s).\"}, title=\"Add above values to current patch data wave (PD_%s)\"", StringFromList(mtIndex,mtNameList), StringFromList(mtIndex,mtNameList) Execute tmpString sprintf tmpString, "Button EditPDWave disable=0, title=\"Edit PD_\"+StringFromList(globalMtIndex,globalMtNameList)+\" Wave\"" Execute tmpString end // Function to create and save ddg lists (globalddgCaList and globalddgMgList) Function SNCGetDDGLists() NVAR mtIndex = globalMtIndex SVAR mtSolutionsList = globalMtSolutionsList SVAR ddgCaList = globalddgCaList SVAR ddgMgList = globalddgMgList String tmpString, tmpList Variable n, i, tmpVar1, tmpVar2 ddgCaList = "" ddgMgList = "" tmpString = StringFromList(mtIndex, mtSolutionsList) for (n=0; n 0) make /O /N=(DimSize(tmpPDWave,0)) tmpWave = tmpPDWave[p][n] WaveStats /Q tmpWave tmpAVWave[0][n] = V_avg tmpAVWave[1][n] = V_sdev tmpAVWave[2][n] = (V_sdev/sqrt(3)) tmpString = GetDimLabel(tmpPDWave,1,n) tmpString = StringFromList(1,tmpString,"_") sprintf tmpString, "%dCa, %dMg", str2num(StringFromList(0,tmpString,":")), str2num(StringFromList(1,tmpString,":")) SetDimLabel 1,n,$tmpString, tmpAVWave tmpVar = DimSize(tmpPDWave,1)-DimSize(tmpAZWave,1) make /O /N=(DimSize(tmpPDWave,0)) tmpWave = tmpPDWave[p][n+tmpVar] WaveStats /Q tmpWave tmpASWave[0][n] = V_avg tmpASWave[1][n] = V_sdev tmpASWave[2][n] = (V_sdev/sqrt(3)) tmpString = GetDimLabel(tmpPDWave,1,n+tmpVar) tmpString = StringFromList(1,tmpString,"_") sprintf tmpString, "%dCa, %dMg", str2num(StringFromList(0,tmpString,":")), str2num(StringFromList(1,tmpString,":")) SetDimLabel 1,(n),$tmpString, tmpASWave make /O /N=(DimSize(tmpPDWave,0)) tmpWave = 25.5*tmpPDWave[p][n]/tmpPDWave[p][n+tmpVar] WaveStats /Q tmpWave tmpAZWave[0][n] = V_avg tmpAZWave[1][n] = V_sdev tmpAZWave[2][n] = (V_sdev/sqrt(3)) tmpString = GetDimLabel(tmpPDWave,1,n) tmpString = StringFromList(1,tmpString,"_") sprintf tmpString, "%dCa, %dMg", str2num(StringFromList(0,tmpString,":")), str2num(StringFromList(1,tmpString,":")) SetDimLabel 1,n,$tmpString,tmpAZWave endif endfor // Display the averaged Vh and Slope values sprintf tmpString, "Avg.\t" for (n=0;n 0) make /O /N=(DimSize(tmpDDWave,0)) tmpWave = tmpDDWave[p][n+DimSize(tmpDDWave,1)-DimSize(tmpADDWave,1)] WaveStats /Q tmpWave tmpADDWave[0][n] = V_avg tmpADDWave[1][n] = V_sdev tmpADDWave[2][n] = (V_sdev/sqrt(3)) sprintf tmpString, "%s%*.*g\t", tmpString, 0,5,tmpADDWave[0][n] else sprintf tmpString, "%sNaN\t", tmpString endif endfor killwaves tmpWave AppendText /N=ddgspace tmpString sprintf tmpString, "\r\K(30464,30464,30464)%s", StringFromList(mtIndex, mtNameList) AppendText /N=ddgspace tmpString TextBox /C /N=rawspace /V=0 flagDisplay = -1 sprintf tmpString, "Button ToggleDisplay title=\"Show V_h and Slope\"" Execute tmpString end // Function to display input dialogues for V_half and Slope values Function SNCInputDialogues() SVAR mtSolutionsList = globalMtSolutionsList SVAR mtNameList = globalMtNameList NVAR mtIndex = globalMtIndex String tmpString, tmpSolutionsList Variable i, tmpVar tmpSolutionsList = StringFromList(mtIndex,mtSolutionsList) tmpVar = ItemsInList(tmpSolutionsList,"_") Make /O /N=(2*tmpVar) tmpIDWave = NaN for (i=0; i<10; i+=1) sprintf tmpString, "KillControl setvar%da", i Execute tmpString sprintf tmpString, "KillControl setvar%db", i Execute tmpString sprintf tmpString, "KillControl setvar%dTitle", i Execute tmpString endfor for (i=0;i= 0) tmpWave[n] = tmpADDWave[0][tmpVar] tmpWave2[n] = tmpADDWave[2][tmpVar] else tmpWave[n] = NaN tmpWave2[n] = NaN endif endfor n+=1 endif endfor else for (i=0; i= 0) tmpWave[n] = tmpADDWave[0][tmpVar] tmpWave2[n] = tmpADDWave[2][tmpVar] //printf "***SEMwave[%d]=%g\r", n, tmpADDWave[2][tmpVar] else tmpWave[n] = NaN tmpWave2[n] = NaN endif endfor n+=1 endif endfor endif TextBox /C /N=rawmenu /V=0 TextBox /C /N=rawspace /V=0 TextBox /C /N=ddgmenu /V=0 TextBox /C /N=ddgspace /V=0 // Clear previous graph catY_GraphList = WaveList("catY_*",";","WIN:") for (i=0; i=0; i=strsearch(tmpList,",",0)) // Convert tmpList to a normal synatx (with ; as separator) tmpList[i,i] = ";" endfor if (ShowSEMFlag) for(i=0; i 47) & (char2num(tmpString[j]) < 58)) break endif endfor if (j == strlen(tmpString)) sprintf tmpString2, "0%s", tmpString catX_Sequence[i] = tmpString2 else catX_Sequence[i] = tmpString[j,(strlen(tmpString)-1)] endif //printf "catX_Sequence[%d] = %s\r", i, catX_Sequence[i] endfor SNCQuickSort("catX_Sequence", tmpList, "catX_Units", 0, numpnts(catX_Units)-1) elseif (sortLabel == 1) // Sort based on number make /o /t /n=(numpnts(catX_Units)) catX_Numbers for (i=0; imaxAxis) maxAxis = tmpVar1 endif if (tmpVar2left) Variable k = SNCPartition(SortWaveName, NumericWaveList, TextWaveList, left, right) SNCQuickSort(SortWaveName, NumericWaveList, TextWaveList, left, k-1) SNCQuickSort(SortWaveName, NumericWaveList, TextWaveList, k+1, right) endif end // Function to partition a list (used in quicksort) Function SNCPartition(SortWaveName, NumericWaveList, TextWaveList, i, j) String SortWaveName, NumericWaveList, TextWaveList Variable i, j Wave/T SortWave = $SortWaveName Variable tmpVar, m, k=j String tmpString, tmpWaveName, value = SortWave[k] do for (;cmpstr(SortWave[i],value)<0;i+=1) endfor j-=1 for (;(cmpstr(SortWave[j],value)>0) && (j>i); j-=1) endfor if (i