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) throw (Exception::FileNotFound) | |
~NMRStarFile () | |
Destructor. | |
Access methods | |
bool | read () throw (Exception::ParseError) |
bool | read (AtomContainer &ac) |
bool | assignShifts (BALLToBMRBMapper &ball_to_bmrb_mapping) |
bool | assignShifts (AtomContainer &ac, 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 |
SampleCondition & | getSampleConditionByName (String name) |
const SampleCondition & | getSampleConditionByName (String name) const |
SampleCondition & | getSampleCondition (Position i) |
Get the i-th SampleCondition. | |
const SampleCondition & | getSampleCondition (Position i) const |
Get the i-th SampleCondition. | |
Size | getNumberOfSampleConditions () const |
Get the number of sample conditions. | |
const std::vector < SampleCondition > & | getSampleConditions () const |
Get the sample conditions. | |
std::vector< SampleCondition > & | getSampleConditions () |
Get the sample conditions. | |
std::vector< Sample > | getSamples () const |
Get the samples. | |
Size | getNumberOfSamples () const |
Get the number of samples. | |
bool | hasSample (String label) const |
Return true if the file contains a sample named label, false otherwise. | |
Sample | getSample (Position i) const |
Sample | getSample (String label) const |
std::vector< ShiftReferenceSet > & | getShiftReferenceSets () |
Get the shift reference sets. | |
const std::vector < ShiftReferenceSet > & | getShiftReferenceSets () const |
Get the shift reference sets. | |
Size | getNumberOfShiftReferenceSets () const |
Get the number of shift reference sets. | |
ShiftReferenceSet & | getShiftReferenceSet (Position i) |
Get the i-th shift reference set. | |
const ShiftReferenceSet & | getShiftReferenceSet (Position i) const |
Get the i-th shift reference set. | |
const ShiftReferenceSet & | getShiftReferenceSetByName (String name) const |
Get a ShiftReferenceSet by its SaveFrame name. | |
ShiftReferenceSet & | getShiftReferenceSetByName (String name) |
Get a ShiftReferenceSet by its SaveFrame name. | |
std::vector< NMRSpectrometer > & | getNMRSpectrometers () |
Get the spectrometers. | |
const std::vector < NMRSpectrometer > & | getNMRSpectrometers () const |
Get the spectrometers. | |
Size | getNumberOfNMRSpectrometers () const |
Get the number of nmr spectrometers. | |
NMRSpectrometer & | getNMRSpectrometer (Position i) |
Get the i-th spectrometer. | |
const NMRSpectrometer & | getNMRSpectrometer (Position i) const |
Get the i-th spectrometer. | |
NMRSpectrometer & | getNMRSpectrometerByName (String name) |
Get the spectrometer by its SaveFrame name. | |
const NMRSpectrometer & | getNMRSpectrometerByName (String name) const |
Get the spectrometer by its SaveFrame name. | |
String | getNMRSpectrometerManufacturer (Position i) const |
Get the spectrometer manufacturer. | |
float | getNMRSpectrometerFieldStrength (Position i) const |
Get the spectrometer field strength. | |
NMRStarFile::MonomericPolymer & | getMonomericPolymer (const String &name) throw (Exception::OutOfRange) |
const NMRStarFile::MonomericPolymer & | getMonomericPolymer (const String &name) const throw (Exception::OutOfRange) |
Size | getNumberOfMonomericPolymers () const |
Get the number of monomeric polymers in the file. | |
vector< MonomericPolymer > | getMonomericPolymers () const |
Get all Monomeric Polymers. | |
bool | hasMonomericPolymer (String name) const |
Check if polymer name is already stored is a monomeric polymer. | |
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. | |
bool | hasCshifts () const |
Check, whether this NMRFile provides carbon shifts. | |
bool | hasNshifts () const |
Check, whether this NMRFile provides nitrogen shifts. | |
Equality | |
bool | operator== (const NMRStarFile &f) |
bool | operator!= (const NMRStarFile &f) |
void | clear () |
Static Public Attributes | |
static const float | FLOAT_VALUE_NA |
static const int | INT_VALUE_NA |
static const Position | POSITION_VALUE_NA |
Private Member Functions | |
void | readEntryInformation_ () |
reads the number of chemical shifts | |
void | readMolSystem_ () |
reads the molecular system name | |
void | readMonomericPolymers_ () |
read the MonomericPolymers | |
void | readSampleConditions_ () |
reads the sample conditions | |
void | readShiftReferences_ () |
reads the shift references | |
void | readShifts_ () |
reads the shift datas | |
void | readSamples_ () |
read the samples | |
void | readNMRSpectrometer_ () |
reads the NMR spectrometer data | |
void | findDependiencies_ () |
find dependencies for the ChemicalUnits | |
void | setSpecialCharacters_ (String characters) |
set the characters denoting single non-available values | |
bool | isValidSingleValue_ (String value) |
check whether the given String denotes a non-available value | |
bool | assignShifts_ (BALLToBMRBMapper &pdb_to_bmrb_mapping) |
Private Attributes | |
bool | valid_ |
Size | number_of_shift_sets_ |
the number of shift data sets | |
Size | number_of_assigned_shifts_ |
the number of assigned shifts during the last call of assignShifts() | |
EntryInformation | entry_information_ |
the general entry data | |
MolecularSystem | molecular_system_ |
the system information | |
std::vector< NMRAtomDataSet > | atom_data_sets_ |
the data for the atoms is stored here | |
std::vector< SampleCondition > | sample_conditions_ |
the data for different sample sets | |
std::vector< Sample > | samples_ |
the samples | |
std::vector< ShiftReferenceSet > | shift_references_ |
the data for shift references | |
std::vector< NMRSpectrometer > | nmr_spectrometers_ |
the data of nmr spectrometers | |
vector< MonomericPolymer > | monomeric_polymers_ |
Monomeric Polymer information. | |
bool | has_H_shifts_ |
stores, which shifts are given in the file | |
bool | has_C_shifts_ |
bool | has_N_shifts_ |
SaveFrame | dummy_saveframe_ |
SampleCondition | dummy_sample_condition_ |
Sample | dummy_sample_ |
ShiftReferenceSet | dummy_shift_reference_set_ |
NMRSpectrometer | dummy_NMR_spectrometer_ |
MonomericPolymer | dummy_monomeric_polymer_ |
String | special_characters_ |
characters, that denote non-available values |
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 BALLToBMRPMapper creates a mapping between NMRStar file atoms and atoms of a chain either based on a trivial mapping
createTrivialMapping() or based on a given alignment
createMapping(). Access to information other than the shifts is provided as well.
Example code:
BALL::System S; pdb >> S; Chain& chain = *(S.beginChain()); NMRStarFile nmr_file("NMRStarFile_test.bmr"); std::cout << nmr_file.getNumberOfSamples() << " " << mr_file.getNumberOfAtoms() << std::endl; std::cout << Peptides::GetSequence(chain) << std::endl; std::cout << nmr_file.getResidueSequence() << std::endl; NMRStarFile::BALLToBMRBMapper mapper(chain, nmr_file); mapper.createMapping("MKSTGIVRKVDELGRVVIPIELRRTLGIAEKDALEIYVDDEKIIL-KKYKPNMT", "AKSTGIVRKVDELGRVVIPIELRRTLGIAEKDALEIYVDDEKIILKK-YKPNMT"); std::cout << mapper.getNumberOfMismatches() << std::endl; nmr_file.assignShifts(mapper); ... std::cout << atom->getProperty(ShiftModule::PROPERTY__EXPERIMENTAL__SHIFT).getFloat() << std::endl; ...
Definition at line 66 of file NMRStarFile.h.
BALL::NMRStarFile::NMRStarFile | ( | ) |
Standard constructor
BALL::NMRStarFile::NMRStarFile | ( | const String & | file_name, | |
File::OpenMode | open_mode = std::ios::in | |||
) | throw (Exception::FileNotFound) |
Detailed constuctor. Opens the given file and extracts all usefull data (Calls read ).
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 | ( | AtomContainer & | ac, | |
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. | |
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 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_ | ( | BALLToBMRBMapper & | pdb_to_bmrb_mapping | ) | [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}
void BALL::NMRStarFile::clear | ( | ) | [virtual] |
Clear the object.
Reimplemented from BALL::File.
void BALL::NMRStarFile::findDependiencies_ | ( | ) | [private] |
find dependencies for the ChemicalUnits
const EntryInformation& BALL::NMRStarFile::getEntryInformation | ( | ) | const [inline] |
Get the entry information
Definition at line 601 of file NMRStarFile.h.
const MolecularSystem& BALL::NMRStarFile::getMolecularInformation | ( | ) | const [inline] |
Get the molecular information
Definition at line 605 of file NMRStarFile.h.
const NMRStarFile::MonomericPolymer& BALL::NMRStarFile::getMonomericPolymer | ( | const String & | name | ) | const throw (Exception::OutOfRange) |
NMRStarFile::MonomericPolymer& BALL::NMRStarFile::getMonomericPolymer | ( | const String & | name | ) | throw (Exception::OutOfRange) |
Get the MonomericPolymer-information by name Throws exception OutOfRange
vector<MonomericPolymer> BALL::NMRStarFile::getMonomericPolymers | ( | ) | const [inline] |
Get all Monomeric Polymers.
Definition at line 706 of file NMRStarFile.h.
const std::vector<NMRAtomDataSet>& BALL::NMRStarFile::getNMRData | ( | ) | const |
Get the extracted data for the atoms
const NMRSpectrometer& BALL::NMRStarFile::getNMRSpectrometer | ( | Position | i | ) | const |
Get the i-th spectrometer.
NMRSpectrometer& BALL::NMRStarFile::getNMRSpectrometer | ( | Position | i | ) |
Get the i-th spectrometer.
const NMRSpectrometer& BALL::NMRStarFile::getNMRSpectrometerByName | ( | String | name | ) | const |
Get the spectrometer by its SaveFrame name.
NMRSpectrometer& BALL::NMRStarFile::getNMRSpectrometerByName | ( | String | name | ) |
Get the spectrometer by its SaveFrame name.
Get the spectrometer field strength.
Get the spectrometer manufacturer.
const std::vector<NMRSpectrometer>& BALL::NMRStarFile::getNMRSpectrometers | ( | ) | const [inline] |
Get the spectrometers.
Definition at line 674 of file NMRStarFile.h.
std::vector<NMRSpectrometer>& BALL::NMRStarFile::getNMRSpectrometers | ( | ) | [inline] |
Get the spectrometers.
Definition at line 672 of file NMRStarFile.h.
Size BALL::NMRStarFile::getNumberOfAtoms | ( | ) | const |
Return the maximum number of atoms in all shift sets
Size BALL::NMRStarFile::getNumberOfMonomericPolymers | ( | ) | const [inline] |
Get the number of monomeric polymers in the file.
Definition at line 703 of file NMRStarFile.h.
Size BALL::NMRStarFile::getNumberOfNMRSpectrometers | ( | ) | const [inline] |
Get the number of nmr spectrometers.
Definition at line 677 of file NMRStarFile.h.
Size BALL::NMRStarFile::getNumberOfSampleConditions | ( | ) | const [inline] |
Get the number of sample conditions.
Definition at line 622 of file NMRStarFile.h.
Size BALL::NMRStarFile::getNumberOfSamples | ( | ) | const [inline] |
Get the number of samples.
Definition at line 637 of file NMRStarFile.h.
Size BALL::NMRStarFile::getNumberOfShiftReferenceSets | ( | ) | const [inline] |
Get the number of shift reference sets.
Definition at line 658 of file NMRStarFile.h.
Size BALL::NMRStarFile::getNumberOfShiftsAssigned | ( | ) | const [inline] |
Return the number of atoms assigned a chemical shift
Definition at line 593 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 sample with name label. If no sample with name label exist a dummy sample is returned.
Get the i-th sample. If i is out of size a dummy sample is returned.
const SampleCondition& BALL::NMRStarFile::getSampleCondition | ( | Position | i | ) | const [inline] |
Get the i-th SampleCondition.
Definition at line 619 of file NMRStarFile.h.
SampleCondition& BALL::NMRStarFile::getSampleCondition | ( | Position | i | ) | [inline] |
Get the i-th SampleCondition.
Definition at line 616 of file NMRStarFile.h.
const SampleCondition& BALL::NMRStarFile::getSampleConditionByName | ( | String | name | ) | const |
Get a SampleCondition by its SaveFrame name
SampleCondition& BALL::NMRStarFile::getSampleConditionByName | ( | String | name | ) |
Get a SampleCondition by its SaveFrame name
std::vector<SampleCondition>& BALL::NMRStarFile::getSampleConditions | ( | ) | [inline] |
Get the sample conditions.
Definition at line 628 of file NMRStarFile.h.
const std::vector<SampleCondition>& BALL::NMRStarFile::getSampleConditions | ( | ) | const [inline] |
Get the sample conditions.
Definition at line 625 of file NMRStarFile.h.
std::vector<Sample> BALL::NMRStarFile::getSamples | ( | ) | const [inline] |
Get the samples.
Definition at line 633 of file NMRStarFile.h.
const ShiftReferenceSet& BALL::NMRStarFile::getShiftReferenceSet | ( | Position | i | ) | const [inline] |
Get the i-th shift reference set.
Definition at line 663 of file NMRStarFile.h.
ShiftReferenceSet& BALL::NMRStarFile::getShiftReferenceSet | ( | Position | i | ) | [inline] |
Get the i-th shift reference set.
Definition at line 661 of file NMRStarFile.h.
ShiftReferenceSet& BALL::NMRStarFile::getShiftReferenceSetByName | ( | String | name | ) |
Get a ShiftReferenceSet by its SaveFrame name.
const ShiftReferenceSet& BALL::NMRStarFile::getShiftReferenceSetByName | ( | String | name | ) | const |
Get a ShiftReferenceSet by its SaveFrame name.
const std::vector<ShiftReferenceSet>& BALL::NMRStarFile::getShiftReferenceSets | ( | ) | const [inline] |
Get the shift reference sets.
Definition at line 655 of file NMRStarFile.h.
std::vector<ShiftReferenceSet>& BALL::NMRStarFile::getShiftReferenceSets | ( | ) | [inline] |
Get the shift reference sets.
Definition at line 653 of file NMRStarFile.h.
bool BALL::NMRStarFile::hasCshifts | ( | ) | const [inline] |
Check, whether this NMRFile provides carbon shifts.
Definition at line 739 of file NMRStarFile.h.
bool BALL::NMRStarFile::hasHshifts | ( | ) | const [inline] |
Check, whether this NMRFile provides hydrogen shifts.
Definition at line 736 of file NMRStarFile.h.
Check if polymer name is already stored is a monomeric polymer.
bool BALL::NMRStarFile::hasNshifts | ( | ) | const [inline] |
Check, whether this NMRFile provides nitrogen shifts.
Definition at line 742 of file NMRStarFile.h.
Return true if the file contains a sample named label, false otherwise.
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.
bool BALL::NMRStarFile::read | ( | AtomContainer & | ac | ) |
bool BALL::NMRStarFile::read | ( | ) | throw (Exception::ParseError) [virtual] |
Read an NMRStarFile.
Reimplemented from BALL::CIFFile.
void BALL::NMRStarFile::readEntryInformation_ | ( | ) | [private] |
reads the number of chemical shifts
void BALL::NMRStarFile::readMolSystem_ | ( | ) | [private] |
reads the molecular system name
void BALL::NMRStarFile::readMonomericPolymers_ | ( | ) | [private] |
read the MonomericPolymers
void BALL::NMRStarFile::readNMRSpectrometer_ | ( | ) | [private] |
reads the NMR spectrometer data
void BALL::NMRStarFile::readSampleConditions_ | ( | ) | [private] |
reads the sample conditions
void BALL::NMRStarFile::readSamples_ | ( | ) | [private] |
read the samples
void BALL::NMRStarFile::readShiftReferences_ | ( | ) | [private] |
reads the shift references
void BALL::NMRStarFile::readShifts_ | ( | ) | [private] |
reads the shift datas
void BALL::NMRStarFile::setSpecialCharacters_ | ( | String | characters | ) | [private] |
set the characters denoting single non-available values
std::vector<NMRAtomDataSet> BALL::NMRStarFile::atom_data_sets_ [private] |
the data for the atoms is stored here
Definition at line 837 of file NMRStarFile.h.
Definition at line 875 of file NMRStarFile.h.
Definition at line 872 of file NMRStarFile.h.
Sample BALL::NMRStarFile::dummy_sample_ [private] |
Definition at line 866 of file NMRStarFile.h.
Definition at line 863 of file NMRStarFile.h.
SaveFrame BALL::NMRStarFile::dummy_saveframe_ [private] |
Definition at line 860 of file NMRStarFile.h.
Definition at line 869 of file NMRStarFile.h.
the general entry data
Definition at line 831 of file NMRStarFile.h.
const float BALL::NMRStarFile::FLOAT_VALUE_NA [static] |
Definition at line 72 of file NMRStarFile.h.
bool BALL::NMRStarFile::has_C_shifts_ [private] |
Definition at line 856 of file NMRStarFile.h.
bool BALL::NMRStarFile::has_H_shifts_ [private] |
stores, which shifts are given in the file
Definition at line 855 of file NMRStarFile.h.
bool BALL::NMRStarFile::has_N_shifts_ [private] |
Definition at line 857 of file NMRStarFile.h.
const int BALL::NMRStarFile::INT_VALUE_NA [static] |
Definition at line 73 of file NMRStarFile.h.
the system information
Definition at line 834 of file NMRStarFile.h.
vector<MonomericPolymer> BALL::NMRStarFile::monomeric_polymers_ [private] |
Monomeric Polymer information.
Definition at line 852 of file NMRStarFile.h.
std::vector<NMRSpectrometer> BALL::NMRStarFile::nmr_spectrometers_ [private] |
the data of nmr spectrometers
Definition at line 849 of file NMRStarFile.h.
the number of assigned shifts during the last call of assignShifts()
Definition at line 828 of file NMRStarFile.h.
Size BALL::NMRStarFile::number_of_shift_sets_ [private] |
the number of shift data sets
Definition at line 825 of file NMRStarFile.h.
const Position BALL::NMRStarFile::POSITION_VALUE_NA [static] |
Definition at line 75 of file NMRStarFile.h.
std::vector<SampleCondition> BALL::NMRStarFile::sample_conditions_ [private] |
the data for different sample sets
Definition at line 840 of file NMRStarFile.h.
std::vector<Sample> BALL::NMRStarFile::samples_ [private] |
the samples
Definition at line 843 of file NMRStarFile.h.
std::vector<ShiftReferenceSet> BALL::NMRStarFile::shift_references_ [private] |
the data for shift references
Definition at line 846 of file NMRStarFile.h.
String BALL::NMRStarFile::special_characters_ [private] |
characters, that denote non-available values
Definition at line 878 of file NMRStarFile.h.
bool BALL::NMRStarFile::valid_ [private] |
Definition at line 822 of file NMRStarFile.h.