Changeset 921


Ignore:
Timestamp:
Apr 14, 2020 5:24:36 PM (2 years ago)
Author:
ilavsky
Message:

WIP PDDF tool

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/User Procedures/Irena/IRB1_bioSAXS.ipf

    r920 r921  
    133133                ING2_AddScrollControl()
    134134                IR1_UpdatePanelVersionNumber("IRB1_PDDFInterfacePanel", IRB1_PDDFInterfaceVersion,1)
     135                IRB1_PDDFResetValuesToPreventStale()
    135136        endif
    136137end
     
    15611562        Button CalcRgAndMolecularWeight,pos={310,180},size={170,20}, proc=IRB1_PDDFButtonProc,title="Fit Rg and calculate MW", help={"Calculate Dmax on these data"}
    15621563        TitleBox PDDFInstructions1 title="\Zr120SAXSMoW2 & Rambo-Tainer Qmax : ",size={230,15},pos={270,220},frame=0,fColor=(0,0,65535),labelBack=0
    1563         checkbox RamboTainerQmax8overRg, pos={270,250}, title="Qmax 8/Rg?", size={76,14},proc=IRB1_PDDFCheckProc, variable=root:Packages:Irena:PDDFInterface:RamboTainerQmax8overRg, mode=0, help={"Set Qmax to 8/Rg automatically"}
    1564         checkbox RamboTainerQmaxLog225, pos={400,250}, title="Qmax I(0)/200?", size={76,14},proc=IRB1_PDDFCheckProc, variable=root:Packages:Irena:PDDFInterface:RamboTainerQmaxLog225, mode=0, help={"Set Qmax to Q when I(0)/200"}
    1565         SetVariable RamboTainerQmax,pos={270,275},size={250,18}, bodyWidth=90, proc=IRB1_PDDFSetVarProc,title="Qmax = ", variable=root:Packages:Irena:PDDFInterface:RamboTainerQmax, limits={0.01,1,0.1},frame=1,bodyWidth=90, help={"Qmax to use"}, format="%4.2f"
     1564        checkbox InvariantCalcQmax8overRg, pos={270,250}, title="Qmax 8/Rg?", size={76,14},proc=IRB1_PDDFCheckProc, variable=root:Packages:Irena:PDDFInterface:InvariantCalcQmax8overRg, mode=0, help={"Set Qmax to 8/Rg automatically"}
     1565        checkbox InvariantCalcQmaxLog225, pos={400,250}, title="Qmax I(0)/200?", size={76,14},proc=IRB1_PDDFCheckProc, variable=root:Packages:Irena:PDDFInterface:InvariantCalcQmaxLog225, mode=0, help={"Set Qmax to Q when I(0)/200"}
     1566        SetVariable InvariantCalcQmax,pos={270,275},size={250,18}, bodyWidth=90, proc=IRB1_PDDFSetVarProc,title="Qmax = ", variable=root:Packages:Irena:PDDFInterface:InvariantCalcQmax, limits={0.01,1,0.01},frame=1,bodyWidth=90, help={"Qmax to use"}, format="%4.2f"
    15661567
    15671568        TitleBox PDDFInstructions11 title="\Zr120Rambo-Tainer Background : ",size={230,15},pos={270,310},frame=0,fColor=(0,0,65535),labelBack=0
     
    15741575        TitleBox PDDFInstructions2 title="\Zr100Remember - this Estimate requires Absolute Intensity!",size={330,15},pos={270,435},frame=0,fColor=(0,0,65535),labelBack=0
    15751576
    1576 
    15771577        //Below, at the end...
    1578 
    1579         //GNOM calculated results
    1580         TitleBox PDDFInstructions21 title="\Zr120Results :",size={330,15},pos={270,475},frame=0,fColor=(0,0,65535),labelBack=0
    1581         SetVariable MWTrueVolumeA3,pos={400,475},size={250,15}, noproc,title="Porod Volume [A^3] =  ", variable=root:Packages:Irena:PDDFInterface:MWTrueVolumeA3, noedit=1,limits={0,inf,0},frame=0, help={"True Volume of protein in [cm3] "}
    1582 
    1583         SetVariable ReciprocalSpaceI0,pos={260,500},size={200,15}, noproc,title="Reciprocal Space I0 =   ", variable=root:Packages:Irena:PDDFInterface:ReciprocalSpaceI0, noedit=1,limits={0,inf,0},frame=0,size={180,17}, bodyWidth=70, help={"Porod Invariant calcualtion result"}, format="%4.2f"
    1584         SetVariable ReciprocalSpaceRg,pos={470,500},size={120,17},bodyWidth=70, noproc,title="Rg [A]  = ", variable=root:Packages:Irena:PDDFInterface:ReciprocalSpaceRg, noedit=1,limits={0,inf,0},frame=0, help={"Density of protein, user changeable, in g/cm3"}, format="%4.2f"
     1578        TitleBox PDDFInstructions21 title="\Zr140Mol Weight results:",size={250,15},pos={350,460},frame=0,fColor=(0,0,65535),labelBack=0
     1579        TitleBox PDDFInstructions23 title="\Zr110Reciprocal space (Guinier fit):",size={330,15},pos={270,480},frame=0,fColor=(0,0,65535),labelBack=0
     1580        SetVariable ReciprocalPorodVolumeA3,pos={290,500},size={100,15}, format="%4.0f",bodyWidth=50, noproc,title="Vol [A^3] = ", variable=root:Packages:Irena:PDDFInterface:ReciprocalPorodVolumeA3, noedit=1,limits={0,inf,0},frame=0, help={"True Volume of protein in [cm3] "}
     1581        SetVariable ReciprocalSpaceI0,pos={350,500},size={120,15},bodyWidth=50, noproc,title="I0 = ", variable=root:Packages:Irena:PDDFInterface:ReciprocalSpaceI0, noedit=1,limits={0,inf,0},frame=0,size={180,17}, bodyWidth=70, help={"Porod Invariant calcualtion result"}, format="%4.2f"
     1582        SetVariable ReciprocalSpaceRg,pos={480,500},size={120,17},bodyWidth=50, noproc,title="Rg [A] = ", variable=root:Packages:Irena:PDDFInterface:ReciprocalSpaceRg, noedit=1,limits={0,inf,0},frame=0, help={"Density of protein, user changeable, in g/cm3"}, format="%4.2f"
    15851583        SetVariable SAXSMoW2MWRecSpacekDa,pos={300,520},size={250,15},bodyWidth=70, noproc,title="SAXSMoW2 MW [kDa]  = ", variable=root:Packages:Irena:PDDFInterface:SAXSMoW2MWRecSpacekDa, noedit=1,fstyle=1, fsize=13, limits={0,inf,0},frame=0, help={"Molecular weight calculated from SAXSMoW2 method in kDa"}, fColor=(52428,1,1), format="%8.2f"
    1586         SetVariable RamboTainerMW,pos={300,545},size={250,15},bodyWidth=70, noproc,title="Rambo-Tainer MW [kDa]  = ",variable=root:Packages:Irena:PDDFInterface:RamboTainerMW, disable=0, noedit=1,limits={0,inf,0},frame=0,fstyle=1, fsize=13, fColor=(52428,1,1), help={"Molecular weight calculated from Rambo-Tainer method in kDa"}, format="%8.2f"
    1587        
    1588         SetVariable RealSpaceI0,pos={260,580},size={200,15}, noproc,title="Real Space (GNOM) I0 = ",variable=root:Packages:Irena:PDDFInterface:RealSpaceI0, disable=0, noedit=1,limits={0,inf,0},frame=0, size={180,17}, bodyWidth=70, help={"Porod Invariant calcualtion result"}, format="%4.2f"
    1589         SetVariable RealSpaceRg,pos={470,580},size={120,17},bodyWidth=70, noproc,title="Rg [A] =     ",variable=root:Packages:Irena:PDDFInterface:RealSpaceRg,  disable=0, noedit=1,limits={0,inf,0},frame=0, format="%4.2f"
    1590         SetVariable SAXSMoW2MWRealSpacekDa,pos={300,605},size={250,15},bodyWidth=70, noproc,title="SAXSMoW2 MW [kDa]  = ", variable=root:Packages:Irena:PDDFInterface:SAXSMoW2MWRealSpacekDa, noedit=1,fstyle=1, fsize=13, limits={0,inf,0},frame=0, help={"Molecular weight calculated from SAXSMoW2 method in kDa"}, fColor=(52428,1,1), format="%8.2f"
    1591         SetVariable PDDFCalculatedMW,pos={300,630},size={250,15},bodyWidth=70, noproc,title="Abs. Int. Est. MW [kDa]  = ",variable=root:Packages:Irena:PDDFInterface:PDDFCalculatedMW, disable=0, noedit=1,limits={0,inf,0},frame=0,fstyle=1, fsize=13, fColor=(52428,1,1), help={"Molecular weight calculated from PDDF method in kDa"}, format="%8.2f"
    1592 
    1593 
     1584        SetVariable RamboTainerMW,pos={300,540},size={250,15},bodyWidth=70, noproc,title="Rambo-Tainer MW [kDa]  = ",variable=root:Packages:Irena:PDDFInterface:RamboTainerMW, disable=0, noedit=1,limits={0,inf,0},frame=0,fstyle=1, fsize=13, fColor=(52428,1,1), help={"Molecular weight calculated from Rambo-Tainer method in kDa"}, format="%8.2f"
     1585       
     1586        TitleBox PDDFInstructions22 title="\Zr110Real space (GNOM+abs. Int.+conc.):",size={330,15},pos={270,570},frame=0,fColor=(0,0,65535),labelBack=0
     1587        SetVariable RealSpacePorodVolumeA3,pos={290,590},size={100,15},bodyWidth=50, format="%4.0f", noproc,title="Vol [A^3] = ", variable=root:Packages:Irena:PDDFInterface:RealSpacePorodVolumeA3, noedit=1,limits={0,inf,0},frame=0, help={"True Volume of protein in [A^3] "}
     1588        SetVariable RealSpaceI0,pos={350,590},size={120,15},bodyWidth=50, noproc,title="I0 = ",variable=root:Packages:Irena:PDDFInterface:RealSpaceI0, disable=0, noedit=1,limits={0,inf,0},frame=0, size={180,17}, bodyWidth=70, help={"Porod Invariant calcualtion result"}, format="%4.2f"
     1589        SetVariable RealSpaceRg,pos={480,590},size={120,17},bodyWidth=50, noproc,title="Rg [A] = ",variable=root:Packages:Irena:PDDFInterface:RealSpaceRg,  disable=0, noedit=1,limits={0,inf,0},frame=0, format="%4.2f"
     1590        SetVariable SAXSMoW2MWRealSpacekDa,pos={300,612},size={250,15},bodyWidth=70, noproc,title="SAXSMoW2 MW [kDa]  = ", variable=root:Packages:Irena:PDDFInterface:SAXSMoW2MWRealSpacekDa, noedit=1,fstyle=1, fsize=13, limits={0,inf,0},frame=0, help={"Molecular weight calculated from SAXSMoW2 method in kDa"}, fColor=(52428,1,1), format="%8.2f"
     1591        SetVariable PDDFCalculatedMW,pos={300,635},size={250,15},bodyWidth=70, noproc,title="Abs. Int. Est. MW [kDa]  = ",variable=root:Packages:Irena:PDDFInterface:PDDFCalculatedMW, disable=0, noedit=1,limits={0,inf,0},frame=0,fstyle=1, fsize=13, fColor=(52428,1,1), help={"Molecular weight calculated from PDDF method in kDa"}, format="%8.2f"
     1592
     1593//
    15941594        //Controls for results 
    1595         TitleBox PDDFInstructions3 title="\Zr110Save results controls : ",size={200,15},pos={300,655},frame=0,fColor=(0,0,65535),labelBack=0
    1596         TitleBox PDDFInstructions4 title="\Zr100Where? : ",size={120,15},pos={465,655},frame=0,fColor=(0,0,65535),labelBack=0
     1595        TitleBox PDDFInstructions3 title="\Zr110Save results controls : ",size={200,15},pos={300,660},frame=0,fColor=(0,0,65535),labelBack=0
     1596        TitleBox PDDFInstructions4 title="\Zr100Where? : ",size={120,15},pos={485,660},frame=0,fColor=(0,0,65535),labelBack=0
    15971597        checkbox SaveToFolder, pos={495,679}, title="Folder", size={76,14},noproc, variable=root:Packages:Irena:PDDFInterface:SaveToFolder, mode=0, help={"Save to folder"}
    15981598        checkbox SaveToNotebook, pos={495,697}, title="Notebook", size={76,14},noproc, variable=root:Packages:Irena:PDDFInterface:SaveToNotebook, mode=0, help={"Save to notebook"}
     
    16011601
    16021602        //results presentation for all methods...
    1603         Button SavePDDFresults,pos={300,680},size={180,20}, proc=IRB1_PDDFButtonProc,title="Save PDDF results", help={"Save PDDF results to folder"}
     1603        Button SavePDDFresults,pos={300,685},size={180,20}, proc=IRB1_PDDFButtonProc,title="Save PDDF results", help={"Save PDDF results to folder"}
    16041604        Button OpenResultsAndTable,pos={300,710},size={180,15}, proc=IRB1_PDDFButtonProc,title="Open Table and Notebook", help={"Open Table and Notebook with results"}
    16051605        Button DeleteResultsAndTable,pos={230,735},size={130,15}, proc=IRB1_PDDFButtonProc,title="Delete results waves", help={"Delete waves with results, this will clean the records!"}
     
    16351635//**********************************************************************************************************
    16361636
    1637 static Function IRB1_PDDFRecalculareQmax()
    1638 
    1639                         NVAR RamboTainerQmax8overRg = root:Packages:Irena:PDDFInterface:RamboTainerQmax8overRg
    1640                         NVAR RamboTainerQmaxLog225 = root:Packages:Irena:PDDFInterface:RamboTainerQmaxLog225
     1637Function IRB1_PDDFRecalculareQmax()
     1638
     1639                        NVAR InvariantCalcQmax8overRg = root:Packages:Irena:PDDFInterface:InvariantCalcQmax8overRg
     1640                        NVAR InvariantCalcQmaxLog225 = root:Packages:Irena:PDDFInterface:InvariantCalcQmaxLog225
    16411641                       
    1642                         NVAR RamboTainerQmax = root:Packages:Irena:PDDFInterface:RamboTainerQmax
     1642                        NVAR InvariantCalcQmax = root:Packages:Irena:PDDFInterface:InvariantCalcQmax
    16431643                        NVAR ReciprocalSpaceRg = root:Packages:Irena:PDDFInterface:ReciprocalSpaceRg
    16441644                        NVAR ReciprocalSpaceI0=root:Packages:Irena:PDDFInterface:ReciprocalSpaceI0
     
    16461646                        Wave Qvector=root:Packages:Irena:PDDFInterface:Q_vec
    16471647                       
    1648                         if(RamboTainerQmax8overRg && ReciprocalSpaceRg>0)       
    1649                                 RamboTainerQmax = 8/ReciprocalSpaceRg
    1650                         elseif(RamboTainerQmaxLog225 && ReciprocalSpaceI0>0)
     1648                        if(InvariantCalcQmax8overRg && ReciprocalSpaceRg>0)     
     1649                                InvariantCalcQmax = 8/ReciprocalSpaceRg
     1650                        elseif(InvariantCalcQmaxLog225 && ReciprocalSpaceI0>0)
    16511651                                variable IntToFind = ReciprocalSpaceI0/200
    16521652                                FindLevel/P/Q Intensity, IntToFind
    16531653                                if(V_Flag==0)   //level found...
    1654                                         RamboTainerQmax = Qvector[V_LevelX]
     1654                                        InvariantCalcQmax = Qvector[V_LevelX]
    16551655                                else    //now found...
    1656                                         RamboTainerQmax = Qvector[numpnts(Qvector)-2]
     1656                                        InvariantCalcQmax = Qvector[numpnts(Qvector)-2]
    16571657                                endif
    16581658                        else
    1659                                 if(RamboTainerQmax<0.05)
    1660                                         RamboTainerQmax = 0.3
     1659                                if(InvariantCalcQmax<0.05)
     1660                                        InvariantCalcQmax = 0.3
    16611661                                endif
    16621662                        endif                   
     
    17001700                        endif
    17011701                       
    1702                         if(stringmatch(sva.ctrlName,"RamboTainerQmax"))
    1703                                 NVAR RamboTainerQmax8overRg = root:Packages:Irena:PDDFInterface:RamboTainerQmax8overRg
    1704                                 NVAR RamboTainerQmaxLog225 = root:Packages:Irena:PDDFInterface:RamboTainerQmaxLog225
    1705                                 RamboTainerQmax8overRg = 0
    1706                                 RamboTainerQmaxLog225 = 0
     1702                        if(stringmatch(sva.ctrlName,"InvariantCalcQmax"))
     1703                                NVAR InvariantCalcQmax8overRg = root:Packages:Irena:PDDFInterface:InvariantCalcQmax8overRg
     1704                                NVAR InvariantCalcQmaxLog225 = root:Packages:Irena:PDDFInterface:InvariantCalcQmaxLog225
     1705                                InvariantCalcQmax8overRg = 0
     1706                                InvariantCalcQmaxLog225 = 0
    17071707                        endif
    17081708                        if(stringmatch(sva.ctrlName,"RamboTainerFlatBackground"))
    17091709                                NVAR RamboTainerAutoSetBckg = root:Packages:Irena:PDDFInterface:RamboTainerAutoSetBckg
    17101710                                RamboTainerAutoSetBckg = 0
    1711                                 IRB1_PDDFFitAndCalculateMW()
    1712                         endif
    1713                         if(stringmatch(sva.ctrlName,"RamboTainerQmax"))
    1714                                 IRB1_PDDFFitAndCalculateMW()
     1711                                //IRB1_PDDFFitRgAndG()
     1712                                IRB1_PDDFCalcRamboTainer()
     1713                        endif
     1714                        if(stringmatch(sva.ctrlName,"InvariantCalcQmax"))
     1715                                //IRB1_PDDFFitRgAndG()
     1716                                IRB1_PDDFCalcSAXSMoW2()
     1717                                IRB1_PDDFCalcRamboTainer()
    17151718                        endif
    17161719
     
    17721775        TitleBox PDDFInstructions1, win=IRB1_PDDFInterfacePanel,  disable = (whichTab!=1)
    17731776        Button CalcRgAndMolecularWeight, win=IRB1_PDDFInterfacePanel,  disable = (whichTab!=1)
    1774         //SetVariable MWTrueVolumeA3, win=IRB1_PDDFInterfacePanel,  disable = (whichTab!=1)
     1777        //SetVariable ReciprocalPorodVolumeA3, win=IRB1_PDDFInterfacePanel,  disable = (whichTab!=1)
    17751778        checkbox RamboTainerAutoSetBckg,  disable = (whichTab!=1)
    1776         checkbox RamboTainerQmax8overRg,  disable = (whichTab!=1)
    1777         checkbox RamboTainerQmaxLog225,  disable = (whichTab!=1)
    1778         SetVariable RamboTainerQmax,  disable = (whichTab!=1)
     1779        checkbox InvariantCalcQmax8overRg,  disable = (whichTab!=1)
     1780        checkbox InvariantCalcQmaxLog225,  disable = (whichTab!=1)
     1781        SetVariable InvariantCalcQmax,  disable = (whichTab!=1)
    17791782        checkbox RamboTainerSubtractFlatBackground,  disable = (whichTab!=1)
    17801783        SetVariable RamboTainerFlatBackground,  disable = (whichTab!=1)
     
    18261829                        NVAR PDDFUseProtein = root:Packages:Irena:PDDFInterface:PDDFUseProtein
    18271830                        NVAR PDDFUseNucleicAcid = root:Packages:Irena:PDDFInterface:PDDFUseNucleicAcid
    1828                         NVAR RamboTainerQmax8overRg = root:Packages:Irena:PDDFInterface:RamboTainerQmax8overRg
    1829                         NVAR RamboTainerQmaxLog225 = root:Packages:Irena:PDDFInterface:RamboTainerQmaxLog225
     1831                        NVAR InvariantCalcQmax8overRg = root:Packages:Irena:PDDFInterface:InvariantCalcQmax8overRg
     1832                        NVAR InvariantCalcQmaxLog225 = root:Packages:Irena:PDDFInterface:InvariantCalcQmaxLog225
    18301833
    18311834                        if(stringmatch(cba.ctrlname,"RamboTainerAutoSetBckg"))
    1832                                 IRB1_PDDFFitAndCalculateMW()
     1835                                //IRB1_PDDFFitRgAndG()
     1836                                //IRB1_PDDFCalcSAXSMoW2()
     1837                                IRB1_PDDFCalcRamboTainer()
    18331838                        endif
    18341839                        if(stringmatch(cba.ctrlname,"RamboTainerSubtractFlatBackground"))
    1835                                 IRB1_PDDFFitAndCalculateMW()
    1836                         endif
    1837                         if(stringmatch(cba.ctrlname,"RamboTainerQmax8overRg"))
     1840                                //IRB1_PDDFFitRgAndG()
     1841                                //IRB1_PDDFCalcSAXSMoW2()
     1842                                IRB1_PDDFCalcRamboTainer()
     1843                        endif
     1844                        if(stringmatch(cba.ctrlname,"InvariantCalcQmax8overRg"))
    18381845                                if(checked)
    1839                                         //RamboTainerQmax8overRg = 0
    1840                                         RamboTainerQmaxLog225 = 0
     1846                                        //InvariantCalcQmax8overRg = 0
     1847                                        InvariantCalcQmaxLog225 = 0
    18411848                                endif
    1842                                 IRB1_PDDFRecalculareQmax()
    1843                                 IRB1_PDDFFitAndCalculateMW()
    1844                         endif
    1845                         if(stringmatch(cba.ctrlname,"RamboTainerQmaxLog225"))
     1849                                //IRB1_PDDFRecalculareQmax()
     1850                                //IRB1_PDDFFitRgAndG()
     1851                                IRB1_PDDFCalcSAXSMoW2()
     1852                                IRB1_PDDFCalcRamboTainer()
     1853                        endif
     1854                        if(stringmatch(cba.ctrlname,"InvariantCalcQmaxLog225"))
    18461855                                if(checked)
    1847                                         RamboTainerQmax8overRg = 0
    1848                                         //RamboTainerQmaxLog225 = 0
     1856                                        InvariantCalcQmax8overRg = 0
     1857                                        //InvariantCalcQmaxLog225 = 0
    18491858                                endif
    1850                                 IRB1_PDDFRecalculareQmax()
    1851                                 IRB1_PDDFFitAndCalculateMW()
     1859                                //IRB1_PDDFRecalculareQmax()
     1860                                //IRB1_PDDFFitRgAndG()
     1861                                IRB1_PDDFCalcSAXSMoW2()
     1862                                IRB1_PDDFCalcRamboTainer()
    18521863                        endif
    18531864
     
    18911902                        if(stringmatch(cba.ctrlname,"PDDFUseProtein"))
    18921903                                PDDFUseNucleicAcid=!PDDFUseProtein
    1893                                 IRB1_SetDensitySLD()   
    1894                                 IRB1_ResetValuesToPreventStale()
     1904                                IRB1_PDDFSetDensitySLD()       
     1905                                IRB1_PDDFResetValuesToPreventStale()
    18951906                        endif                   
    18961907                        if(stringmatch(cba.ctrlname,"PDDFUseNucleicAcid"))
    18971908                                PDDFUseProtein=!PDDFUseNucleicAcid
    1898                                 IRB1_SetDensitySLD()   
    1899                                 IRB1_ResetValuesToPreventStale()
     1909                                IRB1_PDDFSetDensitySLD()       
     1910                                IRB1_PDDFResetValuesToPreventStale()
    19001911                        endif
    19011912                        break
     
    19601971                        endif
    19611972                        if(stringMatch(ba.ctrlName,"CalcRgAndMolecularWeight"))
    1962                                 IRB1_PDDFFitAndCalculateMW()
     1973                                IRB1_PDDFFitRgAndG()
     1974                                IRB1_PDDFCalcSAXSMoW2()
     1975                                IRB1_PDDFCalcRamboTainer()
    19631976                        endif
    19641977                        if(stringMatch(ba.ctrlName,"OpenResultsAndTable"))
     
    20302043end
    20312044//**********************************************************************************************************
    2032 
     2045//
    20332046Function IRB1_PDDFCalculateRgI0()
    2034 
    2035         NVAR CalcRg=root:Packages:Irena:PDDFInterface:RealSpaceRg
    2036         NVAR CalcI0=root:Packages:Irena:PDDFInterface:RealSpaceI0
    2037         Wave Radius = root:Packages:Irena:PDDFInterface:pddfRadius
    2038         Wave Pr = root:Packages:Irena:PDDFInterface:pddfPr
     2047        print "IRB1_PDDFCalculateRgI0 does nothing, it needs to be used when using Irena PDDF calculations."
     2048//
     2049//      NVAR CalcRg=root:Packages:Irena:PDDFInterface:RealSpaceRg
     2050//      NVAR CalcI0=root:Packages:Irena:PDDFInterface:RealSpaceI0
     2051//      Wave Radius = root:Packages:Irena:PDDFInterface:pddfRadius
     2052//      Wave Pr = root:Packages:Irena:PDDFInterface:pddfPr
     2053//      NVAR ConcentrationForCals=root:Packages:Irena:PDDFInterface:ConcentrationForCals
     2054//      NVAR ScattLengthDensDifference=root:Packages:Irena:PDDFInterface:ScattLengthDensDifference
     2055//      NVAR PDDFCalculatedMW=root:Packages:Irena:PDDFInterface:PDDFCalculatedMW
     2056//     
     2057//      Duplicate/Free Pr, R2Pr
     2058//      R2Pr = Radius^2 * Pr
     2059//     
     2060//      //CalcI0 = 4*pi*areaXY(Radius, Pr )
     2061//     
     2062//      //CalcRg = sqrt(areaXY(Radius, R2Pr )/areaXY(Radius, Pr ))
     2063//     
     2064//      PDDFCalculatedMW = 6.023e23*CalcI0/(ConcentrationForCals*(ScattLengthDensDifference*1e10)^2)
     2065//
     2066end
     2067//**********************************************************************************************************
     2068//**********************************************************************************************************
     2069//**********************************************************************************************************
     2070//**********************************************************************************************************
     2071
     2072
     2073Function IRB1_PDDFCalcSAXSMoW2()
     2074
     2075        Wave OriginalIntensity=root:Packages:Irena:PDDFInterface:Intensity
     2076        Wave OriginalQvector=root:Packages:Irena:PDDFInterface:Q_vec
     2077        Wave OriginalError=root:Packages:Irena:PDDFInterface:Errors
     2078        //now method 1 how to calcualet MW:     
     2079        //calculate Molecular weight using SAXSMol2 method...
     2080        //now, calculate invariant.
     2081        //In this case we follow manuscript for SAXSMoW 2.0, DOI: 10.1002/pro.3528
     2082        //Vassili Piadov, Evandro Ares de Araújo, Mario Oliveira Neto,  Aldo Felix Craievich, and Igor Polikarpov
     2083        //PROTEIN SCIENCE 2019 | VOL 28:454–463
     2084        //use Model data below ~ 0.6*pi/Rg and real data above this as needed...
     2085        NVAR MWPorodInvariant=root:Packages:Irena:PDDFInterface:MWPorodInvariant
     2086        NVAR ReciprocalPorodVolumeA3=root:Packages:Irena:PDDFInterface:ReciprocalPorodVolumeA3
     2087        NVAR RealSpacePorodVolumeA3=root:Packages:Irena:PDDFInterface:RealSpacePorodVolumeA3
     2088        NVAR MWMassDensityProtein=root:Packages:Irena:PDDFInterface:MWMassDensityProtein                        //g/cm3, see line after formula 11
     2089        NVAR SAXSMoW2MWRecSpacekDa=root:Packages:Irena:PDDFInterface:SAXSMoW2MWRecSpacekDa
     2090        NVAR SAXSMoW2MWRealSpacekDa=root:Packages:Irena:PDDFInterface:SAXSMoW2MWRealSpacekDa   
     2091        NVAR InvariantCalcQmax8overRg = root:Packages:Irena:PDDFInterface:InvariantCalcQmax8overRg
     2092        NVAR InvariantCalcQmaxLog225 = root:Packages:Irena:PDDFInterface:InvariantCalcQmaxLog225       
     2093        NVAR InvariantCalcQmax = root:Packages:Irena:PDDFInterface:InvariantCalcQmax
     2094        IRB1_PDDFRecalculareQmax()                              //this will set Qmax as needed... //formula 7 or 8 or user choice
     2095        //alternative is to pick InvariantCalcQmax based on Formula 8, so log(I(o)/I(gmax) ~ 2.25
     2096        NVAR ReciprocalSpaceI0=root:Packages:Irena:PDDFInterface:ReciprocalSpaceI0
     2097        NVAR ReciprocalSpaceRg=root:Packages:Irena:PDDFInterface:ReciprocalSpaceRg
     2098        NVAR ReciprocalSpaceB=root:Packages:Irena:PDDFInterface:ReciprocalSpaceB
     2099        NVAR ReciprocalSpacePorodSlope=root:Packages:Irena:PDDFInterface:ReciprocalSpacePorodSlope
     2100        variable TempNumPoints=2000
     2101        Make/Free/N=(TempNumPoints) InvariantIntWv, InvariantQWv, InvarQstar, InvarIntQ2
     2102        variable Bval, Aval
     2103        variable Vprime
     2104        variable ChangeToRealIntP, QValueToChange       
     2105        if(ReciprocalSpaceI0>0 && ReciprocalSpaceRg>1)                                                                                                                  //prevent crash when user did not run the Guinier fit...
     2106                InvariantQWv            =       p*(InvariantCalcQmax/(numpnts(InvariantQWv)-1))+0.00002                                 //this creates Q wave between 0.00002 and qmax
     2107                InvarQstar                      =       InvariantQWv / (erf(InvariantQWv*ReciprocalSpaceRg/sqrt(6)))^3                                                  //Q* for Unified level
     2108                InvariantIntWv          =       ReciprocalSpaceI0*exp(-InvariantQWv^2*ReciprocalSpaceRg^2/3)+(ReciprocalSpaceB/InvarQstar^ReciprocalSpacePorodSlope)                    //no background Unified intensity
     2109                //now we need to replace intensity from somethign around 0.6*pi/Rg with experimental intensity
     2110                QValueToChange  =       0.4*pi/ReciprocalSpaceRg
     2111                ChangeToRealIntP        =       BinarySearch(InvariantQWv,QValueToChange )
     2112                InvariantIntWv[ChangeToRealIntP, ] = OriginalIntensity[BinarySearchInterp(OriginalQvector, InvariantQWv[p])]
     2113                //done, this shoudl now have attached tail of real data...
     2114                InvarIntQ2 = InvariantIntWv * InvariantQWv^2                                                                                                                    //I * Q^2
     2115                MWPorodInvariant = areaXY(InvariantQWv, InvarIntQ2)                                                                                                     //this is from Q=0 to Q=InvariantCalcQmax
     2116                Vprime = 2*pi^2*ReciprocalSpaceI0/MWPorodInvariant                                                                                      //this is formula 5
     2117                //setup the weird approximation of missing tail correction for invariant...
     2118                //this is formula 10
     2119                Aval = -2.114e6 * InvariantCalcQmax^4 + 2.920e6 * InvariantCalcQmax^3 - 1.472e6*InvariantCalcQmax^2 + 3.349e5*InvariantCalcQmax - 3.577e4
     2120                Bval = 12.09*InvariantCalcQmax^3 - 9.39*InvariantCalcQmax^2 + 3.03*InvariantCalcQmax + 0.29
     2121                ReciprocalPorodVolumeA3  = Aval + Bval*Vprime                                                                                                           //this is in A^3
     2122                //formula 11
     2123                SAXSMoW2MWRecSpacekDa = MWMassDensityProtein*ReciprocalPorodVolumeA3* 1e-24     /1.662e-21     
     2124        else
     2125                SAXSMoW2MWRecSpacekDa = 0
     2126                ReciprocalPorodVolumeA3 = 0             
     2127        endif   
     2128        // and if we have Intensity from GNOM, here is real space SAXSMoW2 calculation:
     2129        NVAR RealSpaceRg = root:Packages:Irena:PDDFInterface:RealSpaceRg
     2130        NVAR RealSpaceI0 = root:Packages:Irena:PDDFInterface:RealSpaceI0
     2131        NVAR PDDFCalculatedMW=root:Packages:Irena:PDDFInterface:PDDFCalculatedMW
    20392132        NVAR ConcentrationForCals=root:Packages:Irena:PDDFInterface:ConcentrationForCals
    20402133        NVAR ScattLengthDensDifference=root:Packages:Irena:PDDFInterface:ScattLengthDensDifference
    2041         NVAR PDDFCalculatedMW=root:Packages:Irena:PDDFInterface:PDDFCalculatedMW
    2042        
    2043         Duplicate/Free Pr, R2Pr
    2044         R2Pr = Radius^2 * Pr
    2045        
    2046         //CalcI0 = 4*pi*areaXY(Radius, Pr )
    2047        
    2048         //CalcRg = sqrt(areaXY(Radius, R2Pr )/areaXY(Radius, Pr ))
    2049        
    2050         PDDFCalculatedMW = 6.023e23*CalcI0/(ConcentrationForCals*(ScattLengthDensDifference*1e10)^2)
    2051 
    2052 end
    2053 //**********************************************************************************************************
    2054 //**********************************************************************************************************
    2055 
    2056 static Function IRB1_PDDFFitAndCalculateMW()
    2057         //copy of IR2Pr_EstimateDmax
     2134        Wave/Z pddfModelIntExtrap = root:Packages:Irena:PDDFInterface:pddfModelIntExtrap
     2135        Wave/Z pddfQvecExtrap = root:Packages:Irena:PDDFInterface:pddfQvecExtrap
     2136        if(RealSpaceI0>0 && WaveExists(pddfModelIntExtrap) && WaveExists(pddfQvecExtrap))       //GNOM generated data exist...
     2137                Duplicate/Free pddfModelIntExtrap, InvarIntQ2GNOM
     2138                InvarIntQ2GNOM = pddfModelIntExtrap * pddfQvecExtrap^2
     2139                MWPorodInvariant = areaXY(pddfQvecExtrap, InvarIntQ2GNOM)
     2140                Vprime = 2*pi^2*RealSpaceI0/MWPorodInvariant                                                                                            //this is formula 5
     2141                variable GNOMQmax=pddfQvecExtrap[numpnts(pddfQvecExtrap)-1]
     2142                Aval = -2.114e6 * GNOMQmax^4 + 2.920e6 * GNOMQmax^3 - 1.472e6*GNOMQmax^2 + 3.349e5*GNOMQmax - 3.577e4
     2143                Bval = 12.09*GNOMQmax^3 - 9.39*GNOMQmax^2 + 3.03*GNOMQmax + 0.29
     2144                RealSpacePorodVolumeA3  = Aval + Bval*Vprime
     2145                SAXSMoW2MWRealSpacekDa = MWMassDensityProtein*RealSpacePorodVolumeA3* 1e-24     /1.662e-21     
     2146                //and this is calculation from absolute intensity
     2147                PDDFCalculatedMW = 6.023e23*RealSpaceI0/(ConcentrationForCals*(ScattLengthDensDifference*1e10)^2)
     2148        else
     2149                SAXSMoW2MWRealSpacekDa = 0
     2150                PDDFCalculatedMW = 0
     2151                RealSpacePorodVolumeA3 = 0
     2152        endif
     2153        //this ends calculations for SAXSMoW2 ...
     2154        Wave/Z FitScatteringProfile=root:Packages:Irena:PDDFInterface:FitScatteringProfile
     2155        if(WaveExists(FitScatteringProfile))
     2156                CheckDisplayed /W=IRB1_PDDFInterfacePanel#DataDisplay FitScatteringProfile
     2157                if(V_Flag)
     2158                        string Tagtext="\\F"+IN2G_LkUpDfltStr("FontType")+"\\Z"+IN2G_LkUpDfltVar("TagSize")+"SAXSMoW2 Rg [A] = "+num2str(ReciprocalSpaceRg)+"\r"
     2159                        Tagtext+="\\F"+IN2G_LkUpDfltStr("FontType")+"\\Z"+IN2G_LkUpDfltVar("TagSize")+"I0 = "+num2str(ReciprocalSpaceI0)
     2160                        //Tagtext+="\\F"+IN2G_LkUpDfltStr("FontType")+"\\Z"+IN2G_LkUpDfltVar("TagSize")+"Protein Vol [cm3] = "+num2str(ReciprocalPorodVolumeA3)+"\r"
     2161                        Tagtext+="\\F"+IN2G_LkUpDfltStr("FontType")+"\\Z"+IN2G_LkUpDfltVar("TagSize")+"     MW [kDa] = "+num2str(SAXSMoW2MWRecSpacekDa)
     2162                        Tag/C/N=GuessRg/A=LT/L=0/TL=0/W=IRB1_PDDFInterfacePanel#DataDisplay FitScatteringProfile, numpnts(FitScatteringProfile)/10,Tagtext
     2163                endif
     2164        endif
     2165
     2166        //***
     2167
     2168end
     2169//**********************************************************************************************************
     2170//**********************************************************************************************************
     2171//**********************************************************************************************************
     2172//**********************************************************************************************************
     2173//**********************************************************************************************************
     2174
     2175
     2176Function IRB1_PDDFCalcRamboTainer()
     2177
     2178        Wave OriginalIntensity=root:Packages:Irena:PDDFInterface:Intensity
     2179        Wave OriginalQvector=root:Packages:Irena:PDDFInterface:Q_vec
     2180        Wave OriginalError=root:Packages:Irena:PDDFInterface:Errors
     2181
     2182///
     2183
     2184        //now method from Rambo-Tainer, doi:10.1038/nature12070, Nature 2013, vol. 496, pg 477
     2185        //Accurate assessment of mass, models and resolution by small-angle scattering
     2186        //here is what this does:
     2187        //1. Calculate Vc = I(0)/2*pi*Lc= I(0)/IntgQ*I(Q)dQ
     2188        //calculate Qr (really, do we really have to use Q in some many meanings???) Qr=Vc^2/Rg         [A^3]
     2189        //and now they plotted for Proteins and Nucelic acis separate dependnecies... Got approximately linar depency
     2190        // ln(Q) = a* ln(MW) + b
     2191        // protein MW= (Qr/0.1231)^1.0
     2192        //Nucelic acid MW= (Qr/0.00934)^0.808
     2193        //but first , we need to fit data with background also:
     2194        NVAR InvariantCalcQmax8overRg = root:Packages:Irena:PDDFInterface:InvariantCalcQmax8overRg
     2195        NVAR InvariantCalcQmaxLog225 = root:Packages:Irena:PDDFInterface:InvariantCalcQmaxLog225       
     2196        NVAR InvariantCalcQmax = root:Packages:Irena:PDDFInterface:InvariantCalcQmax
     2197        NVAR RamboTainerSubtractFlatBackground = root:Packages:Irena:PDDFInterface:RamboTainerSubtractFlatBackground
     2198        NVAR RamboTainerFlatBackground = root:Packages:Irena:PDDFInterface:RamboTainerFlatBackground
     2199        NVAR RamboTainerAutoSetBckg = root:Packages:Irena:PDDFInterface:RamboTainerAutoSetBckg
     2200        IRB1_PDDFRecalculareQmax()                              //this will set Qmax as needed...
     2201        //QstarVector = OriginalQvector / (erf(OriginalQvector*w_coef[1]/sqrt(6)))^3
     2202        //FitScatteringProfile =  w_coef[0]*exp(-OriginalQvector^2*w_coef[1]^2/3)+(w_coef[2]/QstarVector^w_coef[3]) + w_coef[4]
     2203        variable TempNumPoints=2000
     2204        NVAR RamboTainerMW=root:Packages:Irena:PDDFInterface:RamboTainerMW
     2205        NVAR PDDFUseNucleicAcid=root:Packages:Irena:PDDFInterface:PDDFUseNucleicAcid
     2206        NVAR PDDFUseProtein=root:Packages:Irena:PDDFInterface:PDDFUseProtein
     2207        NVAR ReciprocalSpaceI0=root:Packages:Irena:PDDFInterface:ReciprocalSpaceI0
     2208        NVAR ReciprocalSpaceRg=root:Packages:Irena:PDDFInterface:ReciprocalSpaceRg
     2209        NVAR ReciprocalSpaceB=root:Packages:Irena:PDDFInterface:ReciprocalSpaceB
     2210        NVAR ReciprocalSpacePorodSlope=root:Packages:Irena:PDDFInterface:ReciprocalSpacePorodSlope
     2211        if(ReciprocalSpaceRg<1 || ReciprocalSpacePorodSlope<1)
     2212                return 0
     2213        endif
     2214
     2215        Make/Free/N=(TempNumPoints) RamboTainerIntQ, RamboTainerQ, RamboTainerInt, RamboTainerQstar
     2216        variable Qmaxmeasured=OriginalQvector[numpnts(OriginalQvector)-3]
     2217        RamboTainerQ = p*(Qmaxmeasured/(numpnts(RamboTainerQ)-1))+0.00002                               //this creates Q wave between 0.00002 and qmax measured
     2218        RamboTainerQstar = RamboTainerQ / (erf(RamboTainerQ*ReciprocalSpaceRg/sqrt(6)))^3       
     2219        RamboTainerInt = ReciprocalSpaceI0*exp(-RamboTainerQ^2*ReciprocalSpaceRg^2/3)+(ReciprocalSpaceB/RamboTainerQstar^ReciprocalSpacePorodSlope)
     2220        variable QValueToChange         =       0.4*pi/ReciprocalSpaceRg
     2221        variable ChangeToRealIntP=BinarySearch(RamboTainerQ,QValueToChange)
     2222        RamboTainerInt[ChangeToRealIntP, ] = OriginalIntensity[BinarySearchInterp(OriginalQvector, RamboTainerQ[p])]
     2223        if(RamboTainerSubtractFlatBackground)
     2224                RamboTainerInt -= RamboTainerFlatBackground                                             //this subtract approximate background from the data.
     2225        endif
     2226        RamboTainerIntQ = RamboTainerInt*RamboTainerQ
     2227        //***                   Qmax for integration of Q*I(Q) is challenge...
     2228        variable IntgQIQ=areaXY(RamboTainerQ, RamboTainerIntQ, 0, InvariantCalcQmax )
     2229        //    now calculate I*Q vs Q to display in DataDisplay plot...
     2230        Duplicate/O RamboTainerInt, TotalScatteredInt, IntgQIntensity
     2231        Duplicate/O RamboTainerQ, TotalScatteredQ
     2232        TotalScatteredInt = RamboTainerInt*RamboTainerQ
     2233        multithread IntgQIntensity = areaXY(TotalScatteredQ, TotalScatteredInt, 0, TotalScatteredQ[p] )
     2234        IN2G_RemoveDataFromGraph(topGraphStr = "IRB1_PDDFInterfacePanel#PDFDisplay")
     2235        AppendToGraph /W=IRB1_PDDFInterfacePanel#PDFDisplay  TotalScatteredInt  vs TotalScatteredQ
     2236        AppendToGraph /W=IRB1_PDDFInterfacePanel#PDFDisplay/R  IntgQIntensity  vs TotalScatteredQ
     2237        ModifyGraph/W=IRB1_PDDFInterfacePanel#PDFDisplay  mirror(bottom)=1
     2238        ModifyGraph/W=IRB1_PDDFInterfacePanel#PDFDisplay lstyle(IntgQIntensity)=3,rgb(IntgQIntensity)=(0,0,65535)
     2239        //              SetAxis/W=IRB1_PDDFInterfacePanel#PDFDisplay/A/E=1 left
     2240
     2241        Label/W=IRB1_PDDFInterfacePanel#PDFDisplay left "Q * I(Q)"
     2242        Label/W=IRB1_PDDFInterfacePanel#PDFDisplay right "sum(Q * I(Q)) to Qmax"
     2243        Label/W=IRB1_PDDFInterfacePanel#PDFDisplay bottom "Q [1/A]"
     2244        variable RTVc           =       ReciprocalSpaceI0/IntgQIQ
     2245        variable RTQr           =       (RTVc)^2 / ReciprocalSpaceRg
     2246        if(PDDFUseProtein)
     2247                RamboTainerMW   =       (RTQr/0.1231)^1.0
     2248                RamboTainerMW   /=      1000                                            //convert to kDA from DA               
     2249        elseif(PDDFUseNucleicAcid)
     2250        //Update tag result...
     2251                RamboTainerMW   =       (RTQr/0.00934)^0.808
     2252                RamboTainerMW   /=      1000                                            //convert to kDA from DA               
     2253        endif
     2254
     2255end
     2256//**********************************************************************************************************
     2257//**********************************************************************************************************
     2258//**********************************************************************************************************
     2259//**********************************************************************************************************
     2260
     2261Function IRB1_PDDFFitRgAndG()
    20582262
    20592263        DFref oldDf= GetDataFolderDFR()
     
    20702274                AcsrPnt = tempV
    20712275        endif
    2072 
    2073         variable TempNumPoints=2000
     2276        //Fit Data to I(0) and Rg
     2277        //First fit is between cursors and without bacground, this is equivalent to linearization fit
    20742278        variable Rg
    20752279        Variable G
     
    21072311        NVAR ReciprocalSpaceI0=root:Packages:Irena:PDDFInterface:ReciprocalSpaceI0
    21082312        NVAR ReciprocalSpaceRg=root:Packages:Irena:PDDFInterface:ReciprocalSpaceRg
     2313        NVAR ReciprocalSpaceB=root:Packages:Irena:PDDFInterface:ReciprocalSpaceB
     2314        NVAR ReciprocalSpacePorodSlope=root:Packages:Irena:PDDFInterface:ReciprocalSpacePorodSlope
     2315       
    21092316        ReciprocalSpaceI0 = G
    21102317        ReciprocalSpaceRg = Rg
     2318        ReciprocalSpaceB = B
     2319        ReciprocalSpacePorodSlope = PorodSLope
    21112320        //calculate Intensity to display
    21122321        Duplicate/O OriginalIntensity, QstarVector, FitScatteringProfile
     
    21212330        endif
    21222331        SetAxis/W=IRB1_PDDFInterfacePanel#DataDisplay/A left
    2123         //set Dmax for the future...
    2124         //NVAR Dmax=root:Packages:Irena:PDDFInterface:DmaxEstimate
    2125         //Dmax=2.5*abs(W_coef[1])
    2126         //now method 1 how to calcualet MW:     
    2127         //calculate Molecular weight using SAXSMol2 method...
    2128         //now, calculate invariant.
    2129         //In this case we follow manuscript for SAXSMoW 2.0, DOI: 10.1002/pro.3528
    2130         //Vassili Piadov, Evandro Ares de Araújo, Mario Oliveira Neto,  Aldo Felix Craievich, and Igor Polikarpov
    2131         //PROTEIN SCIENCE 2019 | VOL 28:454–463
    2132         //use Model data below ~ 0.6*pi/Rg and real data above this as needed...
    2133         NVAR MWPorodInvariant=root:Packages:Irena:PDDFInterface:MWPorodInvariant
    2134         NVAR MWTrueVolumeA3=root:Packages:Irena:PDDFInterface:MWTrueVolumeA3
    2135         NVAR MWMassDensityProtein=root:Packages:Irena:PDDFInterface:MWMassDensityProtein                        //g/cm3, see line after formula 11
    2136         NVAR SAXSMoW2MWRecSpacekDa=root:Packages:Irena:PDDFInterface:SAXSMoW2MWRecSpacekDa
    2137         variable changeOverQmax = 8/Rg                                                                                                                                                  //formula 7
    2138         //alternative is to pick changeOverQmax based on Formula 8, so log(I(o)/I(gmax) ~ 2.25, formula 7 is easier, keep for now...
    2139         Make/Free/N=(TempNumPoints) InvariantIntWv, InvariantQWv, InvarQstar, InvarIntQ2
    2140         InvariantQWv            =       p*(changeOverQmax/(numpnts(InvariantQWv)-1))+0.00002                                    //this creates Q wave between 0.00002 and qmax
    2141         InvarQstar                      =       InvariantQWv / (erf(InvariantQWv*Rg/sqrt(6)))^3                                                 //Q* for Unified level
    2142         InvariantIntWv          =       G*exp(-InvariantQWv^2*Rg^2/3)+(B/InvarQstar^PorodSLope)                 //no background Unified intensity
    2143         //now we need to replace intensity from somethign around 0.6*pi/Rg with experimental intensity
    2144         variable QValueToChange         =       0.4*pi/Rg
    2145         variable ChangeToRealIntP       =       BinarySearch(InvariantQWv,QValueToChange )
    2146         InvariantIntWv[ChangeToRealIntP, ] = OriginalIntensity[BinarySearchInterp(OriginalQvector, InvariantQWv[p])]
    2147         //done, this shoudl now have attached tail of real data...
    2148         InvarIntQ2 = InvariantIntWv * InvariantQWv^2                                                                                    //I * Q^2
    2149         MWPorodInvariant = areaXY(InvariantQWv, InvarIntQ2)                                                                     //this is from Q=0 to Q=changeOverQmax
    2150         variable Vprime = 2*pi^2*G/MWPorodInvariant                                                                                             //this is formula 5
    2151         //setup the weird approximation of missing tail correction for invariant...
    2152         //this is formula 10
    2153         variable Aval = -2.114e6 * changeOverQmax^4 + 2.920e6 * changeOverQmax^3 - 1.472e6*changeOverQmax^2 + 3.349e5*changeOverQmax - 3.577e4
    2154         variable Bval = 12.09*changeOverQmax^3 - 9.39*changeOverQmax^2 + 3.03*changeOverQmax + 0.29
    2155         MWTrueVolumeA3  = Aval + Bval*Vprime                                                                                                            //this is in A^3
    2156         //formula 11
    2157         SAXSMoW2MWRecSpacekDa = MWMassDensityProtein*MWTrueVolumeA3* 1e-24      /1.662e-21                     
    2158         //this ends calculations for SAXSMoW2 ...
    2159         //***
    2160         //now method from Rambo-Tainer, doi:10.1038/nature12070, Nature 2013, vol. 496, pg 477
    2161         //Accurate assessment of mass, models and resolution by small-angle scattering
    2162         //here is what this does:
    2163         //1. Calculate Vc = I(0)/2*pi*Lc= I(0)/IntgQ*I(Q)dQ
    2164         //calculate Qr (really, do we really have to use Q in some many meanings???) Qr=Vc^2/Rg         [A^3]
    2165         //and now they plotted for Proteins and Nucelic acis separate dependnecies... Got approximately linar depency
    2166         // ln(Q) = a* ln(MW) + b
    2167         // protein MW= (Qr/0.1231)^1.0
    2168         //Nucelic acid MW= (Qr/0.00934)^0.808
    2169         //but first , we need to fit data with background also:
    2170         NVAR RamboTainerQmax8overRg = root:Packages:Irena:PDDFInterface:RamboTainerQmax8overRg
    2171         NVAR RamboTainerQmaxLog225 = root:Packages:Irena:PDDFInterface:RamboTainerQmaxLog225   
    2172         NVAR RamboTainerQmax = root:Packages:Irena:PDDFInterface:RamboTainerQmax
    2173         NVAR RamboTainerSubtractFlatBackground = root:Packages:Irena:PDDFInterface:RamboTainerSubtractFlatBackground
    2174         NVAR RamboTainerFlatBackground = root:Packages:Irena:PDDFInterface:RamboTainerFlatBackground
    2175         NVAR RamboTainerAutoSetBckg = root:Packages:Irena:PDDFInterface:RamboTainerAutoSetBckg
    2176         IRB1_PDDFRecalculareQmax()                              //this will set Qmax as needed...
     2332
     2333        //Second fit is from A cursor tomax Q and with bacground, this is For Rambo-Tainer to have background, if needed... 
    21772334        Make /N=5/O W_coef, LocalEwave
    21782335        Make/N=5/T/O T_Constraints
     
    22112368                ModifyGraph /W=IRB1_PDDFInterfacePanel#DataDisplay rgb(FitScatteringProfileBckg)=(3,52428,1)
    22122369        endif
     2370        NVAR RamboTainerAutoSetBckg=root:Packages:Irena:PDDFInterface:RamboTainerAutoSetBckg
     2371        NVAR RamboTainerFlatBackground=root:Packages:Irena:PDDFInterface:RamboTainerFlatBackground
    22132372        if(RamboTainerAutoSetBckg)
    22142373                RamboTainerFlatBackground = RTBackground
    22152374        endif
    2216         //QstarVector = OriginalQvector / (erf(OriginalQvector*w_coef[1]/sqrt(6)))^3
    2217         //FitScatteringProfile =  w_coef[0]*exp(-OriginalQvector^2*w_coef[1]^2/3)+(w_coef[2]/QstarVector^w_coef[3]) + w_coef[4]
    2218 
    2219         //now, fron this excersize we really need only the background...
    2220         NVAR RamboTainerMW=root:Packages:Irena:PDDFInterface:RamboTainerMW
    2221         NVAR PDDFUseNucleicAcid=root:Packages:Irena:PDDFInterface:PDDFUseNucleicAcid
    2222         NVAR PDDFUseProtein=root:Packages:Irena:PDDFInterface:PDDFUseProtein
    2223         Make/Free/N=(TempNumPoints) RamboTainerIntQ, RamboTainerQ, RamboTainerInt, RamboTainerQstar
    2224         variable Qmaxmeasured=OriginalQvector[numpnts(OriginalQvector)-3]
    2225         RamboTainerQ = p*(Qmaxmeasured/(numpnts(InvariantQWv)-1))+0.00002                               //this creates Q wave between 0.00002 and qmax measured
    2226         RamboTainerQstar = RamboTainerQ / (erf(RamboTainerQ*Rg/sqrt(6)))^3     
    2227         RamboTainerInt = G*exp(-RamboTainerQ^2*Rg^2/3)+(B/RamboTainerQstar^PorodSLope)
    2228         ChangeToRealIntP=BinarySearch(RamboTainerQ,QValueToChange )
    2229         RamboTainerInt[ChangeToRealIntP, ] = OriginalIntensity[BinarySearchInterp(OriginalQvector, RamboTainerQ[p])]
    2230         if(RamboTainerSubtractFlatBackground)
    2231                 RamboTainerInt -= RamboTainerFlatBackground                                             //this subtract approximate background from the data.
    2232         endif
    2233         RamboTainerIntQ = RamboTainerInt*RamboTainerQ
    2234         //***                   Qmax for integration of Q*I(Q) is challenge...
    2235         variable IntgQIQ=areaXY(RamboTainerQ, RamboTainerIntQ, 0, RamboTainerQmax )
    2236         //variable i
    2237         //for(i=0.1;i<1;i+=0.1)
    2238         //      print " Qmax = "+num2str(i)+" Intg(QI(Q) = "+num2str(areaXY(RamboTainerQ, RamboTainerIntQ, 0, i ))
    2239         //endfor
    2240         //    now calculate I*Q vs Q to display in DataDisplay plot...
    2241         Duplicate/O RamboTainerInt, TotalScatteredInt, IntgQIntensity
    2242         Duplicate/O RamboTainerQ, TotalScatteredQ
    2243         TotalScatteredInt = RamboTainerInt*RamboTainerQ
    2244         multithread IntgQIntensity = areaXY(TotalScatteredQ, TotalScatteredInt, 0, TotalScatteredQ[p] )
    2245         IN2G_RemoveDataFromGraph(topGraphStr = "IRB1_PDDFInterfacePanel#PDFDisplay")
    2246         AppendToGraph /W=IRB1_PDDFInterfacePanel#PDFDisplay  TotalScatteredInt  vs TotalScatteredQ
    2247         AppendToGraph /W=IRB1_PDDFInterfacePanel#PDFDisplay/R  IntgQIntensity  vs TotalScatteredQ
    2248         ModifyGraph/W=IRB1_PDDFInterfacePanel#PDFDisplay  mirror(bottom)=1
    2249         ModifyGraph/W=IRB1_PDDFInterfacePanel#PDFDisplay lstyle(IntgQIntensity)=3,rgb(IntgQIntensity)=(0,0,65535)
    2250         //              SetAxis/W=IRB1_PDDFInterfacePanel#PDFDisplay/A/E=1 left
    2251 
    2252         Label/W=IRB1_PDDFInterfacePanel#PDFDisplay left "Q * I(Q)"
    2253         Label/W=IRB1_PDDFInterfacePanel#PDFDisplay right "sum(Q * I(Q)) to Qmax"
    2254         Label/W=IRB1_PDDFInterfacePanel#PDFDisplay bottom "Q [1/A]"
    2255 
    2256        
    2257        
    2258         variable RTVc           =       ReciprocalSpaceI0/IntgQIQ
    2259         variable RTQr           =       (RTVc)^2 / ReciprocalSpaceRg
    2260         if(PDDFUseProtein)
    2261                 RamboTainerMW   =       (RTQr/0.1231)^1.0
    2262                 RamboTainerMW   /=      1000                                            //convert to kDA from DA               
    2263         elseif(PDDFUseNucleicAcid)
    2264         //Update tag result...
    2265                 RamboTainerMW   =       (RTQr/0.00934)^0.808
    2266                 RamboTainerMW   /=      1000                                            //convert to kDA from DA               
    2267         endif
    2268         string Tagtext="\\F"+IN2G_LkUpDfltStr("FontType")+"\\Z"+IN2G_LkUpDfltVar("TagSize")+"SAXSMoW2 Rg [A] = "+num2str(Rg)+"\r"
    2269         Tagtext+="\\F"+IN2G_LkUpDfltStr("FontType")+"\\Z"+IN2G_LkUpDfltVar("TagSize")+"I0 = "+num2str(G)
    2270         //Tagtext+="\\F"+IN2G_LkUpDfltStr("FontType")+"\\Z"+IN2G_LkUpDfltVar("TagSize")+"Protein Vol [cm3] = "+num2str(MWTrueVolumeA3)+"\r"
    2271         Tagtext+="\\F"+IN2G_LkUpDfltStr("FontType")+"\\Z"+IN2G_LkUpDfltVar("TagSize")+"     MW [kDa] = "+num2str(SAXSMoW2MWRecSpacekDa)
    2272         Tag/C/N=GuessRg/A=LT/L=0/TL=0/W=IRB1_PDDFInterfacePanel#DataDisplay FitScatteringProfile, numpnts(FitScatteringProfile)/10,Tagtext
     2375
     2376
    22732377       
    22742378        KillWaves/Z LocalEwave, W_coef, T_constraints, QstarVector
     
    26312735        KillPath/Z ATSASWorkPath
    26322736        //print "Delete following folder from your desktop : "+PathToATSASWorkPath
     2737        //update calculations...
     2738        IRB1_PDDFCalcSAXSMoW2()
    26332739        setDataFolder OldDf
    26342740end
     
    28002906                endif
    28012907                ModifyGraph/W=IRB1_PDDFInterfacePanel#PDFDisplay mirror=1
    2802                 SetAxis/W=IRB1_PDDFInterfacePanel#PDFDisplay/A/E=1 left
     2908                SetAxis/W=IRB1_PDDFInterfacePanel#PDFDisplay/A/E=0 left
    28032909        else
    28042910                DoAlert /T="Did not find GNOM data" 0, "Something went wrong, did not find PDDF data"
     
    28272933        NVAR UseIndra2Data=root:Packages:Irena:PDDFInterface:UseIndra2Data
    28282934        NVAR UseQRSdata=root:Packages:Irena:PDDFInterface:UseQRSdata
    2829         //zero old values
    2830         NVAR MWPorodInvariant = root:Packages:Irena:PDDFInterface:MWPorodInvariant
    2831         NVAR MWTrueVolumeA3 = root:Packages:Irena:PDDFInterface:MWTrueVolumeA3
    2832         NVAR MWMassDensityProtein = root:Packages:Irena:PDDFInterface:MWMassDensityProtein
    2833         NVAR SAXSMoW2MWRecSpacekDa = root:Packages:Irena:PDDFInterface:SAXSMoW2MWRecSpacekDa
    2834         NVAR ReciprocalSpaceI0 = root:Packages:Irena:PDDFInterface:ReciprocalSpaceI0
    2835         NVAR ReciprocalSpaceRg = root:Packages:Irena:PDDFInterface:ReciprocalSpaceRg
    2836         MWPorodInvariant = 0
    2837         MWTrueVolumeA3 = 0
    2838         SAXSMoW2MWRecSpacekDa = 0
    2839         ReciprocalSpaceI0 = 0
    2840         ReciprocalSpaceRg = 0
    2841        
    2842         NVAR CalcRg=root:Packages:Irena:PDDFInterface:RealSpaceRg
    2843         NVAR CalcI0=root:Packages:Irena:PDDFInterface:RealSpaceI0
    2844         NVAR ConcentrationForCals=root:Packages:Irena:PDDFInterface:ConcentrationForCals
    2845         NVAR ScattLengthDensDifference=root:Packages:Irena:PDDFInterface:ScattLengthDensDifference
    2846         NVAR PDDFCalculatedMW=root:Packages:Irena:PDDFInterface:PDDFCalculatedMW
    2847         NVAR GNOMAlfaResult = root:Packages:Irena:PDDFInterface:GNOMAlfaResult
    2848         CalcRg = 0
    2849         CalcI0 = 0
    2850         PDDFCalculatedMW = 0
    2851         GNOMAlfaResult = 0
    2852         //these are variables used by the control procedure
    2853         NVAR UseResults=  root:Packages:Irena:PDDFInterface:UseResults
    2854         NVAR UseUserDefinedData=  root:Packages:Irena:PDDFInterface:UseUserDefinedData
    2855         NVAR UseModelData = root:Packages:Irena:PDDFInterface:UseModelData
    2856         UseResults = 0
    2857         UseUserDefinedData = 0
    2858         UseModelData = 0
    2859         //delete GNOM out file, if exists...
    2860         Wave/Z GNOMOutFileTextWave = root:Packages:Irena:PDDFInterface:GNOMOutFileTextWave
    2861         KillWaves /Z GNOMOutFileTextWave
     2935        //zero old values to prevent stale.
     2936        IRB1_PDDFResetValuesToPreventStale      ()
    28622937        //get the names of waves, assume this tool actually works. May not under some conditions. In that case this tool will not work.
    28632938        IR3C_SelectWaveNamesData("Irena:PDDFInterface", FolderNameStr)                  //this routine will preset names in strings as needed,  DataFolderName = DataStartFolder+FolderNameStr
     
    29072982        NVAR DisplayErrorBars = root:Packages:Irena:PDDFInterface:DisplayErrorBars
    29082983        IN2G_ShowHideErrorBars(DisplayErrorBars, topGraphStr="IRB1_PDDFInterfacePanel#DataDisplay")
    2909         //and caluclate Dmax if user wants:
    2910         NVAR CalcDmax = root:Packages:Irena:PDDFInterface:CalculateDmaxEstOnImport
    2911         if(CalcDmax)
    2912                 IRB1_PDDFFitAndCalculateMW()   
    2913         endif
    29142984       
    29152985       
     
    30113081        ListOfVariables += "DmaxEstimate;CalculateDmaxEstOnImport;GnomForceRmin0;GnomForceRmax0;NumBinsInR;GnomAlfaValue;"     
    30123082        ListOfVariables += "MooreNumFunctions;MooreDetNumFunctions;MooreFitMaxSize;"   
    3013         ListOfVariables += "RealSpaceRg;RealSpaceI0;ConcentrationForCals;ScattLengthDensDifference;PDDFCalculatedMW;"   
    3014         ListOfVariables += "RamboTainerMW;RamboTainerQmax8overRg;RamboTainerQmax;RamboTainerQmaxLog225;"
     3083        ListOfVariables += "RealSpaceRg;RealSpaceI0;ConcentrationForCals;ScattLengthDensDifference;PDDFCalculatedMW;RealSpacePorodVolumeA3;"   
     3084        ListOfVariables += "RamboTainerMW;InvariantCalcQmax8overRg;InvariantCalcQmax;InvariantCalcQmaxLog225;"
    30153085        ListOfVariables += "RamboTainerSubtractFlatBackground;RamboTainerFlatBackground;RamboTainerAutoSetBckg;"
    30163086        ListOfVariables += "SaveToFolder;SaveToNotebook;SaveToWaves;SaveToGNOMOut;"     
    3017         ListOfVariables += "MWPorodInvariant;MWTrueVolumeA3;MWMassDensityProtein;SAXSMoW2MWRecSpacekDa;SAXSMoW2MWRealSpacekDa;"
    3018         ListOfVariables += "GNOMAlfaResult;ReciprocalSpaceI0;ReciprocalSpaceRg;PDDFUseProtein;PDDFUseNucleicAcid;"
     3087        ListOfVariables += "MWPorodInvariant;ReciprocalPorodVolumeA3;MWMassDensityProtein;SAXSMoW2MWRecSpacekDa;SAXSMoW2MWRealSpacekDa;"       
     3088        ListOfVariables += "GNOMAlfaResult;ReciprocalSpaceI0;ReciprocalSpaceRg;PDDFUseProtein;PDDFUseNucleicAcid;ReciprocalSpaceB;ReciprocalSpacePorodSlope;"
    30193089
    30203090                //and here we create them
     
    30603130        NVAR ConcentrationForCals
    30613131        if(ConcentrationForCals<0.0001)
    3062                 GnomAlfaValue=1
     3132                ConcentrationForCals=1
    30633133        endif
    30643134        NVAR MooreNumFunctions
     
    30773147                PDDFUseNucleicAcid = 0
    30783148        endif
    3079         IRB1_SetDensitySLD()   
    3080         IRB1_ResetValuesToPreventStale()
     3149        IRB1_PDDFSetDensitySLD()       
     3150        IRB1_PDDFResetValuesToPreventStale()
    30813151       
    30823152        NVAR SaveToFolder
     
    30923162end
    30933163//**********************************************************************************************************
    3094 static Function IRB1_ResetValuesToPreventStale()
    3095 
     3164static Function IRB1_PDDFResetValuesToPreventStale()
     3165        //zero old values to prevent stale.
     3166        DFRef OldDF=GetDataFolderDFR()
     3167        setDataFolder root:Packages:Irena:PDDFInterface
     3168       
    30963169        NVAR MWPorodInvariant = root:Packages:Irena:PDDFInterface:MWPorodInvariant
    3097         NVAR MWTrueVolumeA3 = root:Packages:Irena:PDDFInterface:MWTrueVolumeA3
     3170        NVAR ReciprocalPorodVolumeA3 = root:Packages:Irena:PDDFInterface:ReciprocalPorodVolumeA3
    30983171        NVAR MWMassDensityProtein = root:Packages:Irena:PDDFInterface:MWMassDensityProtein
    30993172        NVAR SAXSMoW2MWRecSpacekDa = root:Packages:Irena:PDDFInterface:SAXSMoW2MWRecSpacekDa
    3100         NVAR ReciprocalSpaceI0 = root:Packages:Irena:PDDFInterface:ReciprocalSpaceI0
    3101         NVAR ReciprocalSpaceRg = root:Packages:Irena:PDDFInterface:ReciprocalSpaceRg
     3173        NVAR ReciprocalSpaceI0=root:Packages:Irena:PDDFInterface:ReciprocalSpaceI0
     3174        NVAR ReciprocalSpaceRg=root:Packages:Irena:PDDFInterface:ReciprocalSpaceRg
     3175        NVAR ReciprocalSpaceB=root:Packages:Irena:PDDFInterface:ReciprocalSpaceB
     3176        NVAR ReciprocalSpacePorodSlope=root:Packages:Irena:PDDFInterface:ReciprocalSpacePorodSlope
    31023177        NVAR RealSpaceRg = root:Packages:Irena:PDDFInterface:RealSpaceRg
    31033178        NVAR RealSpaceI0 = root:Packages:Irena:PDDFInterface:RealSpaceI0
     
    31053180        NVAR GNOMAlfaResult=root:Packages:Irena:PDDFInterface:GNOMAlfaResult
    31063181        NVAR RamboTainerMW = root:Packages:Irena:PDDFInterface:RamboTainerMW
    3107 
     3182        NVAR CalcRg=root:Packages:Irena:PDDFInterface:RealSpaceRg
     3183        NVAR CalcI0=root:Packages:Irena:PDDFInterface:RealSpaceI0
     3184        NVAR ConcentrationForCals=root:Packages:Irena:PDDFInterface:ConcentrationForCals
     3185        NVAR ScattLengthDensDifference=root:Packages:Irena:PDDFInterface:ScattLengthDensDifference
     3186        NVAR PDDFCalculatedMW=root:Packages:Irena:PDDFInterface:PDDFCalculatedMW
     3187        NVAR GNOMAlfaResult = root:Packages:Irena:PDDFInterface:GNOMAlfaResult
     3188        NVAR SAXSMoW2MWRealSpacekDa = root:Packages:Irena:PDDFInterface:SAXSMoW2MWRealSpacekDa
     3189        NVAR RealSpacePorodVolumeA3=root:Packages:Irena:PDDFInterface:RealSpacePorodVolumeA3
     3190        //these are variables used by the control procedure
     3191        NVAR UseResults=  root:Packages:Irena:PDDFInterface:UseResults
     3192        NVAR UseUserDefinedData=  root:Packages:Irena:PDDFInterface:UseUserDefinedData
     3193        NVAR UseModelData = root:Packages:Irena:PDDFInterface:UseModelData
     3194        SAXSMoW2MWRealSpacekDa = 0
     3195        RealSpacePorodVolumeA3 = 0
     3196        UseResults = 0
     3197        UseUserDefinedData = 0
     3198        UseModelData = 0
     3199        //delete GNOM out file, if exists...
     3200        //Wave/Z GNOMOutFileTextWave = root:Packages:Irena:PDDFInterface:GNOMOutFileTextWave
     3201        KillWaves /Z GNOMOutFileTextWave
     3202        CalcRg = 0
     3203        CalcI0 = 0
     3204        PDDFCalculatedMW = 0
     3205        GNOMAlfaResult = 0
     3206        //delete old waves
     3207        KillWaves/Z pddfInputQVector, pddfInputIntensity, pddfInputError, pddfModelQvector, PDDFModelIntensity, pddfRadius, pddfPr, pddfPrError, pddfQvecExtrap, pddfModelIntExtrap
     3208        //zero parameetrs
     3209        MWPorodInvariant = 0
     3210        ReciprocalPorodVolumeA3 = 0
     3211        SAXSMoW2MWRecSpacekDa = 0
     3212        ReciprocalSpaceI0 = 0
     3213        ReciprocalSpaceRg = 0
     3214        ReciprocalSpaceB = 0
     3215        ReciprocalSpacePorodSlope = 0
    31083216        RamboTainerMW = 0
    31093217        MWPorodInvariant = 0
    3110         MWTrueVolumeA3 = 0
     3218        ReciprocalPorodVolumeA3 = 0
    31113219        SAXSMoW2MWRecSpacekDa = 0
    31123220        ReciprocalSpaceI0 = 0
     
    31163224        PDDFCalculatedMW=0
    31173225        GNOMAlfaResult = 0
    3118 end
    3119 //**********************************************************************************************************
    3120 
    3121 static Function IRB1_SetDensitySLD()
     3226        setDataFolder OldDF
     3227end
     3228//**********************************************************************************************************
     3229
     3230static Function IRB1_PDDFSetDensitySLD()
    31223231
    31233232        NVAR PDDFUseProtein             =root:Packages:Irena:PDDFInterface:PDDFUseProtein
     
    31663275
    31673276        NVAR MWPorodInvariant = root:Packages:Irena:PDDFInterface:MWPorodInvariant
    3168         NVAR MWTrueVolumeA3 = root:Packages:Irena:PDDFInterface:MWTrueVolumeA3
     3277        NVAR ReciprocalPorodVolumeA3 = root:Packages:Irena:PDDFInterface:ReciprocalPorodVolumeA3
    31693278        NVAR MWMassDensityProtein = root:Packages:Irena:PDDFInterface:MWMassDensityProtein
    31703279        NVAR SAXSMoW2MWRecSpacekDa = root:Packages:Irena:PDDFInterface:SAXSMoW2MWRecSpacekDa
     
    32073316
    32083317        IR1_AppendAnyText("\rPorod MW [kDa] = \t"+num2str(SAXSMoW2MWRecSpacekDa),0)     
    3209         IR1_AppendAnyText("Porod Volume [cm3] = \t"+num2str(MWTrueVolumeA3),0) 
     3318        IR1_AppendAnyText("Porod Volume [cm3] = \t"+num2str(ReciprocalPorodVolumeA3),0)
    32103319        IR1_AppendAnyText("Porod Density prot [g/cm3] = \t"+num2str(MWMassDensityProtein),0)   
    32113320        IR1_AppendAnyText("\rGNOM resulting alfa = \t"+num2str(GNOMAlfaResult),0)       
     
    32543363
    32553364        NVAR MWPorodInvariant = root:Packages:Irena:PDDFInterface:MWPorodInvariant
    3256         NVAR MWTrueVolumeA3 = root:Packages:Irena:PDDFInterface:MWTrueVolumeA3
     3365        NVAR ReciprocalPorodVolumeA3 = root:Packages:Irena:PDDFInterface:ReciprocalPorodVolumeA3
    32573366        NVAR MWMassDensityProtein = root:Packages:Irena:PDDFInterface:MWMassDensityProtein
    32583367        NVAR SAXSMoW2MWRecSpacekDa = root:Packages:Irena:PDDFInterface:SAXSMoW2MWRecSpacekDa
     
    32983407        PDDF_SLD[curlength] = ScattLengthDensDifference
    32993408        PorodInvariant[curlength] = MWPorodInvariant
    3300         PorodTrueVolume[curlength] = MWTrueVolumeA3
     3409        PorodTrueVolume[curlength] = ReciprocalPorodVolumeA3
    33013410        MassDensityProtein[curlength] = MWMassDensityProtein
    33023411        InvariantPDDFCalculatedMW[curlength] = SAXSMoW2MWRecSpacekDa
     
    33793488        //additional Porod results...
    33803489        NVAR MWPorodInvariant = root:Packages:Irena:PDDFInterface:MWPorodInvariant
    3381         NVAR MWTrueVolumeA3 = root:Packages:Irena:PDDFInterface:MWTrueVolumeA3
     3490        NVAR ReciprocalPorodVolumeA3 = root:Packages:Irena:PDDFInterface:ReciprocalPorodVolumeA3
    33823491        NVAR MWMassDensityProtein = root:Packages:Irena:PDDFInterface:MWMassDensityProtein
    33833492        NVAR SAXSMoW2MWRecSpacekDa = root:Packages:Irena:PDDFInterface:SAXSMoW2MWRecSpacekDa
     
    34163525        ResultsComment="PorodMW="+num2str(SAXSMoW2MWRecSpacekDa)+";"
    34173526        ResultsComment="PorodInvariant="+num2str(MWPorodInvariant)+";"
    3418         ResultsComment="PorodVolume="+num2str(MWTrueVolumeA3)+";"
     3527        ResultsComment="PorodVolume="+num2str(ReciprocalPorodVolumeA3)+";"
    34193528        ResultsComment="PorodMassDensityProtein="+num2str(MWMassDensityProtein)+";"
    34203529        String NewWaveNote="PDDF analysis;"+date()+";"+time()+ResultsComment
Note: See TracChangeset for help on using the changeset viewer.