<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE knimeNode PUBLIC "-//UNIKN//DTD KNIME Node 2.0//EN" "http://www.knime.org/Node.dtd">
<knimeNode icon="generic_node.png" type="Manipulator">
    <name>InternalCalibration</name>
    
    <shortDescription>
        Applies an internal mass recalibration.
    </shortDescription>
    
    <fullDescription>
        <intro><p>Applies an internal mass recalibration.</p>
		<p>
			<a href="http://ftp.mi.fu-berlin.de/OpenMS/release-documentation/html/TOPP_InternalCalibration.html">Web Documentation for InternalCalibration</a>
		</p>

        </intro>
        
		<option name="version">Version of the tool that generated this parameters file.</option>
		<option name="ppm_match_tolerance">Finding calibrants in raw data uses this tolerance (for lock masses and ID's).</option>
		<option name="ms_level">Target MS levels to apply the transformation onto. Does not affect calibrant collection.</option>
		<option name="RT_chunking">RT window (one-sided, i.e. left-&gt;center, or center-&gt;right) around an MS scan in which calibrants are collected to build a model. Set to -1 to use ALL calibrants for all scans, i.e. a global model.</option>
		<option name="log">Name of log file (created only when specified)</option>
		<option name="debug">Sets the debug level</option>
		<option name="threads">Sets the number of threads allowed to be used by the TOPP tool</option>
		<option name="no_progress">Disables progress logging to command line</option>
		<option name="force">Overwrite tool specific checks.</option>
		<option name="test">Enables the test mode (needed for internal use only)</option>
		<option name="lock_require_mono">Require all lock masses to be monoisotopic, i.e. not the iso1, iso2 etc ('charge' column is used to determine the spacing). Peaks which are not mono-isotopic are not used.</option>
		<option name="lock_require_iso">Require all lock masses to have at least the +1 isotope. Peaks without isotope pattern are not used.</option>
		<option name="model_type">Type of function to be fitted to the calibration points.</option>
		<option name="enabled">Apply RANSAC to calibration points to remove outliers before fitting a model.</option>
		<option name="threshold">Threshold for accepting inliers (instrument precision (not accuracy!) as ppm^2 distance)</option>
		<option name="pc_inliers">Minimum percentage (of available data) of inliers (&lt;threshold away from model) to accept the model.</option>
		<option name="iter">Maximal # iterations.</option>
		<option name="median">The median ppm error of calibrated masses must be smaller than this threshold.</option>
		<option name="MAD">The median absolute deviation of the ppm error of calibrated masses must be smaller than this threshold.</option>

    </fullDescription>
    
    <ports>
		<inPort index="0" name="in [mzML]">Input peak file [mzML]</inPort>
		<inPort index="1" name="rscript_executable []">Path to the Rscript executable (default: 'Rscript'). [,opt.]</inPort>
		<inPort index="2" name="id_in [idXML,featureXML]">Identifications or features whose peptide ID's serve as calibration masses. [idXML,featureXML,opt.]</inPort>
		<inPort index="3" name="lock_in [csv]">Input file containing reference m/z values (text file with each line as: m/z ms-level charge) which occur in all scans. [csv,opt.]</inPort>
		<outPort index="0" name="out [mzML]">Output file  [mzML]</outPort>
		<outPort index="1" name="lock_out [mzML,Inactive]">Optional output file containing peaks from 'in' which were matched to reference m/z values. Useful to see which peaks were used for calibration. [mzML,Inactive]</outPort>
		<outPort index="2" name="lock_fail_out [mzML,Inactive]">Optional output file containing lock masses which were NOT found or accepted(!) in data from 'in'. Useful to see which peaks were used for calibration. [mzML,Inactive]</outPort>
		<outPort index="3" name="models [csv,Inactive]">Table of model parameters for each spectrum. [csv,Inactive]</outPort>
		<outPort index="4" name="models_plot [png,Inactive]">Plot image of model parameters for each spectrum. [png,Inactive]</outPort>
		<outPort index="5" name="residuals [csv,Inactive]">Table of pre- and post calibration errors. [csv,Inactive]</outPort>
		<outPort index="6" name="residuals_plot [png,Inactive]">Plot image of pre- and post calibration errors. [png,Inactive]</outPort>
 </ports>
    <views>
        <view index="0" name="InternalCalibration Std Output">The text sent to standard out during the execution of InternalCalibration.</view>
        <view index="1" name="InternalCalibration Error Output">The text sent to standard error during the execution of InternalCalibration. (If it appears in gray, it's the output of a previously failing run which is preserved for your trouble shooting.)</view>
    </views>    
</knimeNode>
