BALL
1.4.2
|
This class provides methods for reading and assigning chemical shifts. More...
#include <BALL/FORMAT/NMRStarFile.h>
Classes | |
class | BALLToBMRBMapper |
class | EntryInformation |
class | MolecularSystem |
class | MonomericPolymer |
class | NMRAtomData |
class | NMRAtomDataSet |
class | NMRSpectrometer |
class | Sample |
class | SampleCondition |
class | ShiftReferenceElement |
class | ShiftReferenceSet |
Public Member Functions | |
Constructors and Destructors | |
NMRStarFile () | |
NMRStarFile (const String &file_name, File::OpenMode open_mode=std::ios::in) | |
~NMRStarFile () | |
Destructor. More... | |
Access methods | |
bool | read () |
bool | read (AtomContainer &ac) |
bool | assignShifts (BALLToBMRBMapper &ball_to_bmrb_mapping) |
bool | assignShifts (AtomContainer &ac, const String &chemical_unit, const String &aligned_ball_sequence, const String &aligned_nmrstar_sequence) |
Size | getNumberOfAtoms () const |
Size | getNumberOfShiftsAssigned () const |
const std::vector < NMRAtomDataSet > & | getNMRData () const |
const EntryInformation & | getEntryInformation () const |
const MolecularSystem & | getMolecularInformation () const |
MolecularSystem & | getMolecularInformation () |
const MolecularSystem::ChemicalUnit & | getChemicalUnitByLabel (String const &label) const |
MolecularSystem::ChemicalUnit & | getChemicalUnitByLabel (String const &label) |
bool | hasSampleCondition (String name) |
bool | hasSampleCondition (String name) const |
SampleCondition & | getSampleConditionByName (String name) |
const SampleCondition & | getSampleConditionByName (String name) const |
SampleCondition & | getSampleCondition (Position i) |
Get the i-th SampleCondition. More... | |
const SampleCondition & | getSampleCondition (Position i) const |
Get the i-th SampleCondition. More... | |
Size | getNumberOfSampleConditions () const |
Get the number of sample conditions. More... | |
const std::vector < SampleCondition > & | getSampleConditions () const |
Get the sample conditions. More... | |
std::vector< SampleCondition > & | getSampleConditions () |
Get the sample conditions. More... | |
std::vector< Sample > | getSamples () const |
Get the samples. More... | |
Size | getNumberOfSamples () const |
Get the number of samples. More... | |
bool | hasSample (String label) const |
Return true if the file contains a sample named label, false otherwise. More... | |
Sample | getSample (Position i) const |
Sample | getSample (String label) const |
std::vector< ShiftReferenceSet > & | getShiftReferenceSets () |
Get the shift reference sets. More... | |
const std::vector < ShiftReferenceSet > & | getShiftReferenceSets () const |
Get the shift reference sets. More... | |
Size | getNumberOfShiftReferenceSets () const |
Get the number of shift reference sets. More... | |
bool | hasShiftReferenceSet (String name) |
Check if there is a ShiftReferenceSet named name. More... | |
ShiftReferenceSet & | getShiftReferenceSet (Position i) |
Get the i-th shift reference set. More... | |
const ShiftReferenceSet & | getShiftReferenceSet (Position i) const |
Get the i-th shift reference set. More... | |
const ShiftReferenceSet & | getShiftReferenceSetByName (String name) const |
Get a ShiftReferenceSet by its SaveFrame name. More... | |
ShiftReferenceSet & | getShiftReferenceSetByName (String name) |
Get a ShiftReferenceSet by its SaveFrame name. More... | |
std::vector< NMRSpectrometer > & | getNMRSpectrometers () |
Get the spectrometers. More... | |
const std::vector < NMRSpectrometer > & | getNMRSpectrometers () const |
Get the spectrometers. More... | |
Size | getNumberOfNMRSpectrometers () const |
Get the number of nmr spectrometers. More... | |
NMRSpectrometer & | getNMRSpectrometer (Position i) |
Get the i-th spectrometer. More... | |
const NMRSpectrometer & | getNMRSpectrometer (Position i) const |
Get the i-th spectrometer. More... | |
NMRSpectrometer & | getNMRSpectrometerByName (String name) |
Get the spectrometer by its SaveFrame name. More... | |
const NMRSpectrometer & | getNMRSpectrometerByName (String name) const |
Get the spectrometer by its SaveFrame name. More... | |
String | getNMRSpectrometerManufacturer (Position i) const |
Get the spectrometer manufacturer. More... | |
float | getNMRSpectrometerFieldStrength (Position i) const |
Get the spectrometer field strength. More... | |
NMRStarFile::MonomericPolymer & | getMonomericPolymer (Position i) |
const NMRStarFile::MonomericPolymer & | getMonomericPolymer (Position i) const |
NMRStarFile::MonomericPolymer & | getMonomericPolymer (const String &name) |
const NMRStarFile::MonomericPolymer & | getMonomericPolymer (const String &name) const |
Size | getNumberOfMonomericPolymers () const |
Get the number of monomeric polymers in the file. More... | |
vector< MonomericPolymer > | getMonomericPolymers () const |
Get all Monomeric Polymers. More... | |
bool | hasMonomericPolymer (String name) const |
Check if polymer name is already stored is a monomeric polymer. More... | |
bool | isMonomericPolymer (String chemical_unit_label) |
void | addMonomericPolymer (MonomericPolymer mp) |
String | getResidueSequence (Position i=0) const |
bool | hasHshifts () const |
Check, whether this NMRFile provides hydrogen shifts. More... | |
bool | hasCshifts () const |
Check, whether this NMRFile provides carbon shifts. More... | |
bool | hasNshifts () const |
Check, whether this NMRFile provides nitrogen shifts. More... | |
Equality | |
bool | operator== (const NMRStarFile &f) |
bool | operator!= (const NMRStarFile &f) |
void | clear () |
Public Member Functions inherited from BALL::CIFFile | |
CIFFile () | |
CIFFile (const String &filename, File::OpenMode open_mode=std::ios::in) | |
virtual | ~CIFFile () |
virtual bool | write () |
void | inSafeframe (const char *name) |
void | inItem (const char *name) |
void | inDatablock (const char *name) |
void | insertDatablock (const Datablock &datablock) |
const Datablock & | getDatablock (const String &name) const |
Datablock & | getDatablock (const String &name) |
bool | hasDatablock (const String &name) const |
void | setMolecule (Molecule *molecule) |
void | clearParameters () |
Public Member Functions inherited from BALL::File | |
File () | |
File (const String &name, OpenMode open_mode=std::ios::in) | |
virtual | ~File () |
bool | isValid () const |
bool | open (const String &name, File::OpenMode open_mode=std::ios::in) |
bool | reopen () |
bool | reopen (File::OpenMode open_mode) |
void | close () |
const String & | getName () const |
void | setName (const String &name) |
const String & | getOriginalName () const |
Size | getSize () |
File::OpenMode | getOpenMode () const |
Type | getType (bool trace_link) const |
bool | copyTo (const String &destination_name, Size buffer_size=4096) |
bool | moveTo (const String &destination_name) |
bool | remove () |
bool | renameTo (const String &new_path) |
bool | truncate (Size size=0) |
std::fstream & | getFileStream () |
TransformationManager & | getTransformationManager () |
const TransformationManager & | getTransformationManager () const |
bool | operator== (const File &file) const |
bool | operator!= (const File &file) const |
bool | isOpen () const |
bool | isClosed () const |
bool | isAccessible () const |
bool | isCanonized () const |
bool | isReadable () const |
bool | isWritable () const |
bool | isExecutable () const |
Static Public Attributes | |
static const float | FLOAT_VALUE_NA |
static const int | INT_VALUE_NA |
static const Position | POSITION_VALUE_NA |
Static Public Attributes inherited from BALL::CIFFile | |
static State | state |
Static Public Attributes inherited from BALL::File | |
static const OpenMode | MODE_IN |
Open for input (default) More... | |
static const OpenMode | MODE_OUT |
Open for output. More... | |
static const OpenMode | MODE_APP |
Append. Seek to end before each write operation. More... | |
static const OpenMode | MODE_BINARY |
Binary mode. More... | |
static const OpenMode | MODE_ATE |
Seek to end directly after opening. More... | |
static const OpenMode | MODE_TRUNC |
Truncate an existing file. More... | |
static const String | TRANSFORMATION_EXEC_PREFIX |
Prefix for filenames that are created through the execution of commands "exec:". More... | |
static const String | TRANSFORMATION_FILE_PREFIX |
Prefix for files (to mimick URL-like behavior) "file:". More... | |
static const String | TRANSFORMATION_FTP_PREFIX |
Prefix for FTP-transfers "ftp://". More... | |
static const String | TRANSFORMATION_HTTP_PREFIX |
Prefix for HTTP-transfer "http://". More... | |
Private Member Functions | |
void | readEntryInformation_ () |
reads the number of chemical shifts More... | |
void | readMolSystem_ () |
reads the molecular system name More... | |
void | readMonomericPolymers_ () |
read the MonomericPolymers More... | |
void | readSampleConditions_ () |
reads the sample conditions More... | |
void | readShiftReferences_ () |
reads the shift references More... | |
void | readShifts_ () |
reads the shift datas More... | |
void | readSamples_ () |
read the samples More... | |
void | readNMRSpectrometer_ () |
reads the NMR spectrometer data More... | |
void | findDependiencies_ () |
find dependencies for the ChemicalUnits More... | |
void | setSpecialCharacters_ (String characters) |
set the characters denoting single non-available values More... | |
bool | isValidSingleValue_ (String value) |
check whether the given String denotes a non-available value More... | |
float | valueToFloat_ (String value) |
returns the value as float, if it is a valid one, or FLOAT_VALUE_NA More... | |
int | valueToInt_ (String value) |
returns the value as int, if it is a valid one, or INT_VALUE_NA More... | |
bool | assignShifts_ (BALLToBMRBMapper &pdb_to_bmrb_mapping) |
This class provides methods for reading and assigning chemical shifts.
NMRStarFile class.
This class provides methods for reading and assigning experimental chemical shifts from NMRStar files to peptides. The nested class BALLToBMRBMapper creates a mapping between NMRStar file atoms and atoms of a chain either based on a trivial mapping
Example code:
Definition at line 113 of file NMRStarFile.h.
BALL::NMRStarFile::NMRStarFile | ( | ) |
Standard constructor
BALL::NMRStarFile::NMRStarFile | ( | const String & | file_name, |
File::OpenMode | open_mode = std::ios::in |
||
) |
Detailed constuctor. Opens the given file and extracts all usefull data (Calls read ).
Exception::FileNotFound | if the file could not be opened |
BALL::NMRStarFile::~NMRStarFile | ( | ) |
Destructor.
void BALL::NMRStarFile::addMonomericPolymer | ( | MonomericPolymer | mp | ) |
Add a Monomeric Polymer NOTE: if a poymer with the same name already exists, it will be overwritten!
bool BALL::NMRStarFile::assignShifts | ( | BALLToBMRBMapper & | ball_to_bmrb_mapping | ) |
Assign the shifts to the given AtomContainer as denoted in the given {BALLToBMRBMapper}.
true
if reading the file was successful bool BALL::NMRStarFile::assignShifts | ( | AtomContainer & | ac, |
const String & | chemical_unit, | ||
const String & | aligned_ball_sequence, | ||
const String & | aligned_nmrstar_sequence | ||
) |
Assign the shifts to the given AtomContainer as pointed out in the alignment. The alignmed sequences should be given in OneLetterCode, where '-' denotes a gap.
ac | AtomContainer to which the NMRStarfile's shift should be assigned. |
chemical_unit | the name of the molecular system (chemical unit) storing the atom shifts |
aligned_ball_sequence | the aligned AtomContainers aminoacid sequence |
aligned_nmrstar_sequence | the aligned aminoacid sequence of the NMRStar file atoms |
true
if reading the file was successful
|
private |
Apply the shifts read into the AtomContainer as denoted in the mapping. We assume, that the file was already read! The shifts are stored as a property under the key {BALL::ShiftModule::PROPERTY__EXPERIMENTAL__SHIFT}
|
virtual |
Clear the object.
Reimplemented from BALL::File.
|
private |
find dependencies for the ChemicalUnits
const MolecularSystem::ChemicalUnit& BALL::NMRStarFile::getChemicalUnitByLabel | ( | String const & | label | ) | const |
Get a chemical unit by name
MolecularSystem::ChemicalUnit& BALL::NMRStarFile::getChemicalUnitByLabel | ( | String const & | label | ) |
Get a chemical unit by name
|
inline |
Get the entry information
Definition at line 678 of file NMRStarFile.h.
|
inline |
Get the molecular information
Definition at line 682 of file NMRStarFile.h.
|
inline |
Get the molecular information
Definition at line 686 of file NMRStarFile.h.
NMRStarFile::MonomericPolymer& BALL::NMRStarFile::getMonomericPolymer | ( | Position | i | ) |
Get a mutable reference to the MonomericPolymer-information by index
Exception::OutOfRange | if a polymer with this index could not be found |
const NMRStarFile::MonomericPolymer& BALL::NMRStarFile::getMonomericPolymer | ( | Position | i | ) | const |
Get the MonomericPolymer-information by index
Exception::OutOfRange | if a polymer with this index could not be found |
NMRStarFile::MonomericPolymer& BALL::NMRStarFile::getMonomericPolymer | ( | const String & | name | ) |
Get a mutable reference to the MonomericPolymer-information by name
Exception::OutOfRange | if a polymer with this name could not be found |
const NMRStarFile::MonomericPolymer& BALL::NMRStarFile::getMonomericPolymer | ( | const String & | name | ) | const |
Get the MonomericPolymer-information by name
Exception::OutOfRange | if a polymer with this name could not be found |
|
inline |
Get all Monomeric Polymers.
Definition at line 822 of file NMRStarFile.h.
const std::vector<NMRAtomDataSet>& BALL::NMRStarFile::getNMRData | ( | ) | const |
Get the extracted data for the atoms
NMRSpectrometer& BALL::NMRStarFile::getNMRSpectrometer | ( | Position | i | ) |
Get the i-th spectrometer.
const NMRSpectrometer& BALL::NMRStarFile::getNMRSpectrometer | ( | Position | i | ) | const |
Get the i-th spectrometer.
NMRSpectrometer& BALL::NMRStarFile::getNMRSpectrometerByName | ( | String | name | ) |
Get the spectrometer by its SaveFrame name.
const NMRSpectrometer& BALL::NMRStarFile::getNMRSpectrometerByName | ( | String | name | ) | const |
Get the spectrometer by its SaveFrame name.
Get the spectrometer field strength.
Get the spectrometer manufacturer.
|
inline |
Get the spectrometers.
Definition at line 774 of file NMRStarFile.h.
|
inline |
Get the spectrometers.
Definition at line 776 of file NMRStarFile.h.
Size BALL::NMRStarFile::getNumberOfAtoms | ( | ) | const |
Return the maximum number of atoms in all shift sets
|
inline |
Get the number of monomeric polymers in the file.
Definition at line 819 of file NMRStarFile.h.
|
inline |
Get the number of nmr spectrometers.
Definition at line 779 of file NMRStarFile.h.
|
inline |
Get the number of sample conditions.
Definition at line 721 of file NMRStarFile.h.
|
inline |
Get the number of samples.
Definition at line 736 of file NMRStarFile.h.
|
inline |
Get the number of shift reference sets.
Definition at line 757 of file NMRStarFile.h.
|
inline |
Return the number of atoms assigned a chemical shift
Definition at line 670 of file NMRStarFile.h.
Get the sequence of residues of the i-th monomeric polymer in the file.
This method automatically compares the i-th monomeric_polymers' residue sequence with the actual stored NMR shift data. If there is a mismatch, a warning is given! If there is a mismatch or there is no monomeric_polymers residue sequence an empty.
Get the i-th sample. If i is out of size a dummy sample is returned.
Get the sample with name label. If no sample with name label exist a dummy sample is returned.
|
inline |
Get the i-th SampleCondition.
Definition at line 715 of file NMRStarFile.h.
|
inline |
Get the i-th SampleCondition.
Definition at line 718 of file NMRStarFile.h.
SampleCondition& BALL::NMRStarFile::getSampleConditionByName | ( | String | name | ) |
Get a SampleCondition by its SaveFrame name
const SampleCondition& BALL::NMRStarFile::getSampleConditionByName | ( | String | name | ) | const |
Get a SampleCondition by its SaveFrame name
|
inline |
Get the sample conditions.
Definition at line 724 of file NMRStarFile.h.
|
inline |
Get the sample conditions.
Definition at line 727 of file NMRStarFile.h.
|
inline |
Get the samples.
Definition at line 732 of file NMRStarFile.h.
|
inline |
Get the i-th shift reference set.
Definition at line 763 of file NMRStarFile.h.
|
inline |
Get the i-th shift reference set.
Definition at line 765 of file NMRStarFile.h.
const ShiftReferenceSet& BALL::NMRStarFile::getShiftReferenceSetByName | ( | String | name | ) | const |
Get a ShiftReferenceSet by its SaveFrame name.
ShiftReferenceSet& BALL::NMRStarFile::getShiftReferenceSetByName | ( | String | name | ) |
Get a ShiftReferenceSet by its SaveFrame name.
|
inline |
Get the shift reference sets.
Definition at line 752 of file NMRStarFile.h.
|
inline |
Get the shift reference sets.
Definition at line 754 of file NMRStarFile.h.
|
inline |
Check, whether this NMRFile provides carbon shifts.
Definition at line 855 of file NMRStarFile.h.
|
inline |
Check, whether this NMRFile provides hydrogen shifts.
Definition at line 852 of file NMRStarFile.h.
Check if polymer name is already stored is a monomeric polymer.
|
inline |
Check, whether this NMRFile provides nitrogen shifts.
Definition at line 858 of file NMRStarFile.h.
Return true if the file contains a sample named label, false otherwise.
Return true if the file contains a SampleCondition named name, false otherwise
Return true if the file contains a SampleCondition named name, false otherwise
Check if there is a ShiftReferenceSet named name.
Check if label is a monomeric polymer.
Returns true if a monomer with name chemical_unit_label exists, false otherwise.
check whether the given String denotes a non-available value
bool BALL::NMRStarFile::operator!= | ( | const NMRStarFile & | f | ) |
Inequality operator Test if both instances point to different files.
bool BALL::NMRStarFile::operator== | ( | const NMRStarFile & | f | ) |
Equality operator. Test if both instances point to the same file.
|
virtual |
Read an NMRStarFile.
Exception::ParseError | if a syntax error was encountered |
Reimplemented from BALL::CIFFile.
bool BALL::NMRStarFile::read | ( | AtomContainer & | ac | ) |
|
private |
reads the number of chemical shifts
|
private |
reads the molecular system name
|
private |
read the MonomericPolymers
|
private |
reads the NMR spectrometer data
|
private |
reads the sample conditions
|
private |
read the samples
|
private |
reads the shift references
|
private |
reads the shift datas
|
private |
set the characters denoting single non-available values
returns the value as float, if it is a valid one, or FLOAT_VALUE_NA
|
private |
returns the value as int, if it is a valid one, or INT_VALUE_NA
|
private |
the data for the atoms is stored here
Definition at line 957 of file NMRStarFile.h.
|
private |
Definition at line 995 of file NMRStarFile.h.
|
private |
Definition at line 992 of file NMRStarFile.h.
|
private |
Definition at line 986 of file NMRStarFile.h.
|
private |
Definition at line 983 of file NMRStarFile.h.
|
private |
Definition at line 980 of file NMRStarFile.h.
|
private |
Definition at line 989 of file NMRStarFile.h.
|
private |
the general entry data
Definition at line 951 of file NMRStarFile.h.
|
static |
Definition at line 119 of file NMRStarFile.h.
|
private |
Definition at line 976 of file NMRStarFile.h.
|
private |
stores, which shifts are given in the file
Definition at line 975 of file NMRStarFile.h.
|
private |
Definition at line 977 of file NMRStarFile.h.
|
static |
Definition at line 120 of file NMRStarFile.h.
|
private |
the system information
Definition at line 954 of file NMRStarFile.h.
|
private |
Monomeric Polymer information.
Definition at line 972 of file NMRStarFile.h.
|
private |
the data of nmr spectrometers
Definition at line 969 of file NMRStarFile.h.
|
private |
the number of assigned shifts during the last call of assignShifts()
Definition at line 948 of file NMRStarFile.h.
|
private |
the number of shift data sets
Definition at line 945 of file NMRStarFile.h.
|
static |
Definition at line 122 of file NMRStarFile.h.
|
private |
the data for different sample sets
Definition at line 960 of file NMRStarFile.h.
|
private |
the samples
Definition at line 963 of file NMRStarFile.h.
|
private |
the data for shift references
Definition at line 966 of file NMRStarFile.h.
|
private |
characters, that denote non-available values
Definition at line 998 of file NMRStarFile.h.
|
private |
Definition at line 942 of file NMRStarFile.h.