Re: Dispersion Back Calculation

2016-11-15 Thread Jeremy Anderson
That is extremely useful information, thanks!

Jeremy Anderson



Ph.D. Candidate

Johns Hopkins University
Program in Molecular Biophysics
Laboratory of Dr. Vincent J. Hilser, Ph.D.
3400 N Charles St, 104 Mudd Hall
Baltimore, MD 21218

(Lab) *410-516-6757*
(Cell) 715-613-0274


On Tue, Nov 15, 2016 at 8:49 AM, Edward d'Auvergne 
wrote:

> On 15 November 2016 at 14:33, Jeremy Anderson  wrote:
> > Hi Edward,
> >
> > Thanks for the follow up.  I totally understand the reasons for not
> having
> > fixed values within a relax analysis, it seems like a special case
> relative
> > to what I've seen in the literature and increases ones ability to skew
> the
> > results to their liking, I'm doing my best to safeguard against that
> myself.
>
> No problems.  You do have to be quite careful, as it is far too easy
> to fall into an alternative reality that can nicely explain some of
> the biology.  Mapping the optimisation space is an essential tool when
> constraining certain parameters to see if you are at a well defined
> minimum.  For example it can show you if you've just chopped across a
> valley in the space and the optimiser is landing at the bottom of that
> valley where it has been cut.  If you have access to the ancient, yet
> very powerful OpenDX software, you can use the dx.map and dx.execute
> relax user functions for this.
>
>
> > I was able to implement such an analysis in python using the RD models
> from
> > relax as well as the scipy and lmfit packages to both hold the dw
> parameters
> > constant while performing the usual grid search then nonlinear least
> squares
> > minimization and perform a cluster analysis holding the rate constant
> and/or
> > the major population constant amongst all residues.  The code is a bit
> of a
> > mess at the moment but I'm hoping to clean it up and make a repository on
> > github, so I can better document what I did and so other folks can check
> it
> > out if they want.
>
> Note that I originally looked at the scipy optimisation packages for
> relax.  However I found fatal bugs in all three of the algorithms
> implemented at the time (Levenberg-Marquardt being one of them).  The
> algorithms appeared to minimise the results, but they were nothing
> like what Art Palmer's Modelfree4 found.  I was comparing relax to
> Modelfree4 for debugging at the time when implementing the model-free
> analysis component.  I don't know if anything has changed since then,
> but you really need to be wary and double check whenever you use any
> part of scipy.  Anyway, because scipy's optimisation was so terrible,
> I decided to write the minfx optimisation library
> (https://gna.org/projects/minfx/).  You'll see a record of all of this
> in my publication history ;)
>
>
> > Thanks for your assistance.
>
> You're welcome!
>
> Regards,
>
> Edward
>
___
relax (http://www.nmr-relax.com)

This is the relax-users mailing list
relax-users@gna.org

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-users


Re: Dispersion Back Calculation

2016-11-15 Thread Edward d'Auvergne
On 15 November 2016 at 14:33, Jeremy Anderson  wrote:
> Hi Edward,
>
> Thanks for the follow up.  I totally understand the reasons for not having
> fixed values within a relax analysis, it seems like a special case relative
> to what I've seen in the literature and increases ones ability to skew the
> results to their liking, I'm doing my best to safeguard against that myself.

No problems.  You do have to be quite careful, as it is far too easy
to fall into an alternative reality that can nicely explain some of
the biology.  Mapping the optimisation space is an essential tool when
constraining certain parameters to see if you are at a well defined
minimum.  For example it can show you if you've just chopped across a
valley in the space and the optimiser is landing at the bottom of that
valley where it has been cut.  If you have access to the ancient, yet
very powerful OpenDX software, you can use the dx.map and dx.execute
relax user functions for this.


> I was able to implement such an analysis in python using the RD models from
> relax as well as the scipy and lmfit packages to both hold the dw parameters
> constant while performing the usual grid search then nonlinear least squares
> minimization and perform a cluster analysis holding the rate constant and/or
> the major population constant amongst all residues.  The code is a bit of a
> mess at the moment but I'm hoping to clean it up and make a repository on
> github, so I can better document what I did and so other folks can check it
> out if they want.

Note that I originally looked at the scipy optimisation packages for
relax.  However I found fatal bugs in all three of the algorithms
implemented at the time (Levenberg-Marquardt being one of them).  The
algorithms appeared to minimise the results, but they were nothing
like what Art Palmer's Modelfree4 found.  I was comparing relax to
Modelfree4 for debugging at the time when implementing the model-free
analysis component.  I don't know if anything has changed since then,
but you really need to be wary and double check whenever you use any
part of scipy.  Anyway, because scipy's optimisation was so terrible,
I decided to write the minfx optimisation library
(https://gna.org/projects/minfx/).  You'll see a record of all of this
in my publication history ;)


> Thanks for your assistance.

You're welcome!

Regards,

Edward

___
relax (http://www.nmr-relax.com)

This is the relax-users mailing list
relax-users@gna.org

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-users


Re: Dispersion Back Calculation

2016-11-15 Thread Jeremy Anderson
Hi Edward,

Thanks for the follow up.  I totally understand the reasons for not having
fixed values within a relax analysis, it seems like a special case relative
to what I've seen in the literature and increases ones ability to skew the
results to their liking, I'm doing my best to safeguard against that
myself.

I was able to implement such an analysis in python using the RD models from
relax as well as the scipy and lmfit packages to both hold the dw
parameters constant while performing the usual grid search then nonlinear
least squares minimization and perform a cluster analysis holding the rate
constant and/or the major population constant amongst all residues.  The
code is a bit of a mess at the moment but I'm hoping to clean it up and
make a repository on github, so I can better document what I did and so
other folks can check it out if they want.

Thanks for your assistance.

Jeremy Anderson



Ph.D. Candidate

Johns Hopkins University
Program in Molecular Biophysics
Laboratory of Dr. Vincent J. Hilser, Ph.D.
3400 N Charles St, 104 Mudd Hall
Baltimore, MD 21218

(Lab) *410-516-6757*
(Cell) 715-613-0274


On Fri, Nov 11, 2016 at 5:07 AM, Edward d'Auvergne 
wrote:

> On 27 October 2016 at 18:10, Jeremy Anderson  wrote:
> > Hi Edward and Troels,
> >
> > Thanks for pointing me in the right direction.  I had dug around a bit in
> > the test_suite directory but wanted to make sure I was looking in the
> right
> > place before I descended into the rabbit hole.
> >
> > I got the back calculation to work using the
> > ./test_suite/shared_data/dispersion/ns_mmq_3site_
> linear/relax_results/solution.py
> > script pretty much as-is, just changing the spin parameters to my liking,
> > calculating the curve, and outputting the values (ignoring the data and
> > residuals in the output file).
> >
> > Something I didn't mention is that the reason I've been importing the
> models
> > into ipython is so I can hold parameters constant through my own grid
> search
> > and minimization functions, which I had found somewhere in the
> documentation
> > was not possible inside relax for the minimization.  I originally thought
> > this would be easier outside of relax.
> >
> > The reason for this is because I'm in a situation where I can observe
> HSQC
> > peaks in slow exchange in one variant and skewed populations of one or
> the
> > other peaks in two other variants.  I've been working on using the
> > complementary information, in this case the observed dw and the kex from
> ZZ
> > exchange experiments, to investigate multi-state exchange in all
> variants.
> >
> > The chem. shift differences of the two skewed variants match the measured
> > nicely but the rates from CPMG are ~20 fold higher.  Therefore I wanted
> to
> > check and see if a 3-state model with some parameters held constant would
> > have infinite solutions (my assumption) or pop out something interesting
> and
> > be able to distinguish between a couple models of the conformational
> process
> > that I have in mind, which seems like a long shot.
> >
> > Sorry if thats too much information/way too open-ended but I figured I
> would
> > give some context to the greater situation I have found myself in.
> Thanks
> > again!
>
> Hi Jeremy,
>
> It is true that you cannot fix a parameter in relax and optimise the
> others.  The reason is two-fold.  Firstly the minfx library (
> https://gna.org/projects/minfx/ ) does support this functionality.
> Secondly, this functionality would be highly abused and a lot of
> rubbish results will appear in the scientific literature, with a
> detrimental effect on the reputation of the whole NMR field.
>
> Also, I didn't think it was worth the time investment compared to
> expanding relax to handle multiple data types at the same time, and
> then optimising one set of parameters for all experimental data
> simultaneously.  In your case, that would be loading the ZZ exchange
> and CPMG data at the same time, and optimising the single model.  This
> would be interesting, as the two experiment types contain both
> complementary and overlapping information content.  So saying that the
> overlapping content should only come from the ZZ experiment might
> over-constrain the CPMG experiment due to any biases or experimental
> noise from that experiment.  Are you able to set up the problem in
> this alternative way in iPython?
>
> Regards,
>
> Edward
>
___
relax (http://www.nmr-relax.com)

This is the relax-users mailing list
relax-users@gna.org

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-users


Re: Dispersion Back Calculation

2016-11-11 Thread Edward d'Auvergne
On 27 October 2016 at 18:10, Jeremy Anderson  wrote:
> Hi Edward and Troels,
>
> Thanks for pointing me in the right direction.  I had dug around a bit in
> the test_suite directory but wanted to make sure I was looking in the right
> place before I descended into the rabbit hole.
>
> I got the back calculation to work using the
> ./test_suite/shared_data/dispersion/ns_mmq_3site_linear/relax_results/solution.py
> script pretty much as-is, just changing the spin parameters to my liking,
> calculating the curve, and outputting the values (ignoring the data and
> residuals in the output file).
>
> Something I didn't mention is that the reason I've been importing the models
> into ipython is so I can hold parameters constant through my own grid search
> and minimization functions, which I had found somewhere in the documentation
> was not possible inside relax for the minimization.  I originally thought
> this would be easier outside of relax.
>
> The reason for this is because I'm in a situation where I can observe HSQC
> peaks in slow exchange in one variant and skewed populations of one or the
> other peaks in two other variants.  I've been working on using the
> complementary information, in this case the observed dw and the kex from ZZ
> exchange experiments, to investigate multi-state exchange in all variants.
>
> The chem. shift differences of the two skewed variants match the measured
> nicely but the rates from CPMG are ~20 fold higher.  Therefore I wanted to
> check and see if a 3-state model with some parameters held constant would
> have infinite solutions (my assumption) or pop out something interesting and
> be able to distinguish between a couple models of the conformational process
> that I have in mind, which seems like a long shot.
>
> Sorry if thats too much information/way too open-ended but I figured I would
> give some context to the greater situation I have found myself in.  Thanks
> again!

Hi Jeremy,

It is true that you cannot fix a parameter in relax and optimise the
others.  The reason is two-fold.  Firstly the minfx library (
https://gna.org/projects/minfx/ ) does support this functionality.
Secondly, this functionality would be highly abused and a lot of
rubbish results will appear in the scientific literature, with a
detrimental effect on the reputation of the whole NMR field.

Also, I didn't think it was worth the time investment compared to
expanding relax to handle multiple data types at the same time, and
then optimising one set of parameters for all experimental data
simultaneously.  In your case, that would be loading the ZZ exchange
and CPMG data at the same time, and optimising the single model.  This
would be interesting, as the two experiment types contain both
complementary and overlapping information content.  So saying that the
overlapping content should only come from the ZZ experiment might
over-constrain the CPMG experiment due to any biases or experimental
noise from that experiment.  Are you able to set up the problem in
this alternative way in iPython?

Regards,

Edward

___
relax (http://www.nmr-relax.com)

This is the relax-users mailing list
relax-users@gna.org

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-users


Re: Dispersion Back Calculation

2016-10-27 Thread Jeremy Anderson
Hi Edward and Troels,

Thanks for pointing me in the right direction.  I had dug around a bit in
the test_suite directory but wanted to make sure I was looking in the right
place before I descended into the rabbit hole.

I got the back calculation to work using the
./test_suite/shared_data/dispersion/ns_mmq_3site_
linear/relax_results/solution.py
script pretty much as-is, just changing the spin parameters to my liking,
calculating the curve, and outputting the values (ignoring the data and
residuals in the output file).

Something I didn't mention is that the reason I've been importing the
models into ipython is so I can hold parameters constant through my own
grid search and minimization functions, which I had found somewhere in the
documentation was not possible inside relax for the minimization.  I
originally thought this would be easier outside of relax.

The reason for this is because I'm in a situation where I can observe HSQC
peaks in slow exchange in one variant and skewed populations of one or the
other peaks in two other variants.  I've been working on using the
complementary information, in this case the observed dw and the kex from ZZ
exchange experiments, to investigate multi-state exchange in all variants.

The chem. shift differences of the two skewed variants match the measured
nicely but the rates from CPMG are ~20 fold higher.  Therefore I wanted to
check and see if a 3-state model with some parameters held constant would
have infinite solutions (my assumption) or pop out something interesting
and be able to distinguish between a couple models of the conformational
process that I have in mind, which seems like a long shot.

Sorry if thats too much information/way too open-ended but I figured I
would give some context to the greater situation I have found myself in.
Thanks again!

Jeremy Anderson



Ph.D. Candidate

Johns Hopkins University
Program in Molecular Biophysics
Laboratory of Dr. Vincent J. Hilser, Ph.D.
3400 N Charles St, 104 Mudd Hall
Baltimore, MD 21218

(Lab) *410-516-6757*
(Cell) 715-613-0274


On Thu, Oct 27, 2016 at 4:29 AM, Edward d'Auvergne 
wrote:

> On 21 October 2016 at 00:14, Jeremy Anderson  wrote:
> > Hello,
> >
> > I've been trying to back calculate data from parameters using the NS MMQ
> > 3-site linear model.  I've tried to do something akin to the
> > sample_scripts/model_free/generate_ri.py sample script as described in
> the
> > mail-archive  html>.
> > I'm afraid that I'm not knowledgable enough about the data structures,
> > parameters, and functions of relax.
> >
> > Up to this point I have been simulating data using the CR72 and TSMFK01
> > dispersion models by importing the R2eff functionality of each module
> into
> > an ipython notebook and supplying parameters interactively.  I've
> attempted
> > this with the NS MMQ 3-site linear model however I'm getting lost in the
> > structures of the input parameters.
> >
> > Ideally what I would like to be able to do is input the parameters:
> >
> >
> > pA, pB, pC = .8, .15, .05
> >
> > R20A, R20B, R20C = 10, 15, 20 (s^-1)
> >
> > dw_AB, dw_BC = 2, 2 (ppm)
> >
> > kex_AB, kex_BC, kex_AC = 400, 200, 0 (s^-1)
> >
> > dwH_AB, dwH_BC = .2, .2 (ppm)
> >
> >
> > into the r2eff_ns_mmq_3site_mq and/or r2eff_ns_mmq_3site_sq_dq_zq
> functions
> > of the ns_mmq_3site module and populate a back_calc array with R2eff
> > values for nu_cpmg = np.logspace(1, 3, 20).  I've done the same with the
> > 2-site models I mentioned above but I feel I'm a bit over my head here.
> >
> > Any help would be greatly appreciated and thanks in advance *and* bravo
> for
> > all the work on relax, its great!
>
> Hi Jeremy,
>
> Welcome to the relax mailing lists!  I was wondering if you were able
> to work out what to do from Troels' comment?  He has written a lot of
> such data back-calculation scripts which can be found in the
> test_suite directories, and if you look for scripts and data in there,
> you should hopefully be able to see what to do.  As for all the work,
> this is a community project with many contributors:
>
> http://gna.org/project/memberlist.php?group=relax
>
> For example Troels has put a lot of work into the relaxation
> dispersion analysis, adding many models and making this part super
> fast:
>
> http://wiki.nmr-relax.com/Relax_release_descriptions#relax_3.3.0
>
> Hopefully you'll be able to use relax for your purposes and, if not,
> maybe you'll be able to expand relax and contribute a little yourself
> ;)
>
> Regards,
>
> Edward
>
___
relax (http://www.nmr-relax.com)

This is the relax-users mailing list
relax-users@gna.org

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-users


Re: Dispersion Back Calculation

2016-10-27 Thread Edward d'Auvergne
On 21 October 2016 at 00:14, Jeremy Anderson  wrote:
> Hello,
>
> I've been trying to back calculate data from parameters using the NS MMQ
> 3-site linear model.  I've tried to do something akin to the
> sample_scripts/model_free/generate_ri.py sample script as described in the
> mail-archive .
> I'm afraid that I'm not knowledgable enough about the data structures,
> parameters, and functions of relax.
>
> Up to this point I have been simulating data using the CR72 and TSMFK01
> dispersion models by importing the R2eff functionality of each module into
> an ipython notebook and supplying parameters interactively.  I've attempted
> this with the NS MMQ 3-site linear model however I'm getting lost in the
> structures of the input parameters.
>
> Ideally what I would like to be able to do is input the parameters:
>
>
> pA, pB, pC = .8, .15, .05
>
> R20A, R20B, R20C = 10, 15, 20 (s^-1)
>
> dw_AB, dw_BC = 2, 2 (ppm)
>
> kex_AB, kex_BC, kex_AC = 400, 200, 0 (s^-1)
>
> dwH_AB, dwH_BC = .2, .2 (ppm)
>
>
> into the r2eff_ns_mmq_3site_mq and/or r2eff_ns_mmq_3site_sq_dq_zq functions
> of the ns_mmq_3site module and populate a back_calc array with R2eff
> values for nu_cpmg = np.logspace(1, 3, 20).  I've done the same with the
> 2-site models I mentioned above but I feel I'm a bit over my head here.
>
> Any help would be greatly appreciated and thanks in advance *and* bravo for
> all the work on relax, its great!

Hi Jeremy,

Welcome to the relax mailing lists!  I was wondering if you were able
to work out what to do from Troels' comment?  He has written a lot of
such data back-calculation scripts which can be found in the
test_suite directories, and if you look for scripts and data in there,
you should hopefully be able to see what to do.  As for all the work,
this is a community project with many contributors:

http://gna.org/project/memberlist.php?group=relax

For example Troels has put a lot of work into the relaxation
dispersion analysis, adding many models and making this part super
fast:

http://wiki.nmr-relax.com/Relax_release_descriptions#relax_3.3.0

Hopefully you'll be able to use relax for your purposes and, if not,
maybe you'll be able to expand relax and contribute a little yourself
;)

Regards,

Edward

___
relax (http://www.nmr-relax.com)

This is the relax-users mailing list
relax-users@gna.org

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-users


Re: Dispersion Back Calculation

2016-10-22 Thread Troels Schwarz-Linnet
Hi Johns.

Look into ./test_suite/system_test/relax_disp.py

And through there find the corresponding system tests and then the data
files there, to get the structure.

For making a create data point script, that create data files upon
parameters, maybe randomize something, and then read the datafiles to read,
fit and then fit the parameters back. This is possible. I have done it
before, and in relax there is a template for 2site CPMG. But I havent done
it before 3state.

But have a look on the datastructures first.
Relax it's not geared for this kind of magic.

It's requires some knowledge first to tweak the system.

If this is something you will use repeadtly, please suggest a function that
we could create behind the scenes.


This could be of interest of interest for other scientist. ;)



Den fredag den 21. oktober 2016 skrev Jeremy Anderson :

> Hello,
>
> I've been trying to back calculate data from parameters using the NS MMQ
> 3-site linear model.  I've tried to do something akin to the
> sample_scripts/model_free/generate_ri.py sample script as described in the
> mail-archive  html>.
> I'm afraid that I'm not knowledgable enough about the data structures,
> parameters, and functions of relax.
>
> Up to this point I have been simulating data using the CR72 and TSMFK01
> dispersion models by importing the R2eff functionality of each module into
> an ipython notebook and supplying parameters interactively.  I've attempted
> this with the NS MMQ 3-site linear model however I'm getting lost in the
> structures of the input parameters.
>
> Ideally what I would like to be able to do is input the parameters:
>
>
> pA, pB, pC = .8, .15, .05
>
> R20A, R20B, R20C = 10, 15, 20 (s^-1)
>
> dw_AB, dw_BC = 2, 2 (ppm)
>
> kex_AB, kex_BC, kex_AC = 400, 200, 0 (s^-1)
>
> dwH_AB, dwH_BC = .2, .2 (ppm)
>
>
> into the r2eff_ns_mmq_3site_mq and/or r2eff_ns_mmq_3site_sq_dq_zq functions
> of the ns_mmq_3site module and populate a back_calc array with R2eff
> values for nu_cpmg = np.logspace(1, 3, 20).  I've done the same with the
> 2-site models I mentioned above but I feel I'm a bit over my head here.
>
> Any help would be greatly appreciated and thanks in advance *and* bravo for
> all the work on relax, its great!
>
> Jeremy Anderson
>
>
>
> Ph.D. Candidate
>
> Johns Hopkins University
> Program in Molecular Biophysics
> Laboratory of Dr. Vincent J. Hilser, Ph.D.
> 3400 N Charles St, 104 Mudd Hall
> Baltimore, MD 21218
>
> (Lab) *410-516-6757*
> ___
> relax (http://www.nmr-relax.com)
>
> This is the relax-users mailing list
> relax-users@gna.org 
>
> To unsubscribe from this list, get a password
> reminder, or change your subscription options,
> visit the list information page at
> https://mail.gna.org/listinfo/relax-users
>


-- 

Troels Schwarz-Linnet
___
relax (http://www.nmr-relax.com)

This is the relax-users mailing list
relax-users@gna.org

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-users