PINTS Generate .cst File Tab - dwong263/MAGIQ GitHub Wiki

Overview

The "Generate Constraint File" Tab allows you generate a fitMANSuite compatible constraint file from a PINTS Simulation Experiment. See here for more details about how a constraint file is structured.

Before you use this tab, ensure that you have loaded an experiment and that you have properly specified the amplitudes and T2 values.

The "Generate Constraint File" Tab is organized as follows:

  • On the top, there are two panels: one containing simplified instructions for editing the constraints, and on containing a list of available metabolite moieties.
  • Below these two panels, there are three panels arranged in columns.
    • The first column is where you specify how parameters describing the shift of the metabolite peaks are linked.
    • The second column is where you specify how parameters describing the amplitude of the metabolite peaks are linked.
    • The third column is where you specify how parameters describing the phases of the metabolite peaks are linked.
  • Below the three columns, there are miscellaneous options that are described in more detail below.
  • Below that is a panel that allows you to load a *.cstinfo file and apply the constraints to the loaded simulation experiment.
  • On the right hand side, there is a console that provides some output as *.cstinfo files are being loaded and saved.

Defining Linked Shift, Amplitude, and Phase Parameters

Specify how shift, amplitude, and phase parameters are linked in the Shift, Amplitude, and Phase columns.

The constraints are specified according to the following formatting rules.

  1. An semi-colon (;) indicates the end of the definition of a group of linked metabolites. A comma (,) separates each parameter of the definition.

  2. The first parameter is the name of the group. Each group's peaks will be defined relative to the first peak of the group.

  3. The next two parameters signify the minimum and maximum allowable value of the parameter of the tallest peak. If you don't want to set a minimum, type -inf. If you don't want to set a maximum, type +inf.

  4. Everything else is the list of group members. Pick the group members from the list of available metabolites.

  5. Each metabolite can only be part of a single linked group.

  6. By default, the parameters of the individual peaks of a single metabolite moiety are linked together according to the results of the simulation experiment. In other words, you can only specify links between moieties, not within moieties.

Suppose a "shift group" is defined as follows: SNAAx, -1.8, +2.8, naa_acetyl, naa_aspartate, naag_acetyl, naag_aspartyl, naag_glutamate, lactate, aspartate;

In this group, the shifts of naa_acetyl, naa_aspartate, naag_acetyl, naag_aspartyl, naag_glutamate, lactate, aspartate are linked, with a group called SNAAx. SNAAx is also the variable name used for linking. The first peak within this group will be constrained to 1.8 ppm to 2.2 ppm. Now, NAA and NAAG cannot be a part of another linked shift group.

This translates into the following within the *.cst file:

You can define "amplitude" groups and "phase groups" in the same way. Be careful with amplitude groups though, as there are some special considerations to consider.

Defining Groups With a *.cstinfo File

You can also define relationships within a *.cstinfo file and load it into PINTS. A *.cstinfo file is simply a text file. Here's an example:

[Shifts]
SLipMM, -inf, +inf,  lm1, lm2, lm3, lm4, lm5, lm6, lm7, lm8, lm9, lm10, lm11, lm12, lm13, lm14;
SNAAx, -inf, +inf, naa_acetyl, naa_aspartate, naag_acetyl, naag_aspartyl, naag_glutamate, lactate, aspartate;
StCr, -inf, +inf, creatine_N(CH3), creatine_X;
StCho, -inf, +inf, choline_N(CH3)3_a, choline_N(CH3)3_b, choline_1-CH2_2-CH2;
SMyoX, -inf, +inf, myoinositol, alanine, d-glucose-alpha, glycine, peth, scyllo-inositol, taurine;
SGluxGABA, -inf, +inf, glutamate, glutamine, glutathione_cysteine, glutathione_glutamate, glutathione_glycine, gaba;

[Amplitudes]
ANaag, -inf, +inf, naag_acetyl, naag_aspartyl, naag_glutamate;
AlipMM1, -inf, +inf, lm1, lm3, lm4, lm5, lm6, lm7, lm8, lm9, lm10, lm12, lm13, lm14;
AlipMM2, -inf, +inf, lm2;
AlipMM11, -inf, +inf, lm11;

[Phases]
PHNaa, -inf, +inf, naa_acetyl, naa_aspartate, naag_acetyl, naag_aspartyl, naag_glutamate, peth, scyllo-inositol, taurine, alanine, d-glucose-alpha, gaba, glycine, lactate, aspartate;
PHCho, -inf, +inf, choline_N(CH3)3_a, choline_N(CH3)3_b, choline_1-CH2_2-CH2;
PHCr, -inf, +inf, creatine_N(CH3), creatine_X;
PHMyo, -inf, +inf, myoinositol;
PHGluX, -inf, +inf, glutamate, glutamine, glutathione_cysteine, glutathione_glutamate, glutathione_glycine;
PHLipMM, -inf, +inf, lm1, lm2, lm3, lm4, lm5, lm6, lm7, lm8, lm9, lm10, lm11, lm12, lm13, lm14;

The headings [Shifts], [Amplitudes], and [Phases] corresponds to the three columns in the user interface. When loading a *.cstinfo file, the text underneath each heading will be loaded into the corresponding column.

To load a *.cstinfo, simply hit the Load Constraints button and select your file.

There are a few example *.cstinfo files that you can use within the pints/cstinfo folder.

Special Considerations

Amplitude Groups

If several metabolite moieties are linked together in an "amplitude group," their relative amplitudes will be fixed according to the scaling factors and T2 relaxation rates of the moieties as defined in the Edit Metabolites.

For example, suppose you have the following "amplitude group" ...

ANaag, -inf, +inf, naag_acetyl, naag_aspartyl, naag_glutamate;

... and the following scaling factors and T2 relaxation rates defined.

The amplitudes in the group will be defined as follows:

  • The first listed moiety in the group (naag_acetyl) has an amplitude of

  • The second listed moiety in the group will have an amplitude of

  • The third listed moiety in the group will have an amplitude of

Simply put, the relative ratio of amplitudes between these three moieties will depend on both the ratio between the scaling factors and the ratio between the amount of relaxation of these three moieties.

Metabolite Moieites with Different T2 Values

It is possible that two moieties belonging to a single metabolite have different T2 relaxation rates. This is the case for NAA, where naa_acetyl has a longer T2 than naa_aspartate. In the above figure, you can see that naa_acetyl has a T2 of 0.2943 sec, while naa_aspartate has a T2 of 0.148 sec. When a constraint file is being generated, a single amplitude parameter is created for the entire metabolite, unless moieties belonging to the same metabolite have different T2 values. In the case of NAA, two amplitude parameters are created, one for naa_acetyl (naa_0) and one for naa_aspartate (naa_1), as shown below.

Miscellaneous Constraint Options

There are additional "miscellaneous" constraint options that you can set.

The Water Removal Region

The "Water Removal Region" is a region of the in-vivo spectrum that is somewhat suppressed by the water suppression sequence. Because of this, the amplitude peaks in this region are not well modeled by the simulations as they don't include the water suppression or OVS sequences Typically this is between 4.1 to 5 ppm. You can specify this range using the Max Water PPM and the Min Water PPM fields.

Any peaks that fall within the range that you specify will be assigned a different amplitude parameter. For example, suppose the "Water Removal Region" was set to 4.1 to 5 ppm and the last 4 peaks of lactate in a simulation had a frequency between 4.1 to 5 ppm. In this case, those last 4 peaks of lactate would be assigned a different amplitude parameter ({lactate_0_53} than the first 3 peaks of lactate ({lactate_0}).

These last 4 peaks are assigned the same {lactate_0_53} parameter because the Link amplitudes in water removal region box is checked. If this box was not checked, then each of the 4 peaks would be assigned a unique amplitude parameter (i.e. {lactate_0_53}, {lactate_0_54}, {lactate_0_55}, {lactate_0_56}).

Linewidth Options

There are some linewidth options that you can modify:

  1. You can specify the maximum Lorentzian Linewidth by entering a number into the Max Linewidth (Hz) field. For example, if the Max Linewidth was set to 50 Hz, the a limit of 50 would be imposed on the linewidth parameters in the constraint file.

  1. If the Link all linewidths box is checked, one linewidth parameter is assigned to all of the peaks in the constraint file. If the box is not checked, each metabolite is assigned a unique linewidth parameter.

  2. If the Link lipid linewidth box is checked, one linewidth parameter is assigned to all of the lipid lineshapes in the constraint file.

If the box is not checked, each lipid lineshape receives a unique linewidth parameter.
IMPORTANT: Do not check this box if macromolecules were not included in the simulation experiment.

Fit NAA Multiplets Separately

This is a legacy option. Not recommended for use.

Checking this box will force naa_aspartate to have a different amplitude parameter than naa_acetyl. You can now achieve this by setting different T2 values for naa_aspartate and naa_acetyl as described above.

Saving and Applying Constraints

Once you have defined your constraints, save and apply them to the simulation experiment. Hit the Save and Apply button. A file dialog will pop up. Choose a file name and click OK. Choosing an existing filename will result in the existing *.cstinfo file to be overwritten. Output in the console will tell you what groups were defined, and where the constraint information was written.

Generating a Constraint File

After saving and applying your constraints, you can now generate a constraint file.

Specify where you want to save the constraint file in the Output Filename field. Confirm the location by hitting the Confirm button and write the file by hitting the Generate .cst file button.

⚠️ **GitHub.com Fallback** ⚠️