This class can convert TraML and TSV files into each other. More...
#include <OpenMS/ANALYSIS/OPENSWATH/TransitionTSVReader.h>
Classes | |
struct | TSVTransition |
Internal structure to represent a transition. More... | |
Public Member Functions | |
void | convertTargetedExperimentToTSV (const char *filename, OpenMS::TargetedExperiment &targeted_exp) |
Write out a targeted experiment (TraML structure) into a tsv file. More... | |
void | convertTSVToTargetedExperiment (const char *filename, FileTypes::Type filetype, OpenMS::TargetedExperiment &targeted_exp) |
Read in a tsv/mrm file and construct a targeted experiment (TraML structure) More... | |
void | convertTSVToTargetedExperiment (const char *filename, FileTypes::Type filetype, OpenSwath::LightTargetedExperiment &targeted_exp) |
Read in a tsv file and construct a targeted experiment (Light transition structure) More... | |
void | validateTargetedExperiment (OpenMS::TargetedExperiment &targeted_exp) |
Validate a TargetedExperiment (check that all ids are unique) More... | |
TransitionTSVReader () | |
Constructor. More... | |
~TransitionTSVReader () | |
Destructor. More... | |
Public Member Functions inherited from ProgressLogger | |
ProgressLogger () | |
Constructor. More... | |
~ProgressLogger () | |
Destructor. More... | |
ProgressLogger (const ProgressLogger &other) | |
Copy constructor. More... | |
ProgressLogger & | operator= (const ProgressLogger &other) |
Assignment Operator. More... | |
void | setLogType (LogType type) const |
Sets the progress log that should be used. The default type is NONE! More... | |
LogType | getLogType () const |
Returns the type of progress log being used. More... | |
void | startProgress (SignedSize begin, SignedSize end, const String &label) const |
Initializes the progress display. More... | |
void | setProgress (SignedSize value) const |
Sets the current progress. More... | |
void | endProgress () const |
Ends the progress display. More... | |
Public Member Functions inherited from DefaultParamHandler | |
DefaultParamHandler (const String &name) | |
Constructor with name that is displayed in error messages. More... | |
DefaultParamHandler (const DefaultParamHandler &rhs) | |
Copy constructor. More... | |
virtual | ~DefaultParamHandler () |
Destructor. More... | |
virtual DefaultParamHandler & | operator= (const DefaultParamHandler &rhs) |
Assignment operator. More... | |
virtual bool | operator== (const DefaultParamHandler &rhs) const |
Equality operator. More... | |
void | setParameters (const Param ¶m) |
Sets the parameters. More... | |
const Param & | getParameters () const |
Non-mutable access to the parameters. More... | |
const Param & | getDefaults () const |
Non-mutable access to the default parameters. More... | |
const String & | getName () const |
Non-mutable access to the name. More... | |
void | setName (const String &name) |
Mutable access to the name. More... | |
const std::vector< String > & | getSubsections () const |
Non-mutable access to the registered subsections. More... | |
Protected Member Functions | |
void | TSVToTargetedExperiment_ (std::vector< TSVTransition > &transition_list, OpenMS::TargetedExperiment &exp) |
Convert a list of TSVTransition to a TargetedExperiment. More... | |
void | TSVToTargetedExperiment_ (std::vector< TSVTransition > &transition_list, OpenSwath::LightTargetedExperiment &exp) |
Convert a list of TSVTransition to a LightTargetedExperiment. More... | |
Protected Member Functions inherited from DefaultParamHandler | |
void | defaultsToParam_ () |
Updates the parameters after the defaults have been set in the constructor. More... | |
Private Member Functions | |
void | writeTSVOutput_ (const char *filename, OpenMS::TargetedExperiment &targeted_exp) |
Write a TargetedExperiment to a file. More... | |
Conversion functions from TSVTransition objects to TraML datastructures | |
These functions convert the relevant data from a TSVTransition to the datastructures used by the TraML handler, namely ReactionMonitoringTransition, TargetedExperiment::Protein and TargetedExperiment::Peptide. | |
typedef std::vector< OpenMS::TargetedExperiment::Protein > | ProteinVectorType |
Typedefs. More... | |
typedef std::vector< OpenMS::TargetedExperiment::Peptide > | PeptideVectorType |
typedef std::vector< OpenMS::ReactionMonitoringTransition > | TransitionVectorType |
String | retentionTimeInterpretation_ |
Members. More... | |
bool | override_group_label_check_ |
bool | force_invalid_mods_ |
static const char * | strarray_ [] |
static const std::vector< std::string > | header_names_ |
TransitionTSVReader::TSVTransition | convertTransition_ (const ReactionMonitoringTransition *it, OpenMS::TargetedExperiment &targeted_exp) |
void | updateMembers_ () |
Synchronize members with param class. More... | |
void | getTSVHeader_ (const std::string &line, char &delimiter, std::vector< std::string > header, std::map< std::string, int > &header_dict) |
Determine separator in a CSV file and check for correct headers. More... | |
void | readUnstructuredTSVInput_ (const char *filename, FileTypes::Type filetype, std::vector< TSVTransition > &transition_list) |
Read tab or comma separated input with columns defined by their column headers only. More... | |
void | cleanupTransitions_ (TSVTransition &mytransition) |
Cleanup of the read fields (removing quotes etc.) More... | |
void | resolveMixedSequenceGroups_ (std::vector< TSVTransition > &transition_list) |
void | createTransition_ (std::vector< TSVTransition >::iterator &tr_it, OpenMS::ReactionMonitoringTransition &rm_trans) |
Populate a new ReactionMonitoringTransition object from a row in the csv. More... | |
void | createProtein_ (std::vector< TSVTransition >::iterator &tr_it, OpenMS::TargetedExperiment::Protein &protein) |
Populate a new TargetedExperiment::Protein object from a row in the csv. More... | |
void | interpretRetentionTime_ (std::vector< TargetedExperiment::RetentionTime > &retention_times, const OpenMS::DataValue rt_value) |
Helper function to assign retention times to compounds and peptides. More... | |
void | createPeptide_ (std::vector< TSVTransition >::iterator &tr_it, OpenMS::TargetedExperiment::Peptide &peptide) |
Populate a new TargetedExperiment::Peptide object from a row in the csv. More... | |
void | createCompound_ (std::vector< TSVTransition >::iterator &tr_it, OpenMS::TargetedExperiment::Compound &compound) |
Populate a new TargetedExperiment::Compound object (a metabolite) from a row in the csv. More... | |
void | addModification_ (std::vector< TargetedExperiment::Peptide::Modification > &mods, int location, const ResidueModification &rmod) |
Additional Inherited Members | |
Public Types inherited from ProgressLogger | |
enum | LogType { CMD, GUI, NONE } |
Possible log types. More... | |
Static Protected Member Functions inherited from ProgressLogger | |
static String | logTypeToFactoryName_ (LogType type) |
Return the name of the factory product used for this log type. More... | |
Protected Attributes inherited from ProgressLogger | |
LogType | type_ |
time_t | last_invoke_ |
ProgressLoggerImpl * | current_logger_ |
Protected Attributes inherited from DefaultParamHandler | |
Param | param_ |
Container for current parameters. More... | |
Param | defaults_ |
Container for default parameters. This member should be filled in the constructor of derived classes! More... | |
std::vector< String > | subsections_ |
Container for registered subsections. This member should be filled in the constructor of derived classes! More... | |
String | error_name_ |
Name that is displayed in error messages during the parameter checking. More... | |
bool | check_defaults_ |
If this member is set to false no checking if parameters in done;. More... | |
bool | warn_empty_defaults_ |
If this member is set to false no warning is emitted when defaults are empty;. More... | |
Static Protected Attributes inherited from ProgressLogger | |
static int | recursion_depth_ |
This class can convert TraML and TSV files into each other.
The TSV are tab-separated and need to have the following columns:
PrecursorMz (float) ProductMz (float) Tr_calibrated (float) transition_name (free text, needs to be unique for each transition [in this file]) CE (float) LibraryIntensity (float) transition_group_id (free text, designates the transition group [e.g. peptide] to which this transition belongs) decoy (1==decoy, 0== no decoy; determines whether the transition is a decoy transition or not) PeptideSequence (free text, sequence only (no modifications) ) ProteinName (free text) Annotation (free text, e.g. y7) FullUniModPeptideName (free text, should contain modifications*) MissedCleavages Replicates NrModifications PrecursorCharge (integer) PeptideGroupLabel (free text, designates to which peptide label group (as defined in MS:1000893) the peptide belongs to) LabelType (free text, optional description of which label was used, e.g. heavy or light) detecting_transition (bool, should this transition be used for peak-picking (detection) of the peak group?) identifying_transition (bool, should this transition be used for UIS identification together with the detecting transitions?) quantifying_transition (bool, should this transition be used for quantification?)
|
private |
|
private |
Typedefs.
|
private |
Constructor.
~TransitionTSVReader | ( | ) |
Destructor.
|
private |
|
private |
Cleanup of the read fields (removing quotes etc.)
void convertTargetedExperimentToTSV | ( | const char * | filename, |
OpenMS::TargetedExperiment & | targeted_exp | ||
) |
Write out a targeted experiment (TraML structure) into a tsv file.
filename | The output file |
targeted_exp | The targeted experiment |
|
protected |
void convertTSVToTargetedExperiment | ( | const char * | filename, |
FileTypes::Type | filetype, | ||
OpenMS::TargetedExperiment & | targeted_exp | ||
) |
Read in a tsv/mrm file and construct a targeted experiment (TraML structure)
filename | The input file |
filetype | The type of file ("mrm" or "tsv") |
targeted_exp | The output targeted experiment |
Referenced by SortPairDoubleByFirst().
void convertTSVToTargetedExperiment | ( | const char * | filename, |
FileTypes::Type | filetype, | ||
OpenSwath::LightTargetedExperiment & | targeted_exp | ||
) |
Read in a tsv file and construct a targeted experiment (Light transition structure)
filename | The input file |
filetype | The type of file ("mrm" or "tsv") |
targeted_exp | The output targeted experiment |
|
private |
Populate a new TargetedExperiment::Compound object (a metabolite) from a row in the csv.
|
private |
Populate a new TargetedExperiment::Peptide object from a row in the csv.
|
private |
Populate a new TargetedExperiment::Protein object from a row in the csv.
|
private |
Populate a new ReactionMonitoringTransition object from a row in the csv.
|
private |
Determine separator in a CSV file and check for correct headers.
line | The header to be parsed |
delimiter | The delimiter which will be determined from the input |
header | The fields of the header |
header_dict | The map which maps the fields in the header to their position |
|
private |
Helper function to assign retention times to compounds and peptides.
|
private |
Read tab or comma separated input with columns defined by their column headers only.
filename | The input file |
filetype | The type of file ("mrm" or "tsv") |
transition_list | The output list of transitions |
|
private |
Resolve cases where the same peptide label group has different sequences.
Since members in a peptide label group (MS:1000893) should only be isotopically modified forms of the same peptide, having different peptide sequences (different AA order) within the same group most likely constitutes an error. This function will fix the error by erasing the provided "peptide group label" for a peptide and replace it with the peptide id (transition group id).
transition_list | The list of read transitions to be fixed. |
|
protected |
Convert a list of TSVTransition to a TargetedExperiment.
Converts the list (read from csv/mrm) file into a object model using the TargetedExperiment with proper hierarchical structure from Transition to Peptide to Protein.
|
protected |
Convert a list of TSVTransition to a LightTargetedExperiment.
Converts the list (read from csv/mrm) file into a object model using the LightTargetedExperiment with proper hierarchical structure from Transition to Peptide to Protein.
|
protectedvirtual |
Synchronize members with param class.
Reimplemented from DefaultParamHandler.
void validateTargetedExperiment | ( | OpenMS::TargetedExperiment & | targeted_exp | ) |
Validate a TargetedExperiment (check that all ids are unique)
|
private |
Write a TargetedExperiment to a file.
filename | Name of the output file |
targeted_exp | The data structure to be written to the file |
|
private |
|
staticprivate |
|
private |
|
private |
Members.
|
staticprivate |
OpenMS / TOPP release 2.3.0 | Documentation generated on Tue Jan 9 2018 18:22:14 using doxygen 1.8.13 |