Documentation of individual methods - 1

alphabetic index / program documentation / database / internals / project methods / display methods
application_defaults - user defined global behaviour
atom_map_entry, atom_map_list
command_handler - macro processing
global functions that do not belong to any class
mapping_entry, mapping_list
pl_compare_param - Peaklist comparison
ppm_entry, ppm_list
pseudoatom_entry, pseudoatom_lib
rd_param - Reduced dimensionality experiments
residue_ppm_entry, residue_ppm_list
sc_peak, sc_pair
2D routines
spec_display, spec_display_chain

methods: parameters and pointers:

Global functions

void backup(char * name, int backup_mode, int order=-1)
backup_mode = 1 - name --> name.backup
backup_mode = 2 - name --> name.000, name.001 ... (if order is given, name --> name.order)
peaklist_back(pal_list * pl)
If the peaklist is one of pj->pkllist->pp[x]->pl, pj->pkllist->peaklist_back(x) is called, otherwise pl is deleted.
spec_io * get_spio(char * id=NULL, char * title=NULL)
Access to spectra that are defined in project can be in two ways:
  1. with "spec_io * ::get_spio(char * id)" you get a pointer to an existing spio, if available in the project.
  2. With new spec_io ... spec_io::get_interactive(void) you always get an independent access to the spectrum, even if you get the filename from pj->sel.
When get_spio is used in a macro, it tries to read a filename from args.

table, table_handler

table (constructor)
table_handler (constructor)

derived classes:
commands to reorganize project (ctb)
commands to reorganize project database (ctb)
Tables are windows from which particular fields can be selected with a click of the mouse. This mouse action calls the method th->handle(col, row) of a table_handler th.
table_handler is a pure virtual class, a subclass must be defined which sets the table and calls the appropriate action. table_handler has a pointer to table * tb, and table has a chain of table_handler * thd.

There are two ways to set up a table

  1. local_loop(status): thd->handle(..) sets status to CONFIRM_NO/CONFIRM_YES to break the local_loop of the table.
  2. The table is set with table_handler::restart() and stays. thd->handle(..) finally deletes itself and consequently unmaps the table.
Several global tables exist: Several table_handler can set the same table in sequence. If tb->thd==this, a table_handler is "active", i.e. it can be called from the table. Theoretically a table_handler can be called from several tables, but this situation must be avoided, because it cannot distinguish between the callers.

new 13.11.96

table_handlers are chained to table::thd on construction of thd. A local_loop() is not necessary, the table_handler can delete itself. The procedure uses table_handler::restart to set the table in the beginning and after this table_handler has rearrived in the first position of the chain.

If "private" tables are used, these must be explicitely constructed before, and destructed after table_handler. It may be checked that thd==NULL before destruction to avoid nonsense. methods: in

table::table(char * name, int cw, int lines, char *buf, table_handler * th, int nr_col, int * col_st)
void table::set(char * name, int cw, int lines, char *buf, table_handler * th, int nr_col, int * col_st)
name: title of the window
cw, lines: number of characters and lines to display
buf: buffer of text to display. The text is diplayed as lines, separated by '\n'. The relation between the text and row/columns must be organized by the table_handler - table doesn't care whether there is anything displayed or not.
th: table calls th->handle(col, row), when button 1 pressed in a field. nr_col: the number of columns col_st: an array of [ccol+1] character positions that mark the start of the columns.
void table_handler::local_loop(void)
Display the table, enter tb->local_loop(status) and Unmap tb afterwards.
void table::thd_deleted(void)
If there is a thd in the chain, thd->restart(). Else Unmap().
table_handler::table_handler(table * tbx)
Insert this in the first position of tbx.
notifies tb->thd_deleted().
void table_handler::restart(void)
set table and Map it.


add_new (read)

void peaklist2::reassign(void) -
Assignment numbers in a peaklist are changed from am to a different assignment_manager, am2. The features of the new assignment_manager are given interactively.
void peaklist2::assign(void)
a new assignment manager is constructed for the peaklist.
int peaklist2::get_chain_base(void)
returns whether the peak id must be multiplied with 1, 10 or 100 to get unique peak numbers for chained peaks.
void peaklist2::get_isolation_status(void) -
Sets NOT_ISOLATED and NOT_ISOLATED_IN_SCAN for all peak_info2 members of this and for all scp of all members according to the following rules:
peak_info2::status: NOT_ISOLATED if 2D off/end overlap with other peak_info2 member of list. NOT_ISOLATED_IN_SCAN if at least two scp's of this peak_info2 member overlap. REAL_OVERLAP indicates that there is a 3D overlap between two 3D's of different peak_info2 members.
sc_peak::status: NOT_ISOLATED if 3D off/end overlap with sc_peak of other peak_info2 member. NOT_ISOLATED_IN_SCAN if 1D overlap with other scp of this peak_info2.
For sc_pairs no status is set. Only NOT_ISOLATED status for peak_info2 is treated correctly in a list of pairs.
void peaklist2::get_isolation_status(peak_info2 * pk, float Lwp2)
Only status of pk is set. Status of all other peaks is not effected. Another difference is that off/end in scan-dim is not used, Lw2 is used to define overlap in scan dimension (for the case that sc_peak->off/end has not been set) (3.1.96 changed)

bool peaklist2::diagonale(sc_peak *p3, peak_info2 *p2)
returns whether p3 is diagonale peak of p2. no side effects. used in scan::search to exclude diagonale peaks for optimization
void peaklist2::correct_diagonale(void)
If a peak is +/- 0.5*lw from diagonale, set it to diagonale. If no such peak exists, insert one with vol=0, color=2. The function is called from the menu "modify pl" - "fix+assign diag.".
void peaklist2::assign_diagonale(void)
If a peak is +/- 0.5*lw from diagonale, set its ass to that of the matching entry in peak dimension.

void peaklist2::remove_multiple_ref(scan_param * scpa, bool take_average)
Search for entries in scpa->pl, which have same assignment in both peak_dims (!=0). If ppm difference > Lw_e, issue a warning. Else remove the entry with higher position in the list.
Depending on take_average lw and ppm of the remaining peak are set to the average of both peaks, or the lower peak remains unchanged.
void peaklist2::get_linewidth(scan_param * scpa)
Opens a reference peaklist interactively, and tries to get linewidth from resonances with identical assignment numbers. Peak position must be within +/- lw/2 of the reference list, otherwise warning is written, but no lw is set. Called from "compare pl" - "get linewidth from other list"
float peaklist2::lw_from_ass(int dim, int ass)
Returns the linewidth, if it finds a peak which is assigned to ass in dimension dim. Used for above method.
float peaklist2::ppm_from_ass(int dim, int ass) -
Return ppm value, if ass matches assignment number in dimension dim. Returns ppm of the first peak found in the list. Returns IMPOSSIBLE if no matching peak found.
int peaklist2::type_of_chained(void)
Returns the type of chained entries in the list (SC_PEAK or SC_PAIR), 0 if empty, or INVALID if different types are found.
Assignment routines for the different types of experiment can either assign lists containing peaks, or lists containing pairs, but no mixed lists. Checking can be done with type_of_chained, but normally it is known what is in a list.
The following commands are in Most of them can be only called as macro commands.
void peaklist2::assign_name_all(char * name, bool assigned_too) -
Assigns every peak in scan dimension as resonamce "name" of the fragment id.
void peaklist2::assign_name_1(char * name, bool assigned_too)
Assigns the peak with the largest absolute volume in each strip as "name".
void peaklist2::assign_prot_id(bool assigned_too, float tol=0) -
Tries to resolve the assignment from a proton list. The id of the strip is used as residue number, and only atoms of this residue are considered. The first character of iname[2] must match the atom name, or it must be a pseudoatom "Q..".
Uses pj->db->d_prot or mode 5 am->prot->f_name, if they exist. Otherwise prot is selected interactively.
void peaklist2::assign_CA_CAp_1(bool assigned_too) -
The 2 peaks with the largest absolute volumes are assigned as CAp and CA, respectively.
void peaklist2::assign_CA_CB_1(bool assigned_too)
Assignment of CA and CB on the basis of peak positions.
  • 1 entry: CA if < HI_GLY, else CB
  • 2 entries: the lower ppm value is CB, the higher CA - exept both are below INV_THR (55.0 ppm), then the higher ppm value is assigned to CB.
  • more than 2 entries: the two with the highest absolute volume are selected and treated as 2 entries.
void peaklist2::assign_CA_CB_2(bool assigned_too)
Assignment of CBCANH experiment on the basis of volume. CA=large positive, CAp=small positive, CB=large negative, and CBp=small negative.
void peaklist2::assign_CA_CB_3(bool assigned_too)
The same as before but CBCA(CO)NH, now the bigger peaks are CAp and CBp.
void peaklist2::assign_toc_1(bool assigned_too)
(1.0.40) A primitive scheme to guess GLY and ALA residues, and to assign everything else as HA, HB2, HB3, HG2, HG3, ... for decreasing ppm values. This scheme does not use the library information and is to be rewritten.
void peaklist2::assignPAIRS_name_all(char * name, bool assigned_too)
void peaklist2::assignPAIRS_name_1(char * name, bool assigned_too, bool use_central)
The same for lists containing pairs. use_central=true: the pair with the biggest central peak is used, use_central=false: the biggest projected peak.
The central peak is set to "name", then the projected peaks are assigned with assign_symmetric().
void peaklist2::assignPAIRS_both_all(char * name_c, char * name_sy, bool assigned_too)
All pairs are assigned as: center - "name_c", projected - "name_c+name_sy" and "name_c-name_sy"
void peaklist2::assignPAIRS_cohnca(bool assigned_too)
Assignment of COHNCA-experiment pairs: central=Cp, projected: big=CA, small=CAp. The routine assumes that there is only one central peak per strip.
void peaklist2::assignPAIRS_CA_CB(bool assigned_too)
Assignment of HA&HB/CA&CB-NHN experiment.
void peaklist2::assignPAIRS_CAp_CBp(bool assigned_too)
Assignment of HA&HB/CA&CB(CO)NHN experiment.
void peaklist2::assignPAIRS_to_center(bool assigned_too)
If the central peak is assigned, the projected peaks are assigned to the following scheme:

pal_list * peaklist2::projected_124D(float Off_dc, float F_dc, float Ri_ppm_min, float Ri_ppm_max) -
Makes a new peaklist that has one or two entries for each pair (depending on sign = LOW_PPM, HIGH_PPM, BOTH_PPM) with the ppm in indirect dimension. peak_info2 entries without pairs do not lead to entries in returned peaklist2.
pal_list * peaklist2::projected_34D(float Off_dc, float F_dc, float Ri_ppm_min, float Ri_ppm_max)
see: rd_param::projected_*.
void peaklist2::propose_COHNCA_cn(void)
Tries to find n - n+1 connections only from a list with CA and CAp. Prints a message about pieces of sequence which are put together on the basis of best fit between CA and CAp. No information about other possibilities and reliability is given. (It is of course nonsense to guess sequential connectivities on the basis of this spectrum alone).
void peaklist2::write(void)
Write peaklist using a temporary pal_list.
void peaklist2::add_new(char * title)
Add a new peaklist using a temporary pal_list.
void peaklist2::combine(int first, int second)
Set ppm and lw of pp[first] to average of first and second (regardless of volume). Peaks from second are chaind to first, first is removed.
void peaklist2::combine_ref_peaks(void)
Strips with the same assignment in both dimensions are combined, i.e. ppm and lw values are averaged, and sc_peaks are chained together. If ppm differences > Lw_e, a warning is printed, and the peaks are not chained together. If more than two "strips" are combined, ppm and lw are not a true average, because only 2 strips are merged at a time, with 1/2 weight each.
Unassigned strips are only merged, if ppm is identical.
void peaklist2_loader::set_id_from_ass(void) -
Set id for each peak_info2 entry to the residue number if this can be resolved from the assignment in the two peak_dim's. Gives lots of warnings and keeps the old id in case of problems.
void peaklist2::assign_to_inames_2D(bool assigned_too=false)
Resolve assignment of the two base dimensions from id of the 2D peak and iname of the peaklist. If assigned_too=true, exising assignments are overwritten. If assigned_too=false (default) a message is printed if id + iname would not agree with an existing assignment, but the old value is retained.
void peaklist2::handle_overlap(void)
The routine tries to remove strips and peaks from a peaklist, that have very strong overlap with other peaks. If the peaks have the same, or no assignment, the position is averaged (regardless of volume). If assignments are to a pair of protons, that can be replaced by a pseudoatom, assignment is changed to that pseudoatom. !! If the pseudoatom is not known to the assignment_manager, the resonance becomes unassigned. If two strips with different assignment overlap, a message is printed.
The parameters - distances in ppm below which resonances cannot be separated - are obtained from a dialogue box.
The command can be called for scpa->pl with the macro "spm handle_overlap".
void peaklist2::normalize_lw(scan_param * scpa)
set linewidth at or bejond the border of the allowed range to expected linewidth. Can only be called with spm command.
void peaklist2::add_peaklist(pal_list * pl3)
pal_list --> peaklist2 transformation.


write, write_new

source code: spec.h

This is one of the two internal peaklist formats. Everything except integration of spectra and formation of pairs in reduced dimensionality spectra is done in this format.

pal_entry members:

float ppm[PAL_DIM];
int ass[PAL_DIM];
float lw[PAL_DIM];
int nr;
int id;
float vol;
float qual;
char color;
int status;
#define STRIP_TOF       0x000000ff  
strip bits that are written to file #define PEAK_TOF 0x0000ff00
single peak bits that are written to file #define STRIP_SEEN 0x00000001 #define STRIP_TOUCHED 0x00000002 #define ALWAYS_KEEP 0x00001010 #define NO_PPM_CHANGE 0x00002020 #define NO_LW_CHANGE 0x00004040 #define NO_CHANGE 0x00008080
only substract volumes, dont touch #define STATUS_STICKY 0x0000f0f0
bits that survive search1::clear_status(peaklist2 * apl
There are more atatus settings, but these are
void pal_list::get_Lw_e(scan_param * scpa)
Determines the expected linewidth in a peaklist in all dimensions. There are three possibilities to get this figure:
  1. If the majority of peaks has lw[] entries set, the average of those is calculated
  2. If this fails, and scpa is given, a matching Lw_e entry from scpa is taken.
  3. If scpa==NULL or the iname cannot be matched a dialogue box pops up to enter the linewidth.
This routine is called when a peaklist is loaded, so pal_list should always have valid Lw_e[] entries.
int pal_list::overlap_category(int peak_p)
A rather primitive method to classify overlap between peaks in a pal_list. peak_p is the index (cp) of the peak that is examined. Return value is
bool pal_list::check_assignments_exist(proton_list * prot)
Whether or not all assignment numbers are in proton_list * prot. If not, the invalid number are printed out (sorted).
void pal_list::change_ass_number(int from, int to)
Makes the indicated change of an assignment number in all dimensions.
void pal_list::write_new(char * title)
fsb->file_input_loop("*.peaks", MODE_WRITE, title)
void pal_list::write(void)
fsb->overwrite_confirm(f_name), write_pl_xe_lw2 or write_pl_xe_lw3.
void pal_list::read(char * filename=NULL, char * load_title=NULL)
If a filename is given, this file is loaded. If filename=NULL, fsb is called with "*.peaks" and load_title=NULL. f_name is not evaluated, if you want to reload the file, call read(f_name).
void pal_list::add_peaklist(peaklist2 * pl2, int with_pairs=PAIR_TK_C, bool ref=false, int mask3=0)
Transform peaklist2 into pal_list. with_pairs can be PAIR_TK_C (Take Central peak) or PAIR_IGNORE (Do not use pairs). The behaviour of the function depends on this->dim. If dim=0, it is resolved from pl2->type, or asked interactively. If ref=true, only the first peak of each strip is used (reference list). If mask3, only those peaks are used for which !(status&mask3)
void pal_list::edit_assignments(int n)
displays all 2/3 assignments of peak pp[n]. Changed assignments can be entered as "atomname res_nr". Only if those can be resolved by am, they are accepted, otherwise something else has to be entered. Leaving the field blank set assignment to 0 (undefined).
void pal_list::permutate(int * perm_on, int new_dim=0)
permutate dimensions in list. If new_dim is not given, dim is conserved, except when perm_on[new]=-1. Then the new dim is unused - dim's higher than this must not be defined.
void pal_list::permutate_adapt(char iname[DIMENSION][IDLN], int mxi)
Adapt peaklist to match the first mxi dimensions of iname. Adapts this iname, if different. Ask for interactive input, if no 1:1 match is found.
void pal_list::sort_clusters(float max_dist=1e10)
Routine to sort peaklists in such a way that peaks with a short distance between each other are near to each other in the list. It may be useful to have reference lists sorted in this way.
If no argument is given, all peaks are sorted to one cluster. Otherwise all peaks that have a neigbor in a distance < max_dist are clustered, and the peaklist is sorted such that the clusters with most peaks come first.
Currently the routine is not acessed.
void pal_list::take_assignments(void)
void pal_list::take_assignments(pal_list * ref_pl, int n, int * match_p, int * match_r, float * dst, int mode, int mode_a)
The routine matches assignments between two peaklists on the basis of ppm positions. The peaklists may be assigned with different am's. It is possible to exchnage assignments between 2D and 3D lists, and to assign 3D peaks in 2 dimensions using a 2D or 3D list. First, the peaklist is loaded from which the assignments are extracted. Parameters are then taken from a dialoge box. The first lines determine which dimensions are matched, and what is the the maximum deviation between peaks to allow a match. Two criteria are used: A peak has a "best" partner, b, in the other list, if the sum of ( (ppm1-ppm2)^2 / d_max^2 ) for all dimensions that are matched, d, is d(b) < 1, and d(b) <= d(i) for all other peaks i. A peak has a "unique" partner, if, in addition, d(i2) - d(u) > 0.5, where i2 is the peak with the second smallest value of d. The "mode" has the following effect: The last parameter determines, whether "wrong" assignments are preserved (3, 4) or overwritten (1, 2), and whether assignments are only taken from the reference list to this list (2, 4) or in both directions (1, 3).
The routine is called with the macro command "spm take_assignments", which loads the peaklist first.
void pal_list::get_match_pr(pal_list * ref_pl, int &n, int * match_p, int * match_r)
determines which dimensions in this and ref_pl will be compared. n returns the number of dimensions compared, which must be 2 or 3. match_p[0] is compared with match_r[0], match_p[1] with match_r[1], and so on.
void pal_list::deviations(void)
void pal_list::deviations(pal_list * ref_pl, int &nm, int * match_p, int * match_r, bool * valid_shift, float * shift)
Determine the difference in ppm between peaks in this and peaks in a reference peak list
void pal_list::shift(bool * do_move, float * dppm)
Changes ppm values in the peaklist in dimensions where do_move[d]==true. Analogous to xeasy "ml".
void pal_list::filter_mirrored(pal_list * ref, bool remove_unmatched, int md, bool check_all)
After evaluation of reduced dimensionality spectra, this routine uses another peaklist to decide which of two possible ppm values, offset +/- difference, is valid.


A function which returns a particular match (1D, 2D, od 3D) between two peaks in two (or the same) peaklist(s) can be obtained in the following way: An instance of class distance is constructed, and initialized with the parameters that define the match. Then the methods "d" or "w" are called for the two peaks.

source code: spec.h

distance::distance(pal_list * pa, pal_list * pb, int dm, char * in0a=NULL, char * in0b=NULL, float r0=0, char * in1a=NULL, char * in1b=NULL, float r1=0, char * in2a=NULL, char * in2b=NULL, float r2=0)
Defines a particular match (1D, 2D, od 3D) between two peaks in two (or the same) peaklist(s). dm is the number of dimensions that are compared, inxa and inxb are the inames of the dimensions in the list that are to be compared, and rx is the ppm difference that corresponds to a calibrated distance of 1.0.
If(r==0), sqrt(Lw_e*Lw_e) of the two lists is used.
inxa and inxb default to pl->iname[x].
distance::distance(pal_list * pa, pal_list * pb, int dm, int da=NULL, int *d0b=NULL, float r=NULL)
Same as above, but the inames of the dimensions are replaced by their order. If no order or relative distance is given, the order 0, 1, 2, 3 and the average expected linewidths of the peaklist are used.
distance::distance(pal_list * p)
defines the distance between peaks within one list, calibrated to Lw_e.
float distance::d(int na, int nb)
na and nb are the indices of the peaks in the peaklists. The square of the calibrated distance is returned.
float distance::w(int na, int nb)
na and nb are the indices of the peaks in the peaklists. w=gauss(sqrt(d(..))) , which may be used as a probability for match between the two peaks.



int scan::search(void)
The routine is one-dimensional, uses res_c and does not affect the spectrum. (i.e. it assumes that do_scan is made, known peaks are substracted from the spectrum...)
Reads s_peak->scp chain and blocks "known" peaks. Then it searches new extremal points and tries to fit peaks to them, which are chained to s_peak->scp. It discards peaks with low qual, if too many peaks are in s_peak->scp.
Returns number of peaks in s_peak->scp.
void scan::optimize(sc_peak * a3p, int add_first)
Optimizes ppm and lw of a3p in scan dimension, calculates vol and qual. It is the only place where qual is calculated for 3D peaks.
Is called in scan::search (when a potential peak is found), in scan::recalculate_existing and in check_for_doublepeak.
For peaks with status ALWAYS_KEEP the ppm change is limited.
side effects: if add_first==true, res_c is assumed to be residuals, and the peak is added first. At the end of the routine the peak is always substracted from res_c. It is assumed that the other peaks are already substracted from res_c.
void scan::optimize_2pl(peak_info2 * px)
Ppm and lw of the strip (i.e. in peak_dim[0] and [1]) are optimized. The individual optimisations are only done if Lw_adapt[scpa->peak_dim[0/1]] is true and Max_d_ppm[0/1] != 0 or Limit_d_ppm is false.
As the first step it is defined which peaks are used to optimize the parameters. If the fabs sum of non-diagonale isolated peaks is > 1/3 of the fabs sum of all non-diagonale peaks, only these peaks are used, else all non-diagonale peaks are used. If only diagonale peaks are in the strip, the first ->scp peak is optimized if isolated, else the function returns without optimizing.
The peak is multiplied in both dimensions with the first deviation of the peak shape. A vector is proposed, and it is checked whether the new position leads (after calculation of the new peak volume) to a smaller sum of square deviations within the old borders. If not, the vector is reduced to 1/2 and 1/4 of its original length. If no success, the peak is shifted by 1/10 lw to all 4 directions. If one of the new positions is not allowed due to the restrictions set by scpa->Max_d_ppm or Min_dist, it is treated as if it was no improvement (i.e. no attempt is made to go to the border of the allowed range).
The linewidth is optimized according to a triel and error procedure, starting with (1 + scpa->Exact_lw) * lw. If no improvement, (1 - scpa->Exact_lw) * lw is tried. On success, the change of linewidth is doubled, until the result becomes worse.
scan::converge_volumes(sc_peak * hook, bool cor_r, bool cor_sp, bool all_peaks)
Assumes that res_c is "empty". Determines the residual volume emptv, and calculated the "converged" volume as:
oldv+emptv - if same sign
oldv*oldv/(oldv-emptv) - if opposite sign
if(cor_r) res_c is corrected
if(cor_sp) the spectrum is corrected
if(!all_peaks) only sc_peaks with status&(NOT_ISOLATED|NOT_ISOLATED_IN_SCAN) are treated.
void scan::recalculate_existing(void)(sc_peak *p3, peak_info2 *p2)
converge_volumes, optimize. Result: vol and qual of scp chain is updated. res_c->vol is updated.
void scan::add_vol(sc_peak * a3p)
void scan::add_vol(sc_pair * a3p)
void scan::substract_vol(sc_peak * a3p)
Peaks are added to (substracted from) pattern res_c, subspec is not changed. For sc_peaks, off/end must be ok. In case of pair, all three peaks are added, after calculating off/end.
void scan::add_peak(sc_peak * sp)
void scan::substract_peak(sc_peak * sp)
Peaks are added to the subspectrum, or substracted. If a peak is substracted, status of sc_peak is set SUBSTR_FROM_SP. If a peak is added, this status is cleared. A warning is given, if a peak is added which doesn't have status SUBSTR_FROM_SP (but the peak is added nevertheless). scpa->ss is in an undefined state after this command.
void scan::substract_pair(sc_pair * a3p)
A pair is substracted by creating 3 peaks, adapting off/end and substracting them. status is lost.
substract_pair is called by search1::substract_ovrlap_pairs.
bool scan::check_for_doublepeak(sc_peak * &a3p)
Called from scan::search for each peak that is found. The peak a3p is already substracted from res_c->vol.
Check whether the peak should better be split. If yes, use only the bigger half, hoping that the other half will be found in the next loop.



void search1::converge_overlap(bool correct_spectrum)
For all overlapping peaks in scpa->pl the volume is converged.
If(correct_spectrum), the differences are corrected in the spectrum.
void search1::fold_peaks(bool fold_3rd_D=true)
fold peaks of scpa->pl into full_spec.
Peaks are folded according to the folding mode in sppa->param in the two peak_dim's or in all 3 dimensions by a call to calibration::fold. If scpa->Search_pnb==4 or 5 (search for fold +/-) the volume of the peaks is inverted if folding is uneven in the two peak_dim's.
void search1::unfold_peaks(bool fold_3rd_D=true)
If scpa->Search_pnb==4 or 5 (search for fold +/-) the volume of the peaks is inverted if folding is uneven in the two peak_dim's. Then peaks are unfolded in all 3 dimensions.
void search1::search_pairs(rd_param * rdpa, main_window * mw)
Search for pairs in the spectrum. The pattern res_c is symmetrized with rd_param::symm_pattern. Then peaks are searched in this pattern. Pairs are constructed from these temporary peaks. Method is called from rd_param::run_pairs_C. The command works on three lists: rdpa->c_pl, px_pl, and s_pl. These must "match", i.e. the positions in each of these lists must correspond to each other. In contrast to the search for peaks, always all pairs are searched from scratch, i.e. it is not possible to keep pairs. Iterations are only useful to substract peaks from neighbouring strips and to optimize the position of strips.
void search1::update(peaklist2 * apl)
scpa->subspec is used to define off/end in all 3 dimensions for peak_info2 and sc_peak entries in apl. As a side-effect, a scan ss and a pattern ss->res_c are constructed.
Cannot be used for list of pairs.
void search1::substract_ovrlap_pairs(peaklist2 * apl)
For strips that are not isolated, all pairs that are chained to the strip are substracted from the spectrum. SUBSTR_FROM_SP status is set for peak_info2.
void search1::integrate_3D(main_window * mw)
Peak search and integration in 3D spectrum. integrate_3D needs the following information from spio/scpa:
void search1::first_search(main_window * mw)
Makes a search for peaks in 3rd dimension, with the current linewidth and position in 2D.
void search1::next_search(main_window * mw)
First, optimize lw and ppm (accordinf to parameters in scpa). Then check/optimize peak positins in scan_dimension.
void search1::
void search1::
void search1::

2D routines

void search1::get_volume_2D(peak_info2 * p2, int matrix_ok)
calculates volume from the current state of the spectrum. Doesnt care about next->vol.
If !matrix_ok, M2 is loaded first.

Reduced dimensionality experiments - methods of class rd_param



Nearly all important parameters and functions to evaluate reduced dimensionality experiments are methods of rd_param. There is a pointer scpa->rdpa, but it is possible to create separate instances.

Most parameters are explained in the program manual. All methods are in

void rd_param::run_pairs_A(void)
Paired and central peaks are in separate lists. The lists are loaded interactively. scpa->pl and rdpa->c_pl are "syncronized". Then search_pairs_A is called for each entry. mark_doublepairs() is called.
void rd_param::run_pairs_B(void)
Paired peaks are positive, central peaks negative. Makes a complete search through peaklist scpa->pl. For each entry negative peaks from scpa->pl are put to rdpa->c_pl. Continues as above.
void rd_param::run_pairs_C(void)
This method uses a peaklist with central peaks to search for pairs in subspec. Calls search1::search_pairs. Currently only 1 iteration and no attempt to optimize the pairs is made, the volumes are underestimated as a consequence.
void rd_param::edit(void) - in
open popup window to edit/load/write parameters.
void rd_param::search_pairs_A(int n2)
Called from run_pairs_A and _B. Command works only on one strip, n2, in the three lists. No reference to the corresponding spectra. Peaks from scpa->pl are collected into pairs and put to rdpa->xp_pl. rdpa->c_pl is used for central peaks. Behaviour depends on Oblig_cent.

While pairs of peaks meet the following condition, remove the peaks from scpa->pl and put them to rdpa->pairs, mark the respective rdpa->central entry status |=USED_IN_PAIR. (The basic conditions must always be fullfilled.) :

This routine does not consider the possibillity that paired peaks of two different pairs are degenerate (only one of the pairs can be found in this case)
void rd_param::mark_doublepairs(void)
Searches in px_pl for two pairs in the same chain, for which the difference of ppm_c is smaller than Center_dev. Assignments are not considered at all. The status is set to IS_DOUBLEPAIR1 and IS_DOUBLEPAIR2, and the second pair is chained immediately after the first.
pal_list * rd_param::projected_124D(void)
Returns a 3D peaklist with the 2 peak_dim's and the "4th" dimension from sc_pair entries in px_pl. Only peaks are written to the list that are between rd_param::Ri_ppm_min and Ri_ppm_max. Calls px_pl->projected_124D.
pal_list * rd_param::projected_34D(void)
Returns a 2D peaklist with the 2 projected dimensions (the two strip dimensions are not written) AS above. Calls px_pl->projected_124D.
Returns a 2D peaklist with the pairs of direct and projected 3rd dimension. As above.
pattern * rd_param::symm_pattern(pattern * res_c, float sppm, int fold)
Symmetrizes the pattern res_c by using +/- minmum absolute volume and minimum error. res_c is unchanged. Calibration of the returned pattern is symmerty axis = 0 and negative pixel spacing (not changed to indirect dimension). The range of the new pattern is restricted by Dsc_ppm_min/max. The routine symmetrizes either on the center or on the egde of a pixel.
void rd_param::get_Dsc_ppm(void)
Calculates float Dsc_ppm_min and Dsc_ppm_max from the parameters that are available in the window. This method must always be called when parameters were changed before Dsc_ppm_min or Dsc_ppm_max are used (currently called at beginning of run_pairs_A and run_pairs_B).
Dsc_ppm_min and Dsc_ppm_max are minimum and maximum distance between center and symmetric peaks in ppm of the non-projected 3rd dimension.
void rd_param::get_c_pl(void)
Get list with central peaks (c_pl) for reduced dimensionality spectra and make scpa->pl empty. (if scpa->pl exists, use scpa->pl or ask whether it should be saved).

Peaklist comparison

void pl_compare_param::match(peaklist2 *& pl1, peaklist2 *& pl2, bool clear_unmatched1, bool clear_unmatched2)
The function modifies pl1 and pl2 in such a way, that each entry in pl1 corresponds to the entry in the same position of pl2. If clear_unmatched1, entries in pl1, which have no corresponding entries in pl2, are removed, otherwise they lead to entries with scp=NULL in the corresponding position of pl2. The same for clear_unmatched2.
The command is not completely symmetrical for pl1 and pl2. If two strips with the same assignment exist in pl1, they are retained. In pl2 they are chained together. The following procedure is made:
- for each entry in pl1 all entries in pl2 with the same assignment are selected
- for entries without a match the best correspondence in pl2 is selected, which is yet unmatched and is within the specified borders in the peak_dim's. Even if the assignment is different. (The limitation of this procedure is that no check is made whether the entry in pl2 is nearer to a later entry in pl1)
- remaining unmatched and unassigned entries in pl2 are chained to the nearest peak with a correspondence in pl1
- problems are printed to stdout
void pl_compare_param::mix_assignment(peak_info2 * p1, peak_info2 * p2)
If one of the assignments in p1 or p2 == 0, it is set to the corresponding assignment in the other peak.


void nSpec::write_new(void)
Asks the user for a filename and writes the spectral matrix to disc. Permutations are taken from spec_io * spio. Size and calibration of this nSpec is used, the submatrix size is calculated new.
See description of writing 3D spectra.
void nSpec::get_inside_matrix(nSpec * const specr)
Copies the data points with matching ppm from specr to this. this must be completely inside specr, and have the same perm and pixel spacing in all dimensions (the conditions are not checked, the routine produces nonsense or segmentation faults if they are not true).


A class which is responsible for reading and writing spectra. One instance, spio, is constructed from main_t_window, and all spectra for integration are read with this instance to scpa->subspec. For writing of spectra a short-lived instance is created as a copy of spio, and modified accordingly. The permutation of the dimensions in spec_io is the same as in the parameter file for nearly all parameters. Permutations in both directions are provided for the data file on one side, and the spectral matrix on the other side.

methods: (all routines in



int perm_fw[3], int perm_wf[3]
relation between the order of dimensions in the xeasy parameter file (dw) and the order in which the dimensions are written in the xeasy data file (df) - df=perm_fw[dw]. In xeasy data files the order of submatrices, and the order of pixels within a submatrix, are identical.
int perm_sw[3], int perm_ws[3]
relation between the order of dimensions in the xeasy parameter file (dw) and int the spectral matrix (ds) that is loaded.
int off_sw[DIMENSION];
offset of subspec in perm of dw
int end_sw[DIMENSION];
offset + size of subspec in perm of dw
int subm_size_w[DIMENSION];
float sf_w[DIMENSION];
char iname[DIMENSION][IDLN];
size of file submatrices, spectrometer frequency, dimension identifier. All in perm of dw, and read directly from the parameter file.
char param_file[FILENAME_L];
char spec_file[FILENAME_L];
full filename of parameter file and data file.
spec_io * get_spio(char * id) - in
not a method of spec_io, but a way to get access to a spectrum, either from project, if it exists, or directly by the functions in pointers obtained in this way must not be deleted. Also, the permutations must not be changed. If it is necessary to change the permutation, make a local copy.
void spio_back(spec_io * spio)
is the way to get rid of spio pointers obtained by the function above.
void spec_io::get_interactive(char * title)
Load a new spectrum, bypassing the project table.
void spec_io::write_region(const nSpec * specr)
Overwrites the region in spec_file that corresponds to specr. off/end_sw is ignored and changed to the values resulting from the calibration of this and specr. The command fails if delta ppm per pixel doesn't match. The command is ignored if specr is completely outside the region of spec_file. The case that specr is partially outside is handled by creation of a temporary spectral matrix that is completely inside the file. (This is a serious memory and performance hit if a big spectrum is shifted within its original file size)
int spec_io::write_initialize(void)
Asks for a filename interactively. Writes the parameter file to disc. Writes an empty file with the size of the expected spectrum. folding_type or recalibrations must be set before!
void spec_io::reset(void)
Mark spec_io as invalid and reset the parameters.
void spec_io::get_inverse_perm(void)
Calculate perm_ws and perm_wf from perm_sw and perm_fw, respectively, and check whether permutations are consistent.
void spec_io::get_perm_sw_from_ws(void)
get perm_sw from perm_ws.
void spec_io::adapt_to(pal_list * pl)
Adapt the orientation of spectrum to the peaklist.
int spec_io::Read_Region_X16(int Fd, nSpec * specr)
Reads part or all of a file Fd in XEASY format into specr. The size of the region is determined by off/end, and must be completely inside the region defined by the file. Routine is exclusively called from read_spec.
int spec_io::Write_Region_X16(const nSpec * specr)
Is called by write_region after ckecking everything and setting off/end (for format == XEASY_V1). The routine writes specr into spec_file.
int spec_io::Write_Param_X16(nSpec * specr)
Writes parameter file for XEASY Version 1/16bit format. Returns SUCCESS/FAILED.
int spec_io::read_param(void)
Reads param_file and loads all parameters it finds there. Returns SUCCESS/FAILED.
int spec_io::read_spec(nSpec * &specr)
Reads a part of spec_file into specr. The parameters off_sw and end_sw determine the size of specr; specr is adapted accordingly. If specr==NULL a new nSpec is created. specr is calibrated.
read_spec tests whether off/end is within 0..size. If not, and allow_fold_blowup is true, add_border is called. Otherwise Read_Region_X16 is called directly.
void spec_io::load_mini(nSpec * &specr)
As above, but only the first data point of the spectrum is loaded. off/end_sw are lost. The routine is used to test whether the spectrum can be loaded and to create a valid nSpec specr with correct inames, but does not waste time and memory for loading the full spectrum.
void spec_io::make_pseudo3D(rd_param * rdpa, bool c_pl_ok)
Reads strips out of a spectrum and writes them to a pseudo - 3D spectrum in such a way, that all peaks that are used to define the strips are in the same position on the strip. The calibration along the strip is changed to consider the different ppm scales for direct and indirect dimension.
If !c_pl_ok, rdpa->c_pl is taken from scpa->pl or loaded from file. c_pl is then used a the list to define the position of strips in the pseudo-spectrum.
void spec_io::make_pseudo3D(rd_param * rdpa, int swidth_dim, int strip_width, float strip_off_p, float strip_end_p)
Is called by the command above after the parameters have been determined interactively.
void spec_io::add_border(int dim, int Fd, nSpec * specr)
This function is called recursively in all 3 dimensions to add a folded margin to a spectrum. Used by read_spec, if it detects any off/end outside the spectral file.
void spec_io::change_perm_sw(bool to_std)
( change permutation of spectral access before spectrum is written out. to_std=true: xeasy conversion, i.e. permutation 2 1 or 3 2 1.


xeasy_format is responsible for conversion between XEASY Version 1 16 bit format and float.
void xeasy_format::x16tofloat(unsigned char*lo16, float*result)
Converts *lo16 and the following byte into float.
void xeasy_format::floattox16(float*realin, unsigned char*lo16)
Converts *realin to *lo16 and the following bit


methods: Translates between assignment numbers, residue numbers, atom names, and residue names. It works in one of the following modes:
XEASY_NEW_FIXED = 1 (char *fix_res)
Assignment number is 100*id + atom offset. The residue to determine the offset is fix_res.
XEASY_NEW_SEQ = 4 (char *filename of *.seq list, char *residue_name="SSP")
Assignment number is 100*id + atom offset. The residue to determine the offset is obtained from the *.seq list. If the residue does not exist, it defaults to residue_name.
XEASY_PROT = 5 (char *filename of *.prot file, char *filename of *.seq list)
The assignment number is taken from the proton list. By far the slowest way to go. If the atom does not exist, the assignment defaults to 0. The atom name defaults to "AUKN".
The mode is set with separate functions void set_MODE(...). The mode is set automatically when a peaklist is loaded, if the header of the peaklist contains the keyword "#ASSIGN_MODE". This keyword must start one of the following lines:
#ASSIGN_MODE 1 <residue name>
#ASSIGN_MODE 4 <sequence list> <residue name>
#ASSIGN_MODE 5 <proton list> <sequence list> <residue name>
If such a line is incomplete, the behavoiur is undefined. If no such line is in the header, or mode is not 1, 2, 4 or 5 the default assignment manager is used. The assignment manager associated with a peaklist that is loaded becomes the new default. The assignment manager attached to other peaklists is unaffected.
assignment_manager *link(void), void unlink(void)
One assinment manager can be in_use by one or several peaklists and scan_param. It is deleted if it is no longer in_use. link and unlink tell the assignment manger, how many instances use it.
int ass_number_intrares(peak_info2 *p2, char *iname)
int ass_number(int res_nr, char * atom)
Return assignment number or 0.
char *atom_name_ass(int ass_nr)
Return pointer to atom name or to "".
proton_entry * assignment_manager::relative_atom(int residue_number, int relative_position, char * atom_name, int &flags=internal)
Return pointer to atom atom_name that is relative_position residues in the sequence from residue_number or NULL if no such atom exists. The command works only for mode 5 and 6. The default behaviour is for mode==SPSCAN_PJ to go step by step through next or prev pointers in the sequence list to get the new fragment number. For mode==XEASY_PROT the new fragment number is calculated if residue_number <; NONSEQ_FRAGBASE, otherwise it cannot be determined.
If relative_position==-1 the program tries to find X(-1) as Xp if relative_residue_number() fails or if flags&PREFER_Xp is set.
If CHECK_Xp is set, the program always checks whether Xp exists and puts the result to flags as Xp_EXISTS or NO_Xp.
// flags for assignment_manager::relative_atom(.. ,flags)
#define CHECK_Xp          0x01
#define PREFER_Xp         0x02
#define Xp_EXISTS       0x0100
#define Xp_RETURNED     0x0200
#define INVALID_RESIDUE 0x1000
#define NO_SUCH_ATOM    0x4000
#define NO_Xp           0x8000
#define ANSWERFLAGS     0xff00
int assignment_manager::relative_residue_number(int &residue_number, int &relative_position)
Used by assignment_manager::relative_atom(). Returns INVALID in case of failure.
char *residue_name_ass(int ass_nr)
Return pointer to residue name or to "".
char *residue_name(int residue_number)
Return pointer to residue name or to "".
int residue_number_ass(int ass_nr)
Returns residue number for assignment ass_nr, or 0 if undefined. Determined in XEASY_NEW modes as ass_nr/100, in OFF_PEAK mode always=0 (cannot be determined), in XEASY_PROT mode from proton list.
void set_interactive(void)

proton_entry, proton_list

source code: assignment.h
proton_list : public list<;proton_entry *>; members of proton_entry:
int at_nr
int res_nr
float ppm
char name[ATOMNAME_L]
int priority

float s_ppm
float s_2
float s_wt
to add ppm values for averaging
bool proton_list::check_protons_exist(pal_list * pl) -
The residue name is resolved from pl->am, and it is checked with assignment_library * aslib whether or not the proton exists. Protons that do not exist are investigated closer:
void merge_in(pal_list * pl, bool use_atom_number, int priority)
Update the proton list with pal_list * pl. If use_atom_number==true, an update is only made if the proton number in the peaklist and in the proton list give the same residue number and atom name. If a proton number and the corresponding res_nr/atomname are not found, they are added to the list. In case of a mismatch an error message is printed, and the assignment is ignored. If use_atom_number==false, the resonances are resolved according to res_nr/atomname, no error messages are printed.
see also: project_db::check_seq_prot
void merge_in(proton_list * new_p, bool use_atom_number, int priority)
Same as above, but a proton list new_p is merged in. ppm is used - make new_p->set_ppm() first!


calibration is the base class for calfold, nSpec, spec_io, peak_shape. It provides the relation between ppm and position. When xeasy format is read or written, two modes are supported:
  1. traditional_calibration: on
    "Maximum chemical shift" is the ppm value on the left side of the leftmost pixel, and
  2. traditional_calibration: off
    "Maximum chemical shift" is the ppm value at the center of the leftmost pixel, i.e. p0="Maximum chemical shift"
float p0[DIMENSION]
ppm at center of element 0 (max. ppm). An array starts with -0.5 and ends with size-0.5. Only the way how xeasy parameter files are interpreted can be changed with the resource *traditional_calibration: on/off.
float psw[DIMENSION]
the sweep width in ppm over size[DIMENSION] elements. psw[d] is positive for "normal" calibration where the high ppm values come first.
int size[DIMENSION]
number of pixels
float ppm(float pos, int perm) const
float pos(float ppmx, int perm) const
element into ppm, and ppm into element
void recal(const float hi,const float lo,const int perm)
calibrate in dimension perm.
int elements(void)
total number of pixels

calfold : public calibration

int folding_type[DIMENSION]
1=TPPI, 2=RSH, 0=NO folding
void fold(scan_param * scpa, bool fold3D=true) -
Folds scpa->pl into this. Peaks that cannot be folded are deleted. scpa->pl->folding is set to a copy of this. If the list is folded, it is first unfolded.
void unfold(scan_param * scpa, bool fold3D=true)
Unfolds scpa->pl. It does not test whether unfolding is really possible, i.e. peaks that cannot be unfolded are simply left at their folded position. scpa->pl->folding is deleted and set to NULL. It is assumed that scpa->pl->folding==this. scpa is used to get peak_dim/scan_dim and Search_pnb - if Search_pnb==4 or 5, volumes are inverted.
bool calfold::fold(float &xppm, short &xfold, int dim)
bool calfold::unfold(float &xppm, short &xfold, int dim)
Fold xppm according to the borders and folding_type of this in dimension dim. Return false if the operation is not possible (xppm out of range so that it must be folded, and xfold!=0 or folding_type==0).

sc_peak : public chained

Peak on a strip (of type peak_info2).
float ppm, lw, vol, qual
position and linewidth along dimension of the strip, volume and quality factor.
int ass
char color
color of the peak. This color is not displayed in spscan, but it is written to the peaklist and can be used to label peaks for display in xeasy (see "modify pl"/"color")
float orig_ppm
position of the peak at the start of integration
short off, end
area of peak when substracted or added to subspec
short fold
folding in dimension of the strip for peaks that were loaded from a peaklist
void sc_peak::adapt_range(scan_param * scpa) -
void sc_peak::adapt_range(pattern * res_c, float Lwp2)
Calculates off/end with respect to scpa->subspec, or with respect to res_c.


Pair of peaks (with or without central peak) on a strip.

Macro processing: command_handler

methods: (all in: command_handler is a chained type, the top instance is always chained to acmh. If !acmh, mode is interactive. Thus it is not possible to interrupt a macro - only after deleting the last command handler the interactive mode is restored. The command handler accesses scpa, spio ... via the global variable tt. see Macro commands.
void command_handler::handle_file(char * macroname)
macroname can be relative to .spm default path or absolute.
void command_handler::handle_line(void)
The method to handle macro commands. see macro processing
void command_handler::get_args(void)
cut line into arguments args[]. Watch for "" and '' pairs. Set ac=number of valid arguments.
void command_handler::handle_RO(const char *aline)
copies aline to command_handler::line and processes it like a normal macro line.
void command_handler::read(void)
args[2] is assumed to be a filename, and is opened. args[1] determines what is read from the file: scpa, rdpa or spec.
If args[1] is spec, the arguments after the filename are perm_sw[0]+1, perm_sw[1]+1 .. [dim]. These are the values in the first column of the "spectrum" window. Either no, or all 3 (or 2) values must be given - there is no automatic correction of the following values as in the interactive window.
void command_handler::write(void)
Write lists or parameter files.
void command_handler::kill(void)
Deletes variuos objects. see macro processing
void command_handler::spm(void)
Calls the following command_handler methods.
The following "spm" commands can only be called form a macro.
void command_handler::roesy_volume_correction_1(void)
Interface to pal_list::roesy_volume_correction_1(float ppm_off, float spinlock_v, float sf). Makes a correction of all volumes with:
Vol(corr) = Vol / K(f1) / K(f2)

where Vol(corr) is the corrected volume
      Vol       is the uncorrected volume
      K(f1)     is the correction factor due to offset in f1 dimension
and   K(f2)     is the correction factor due to offset in f2 dimension.

K(f1) = v / sqrt( (v)^2 + (d1)^2 ) and
K(f2) = v / sqrt( (v)^2 + (d2)^2 )

where v         is the field strength of the effective spinlock field in Hz
  and d1	is the offset of the crosspeak from the spinlock carrier
                   frequency in Hz along dimension f1
  and d2	is the offset of the crosspeak from the spinlock carrier
                   frequency in Hz along dimension f2
void command_handler::jump_return_correction(void)
Interface to pal_list::jump_return_correction(ppm_off, evolution, sf). Reads 4 float numbers from args[2..5] -> ppm_off, delayR, t90, sf. evolution=delayR + 2*t90/M_PI. Makes a correction for a jump-return noesy sequence of the form:

Vol(corr) = Vol / K1 / K2

where K1 = ( sin( 2 * pi * R' * D1) )^2

and   K2 =   sin( 2 * pi * R' * D2)

R' = R + t90 * 2 / pi (R = length of delay between jump-return pulses)
                      (t90 = length of 90 degree pulses)
                      (R'= corrected length of evolution during jump-return)

The length of R', R, and t90 is given in seconds

D1 = offset of crosspeak in indirect dimension t1 (in Hz)

D2 = offset of crosspeak in direct dimension t2 (in Hz).
void command_handler::assign(void)
Just calls pj->current_pl->assign(), which ist not available from the menu (R 1.0.35)
void command_handler::average_linewidth(void)
A filter which sets linewidth (mode&1) and/or position (mode&2) of peaks within one peaklist to equal values. The peaklist <peaklist.peaks> is loaded, and after applying the filter it is written interactively. Assignments are not used - only assignment numbers are compared. Call as macro: spm average_linewidth <mode> <peaklist.peaks>
call transformation commands: read, write, write_xeasy, scale, perm. Transformation uses the pointers sconv.spio and sconv.subspec, where sconv is of class conv.

User defined global behaviour: application_defaults

methods: (all in:
On initialization, the following databases are searched: The name of the residue library is determined.
char * application_defaults::get_string(char * name, char * cl_name)
Extracts an entry of type string from the merged database for name / class name with a leading "spscan." / "Spscan." Returns NULL if resource is not found.
char * application_defaults::get_path(char * ext)
Return the default path for extension ext, e.g. the value of "peaks_path:" for ".peaks". see user customizability The method always returns a string, if it cannot find a suitable resource it returns the startup path.
The returned string must be evaluated before the next call to application_defaults::get... - it will be overwritten.
char * application_defaults::full_filename(char * name, char * ext=NULL)
If ext is not given, take it from name. Check whether name starts with absolute path. If not, determine default path for extension ext. If name doesn't have extension ext, add it. Return complete absolute filename.
The returned string must not be freed. It is overwritten by the next call to full_filename.


see Integration parameters
void scan_param::set_default(void)
Set all parameters to default values. Calls also set_default_file.
void scan_param::set_default_file(void)
If the file from which subspec is loaded is known in the project, a parameter file *.scpa with the name of id or type of the spectrum is loaded, if it exists.
void scan_param::write(FILE * F)
void scan_param::read(FILE * F)
Save and load parameters to a file. The parameters are stored in a fixed order and format between "#scan_param" and "#end scan_param" lines.


A calibrated one-dimensional vector
void get_lineshape(peak_info2 * peakx, const int dim)
void get_lineshape(sc_peak * p3)
Load a gauss/lorenz lineshape such that it reflects position and linewidth of the peak in the respective dimension
float ppm(float pos)
float pos(float ppm)
conversion ppm <--> element
void load(n1df &X)
load and adapt vector X, so that the integral is not changed, if full range covered. Out of area = 0
void get_lineshape_gauss(const float ppmc, const float lw)
void get_lineshape_lorenz(const float ppmc, const float lw)
this must be calibrated, loads a GAUSS lineshape with ppmc/lw into this

mapping_entry, mapping_list

defines a list of pairs. Reads XEASY *.seq format as "%*s %d %d" to int fn1, fn2.
bool unmapped_invalid
If unmapped_invalid==true, the return value for an entry that cannot be resolved from the list is 0 (invalid), otherwise it is the old value.
int f1(int f2);
int f2(int f1);
the two mappings.


A list of peaklists, which is used to combine information from corresponding peaks. A command_peaklists * cl is defined in, and is used by all "combine" macro commands.

parameters and pointers:

float *time
The "x" parameter for each of the peaklists.
float *f2
This may be used to store a factor for the volume.
float *y_value
Intermediate storage for corresponding volumes.
assignment_manager * am
am is used for all functions that extract data from the lists. It is assumed that the same scheme is used for all lists. If am is not set with 'combine assign', the am of the first list is used.
int pu
dimension of peaklists, from which assignments are used to label output
pal_entry * pe
current peaklist entry
int to_use
0=volume (default); 1=F1; 2=F2
As the arrays *time[], f2[] and y_value[] are not adapted to the size of the list of lists, only the number of peaklists can be loaded that is given upon construction!

methods: described under macro commands

bool command_peaklists::user_filter(void) is defined in and should be changed to select certain peaks, e.g. to use only backbone NH, or to select a certain range of fragments. By default, user_filter always returns true.
float target(void) returns vol, ppm1, pp2 ... depending on to_use.

Color: drawing_colors

DCNUM=8 fixed colors are allocated by construction of the global drawing_colors * drc. The colors are(black and white are defined somewhere else in
void use(int color)
set foreground color for default gc
void next(void)
use the next color. Goes from 7 "magenta" to 0 "yellow".


A class to hold some pointers for spectral transformation and other tasks.

parameters and pointers:

spec_io * spio;
nSpec * subspec;
no methods.

atom_map_entry, atom_map_list

Handles the transformation of e.g. HB2 into HB when SSP 300 is mapped to ILE 30, or the transformation of CAp 31 into CA 30. All possible transformations must be explicitely written in a list in the format of atom_map.lib.


void atom_map_list::read(char *filename=NULL)
Read library, by default the resource "atom_mapping_library".
char *atom_map_list::first_name(char *r1, char *a1, char *r2)
Find the first entry that matches the "old" residue r1 and atom a1, and the "new" residue r2. Return the atom name. Return an empty string when no match is found.
char *atom_map_list::next_name(char *r1, char *a1, char *r2)
Find other possible matchs in the list.
CAUTION: Method is under development. XXp -> XX transformations are not handled correctly.
Part 2: methods connected to project
alphabetic index / program documentation / database / internals / project methods / display methods
Dr. Ralf W. Glaser
FSU Jena, Institut fuer Molekularbiologie
Winzerlaer Strasse 10
D-07745 Jena, Germany
Tel.: +49-3641-65-7573
Fax: +49-3641-65-7520

Last modified: November 1997