BALL::NMRStarFile Class Reference

This class provides methods for reading and assigning chemical shifts. More...

#include <BALL/FORMAT/NMRStarFile.h>

Inheritance diagram for BALL::NMRStarFile:
BALL::CIFFile BALL::File

List of all members.


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 EntryInformationgetEntryInformation () const
const MolecularSystemgetMolecularInformation () const
SampleConditiongetSampleConditionByName (String name)
const SampleConditiongetSampleConditionByName (String name) const
SampleConditiongetSampleCondition (Position i)
 

Get the i-th SampleCondition.


const SampleConditiongetSampleCondition (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< SamplegetSamples () 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.


ShiftReferenceSetgetShiftReferenceSet (Position i)
 

Get the i-th shift reference set.


const ShiftReferenceSetgetShiftReferenceSet (Position i) const
 

Get the i-th shift reference set.


const ShiftReferenceSetgetShiftReferenceSetByName (String name) const
 

Get a ShiftReferenceSet by its SaveFrame name.


ShiftReferenceSetgetShiftReferenceSetByName (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.


NMRSpectrometergetNMRSpectrometer (Position i)
 

Get the i-th spectrometer.


const NMRSpectrometergetNMRSpectrometer (Position i) const
 

Get the i-th spectrometer.


NMRSpectrometergetNMRSpectrometerByName (String name)
 

Get the spectrometer by its SaveFrame name.


const NMRSpectrometergetNMRSpectrometerByName (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::MonomericPolymergetMonomericPolymer (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< MonomericPolymergetMonomericPolymers () 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< NMRAtomDataSetatom_data_sets_
 

the data for the atoms is stored here


std::vector< SampleConditionsample_conditions_
 

the data for different sample sets


std::vector< Samplesamples_
 

the samples


std::vector< ShiftReferenceSetshift_references_
 

the data for shift references


std::vector< NMRSpectrometernmr_spectrometers_
 

the data of nmr spectrometers


vector< MonomericPolymermonomeric_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



Detailed Description

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

See also:

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

Parameters:
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
Returns:
bool - 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}.

Returns:
bool - true if reading the file was successful
See also:
NMRStarFile::BALLToBMRBMapper
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.

float BALL::NMRStarFile::getNMRSpectrometerFieldStrength ( Position  i  )  const

Get the spectrometer field strength.

String BALL::NMRStarFile::getNMRSpectrometerManufacturer ( Position  i  )  const

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.

String BALL::NMRStarFile::getResidueSequence ( Position  i = 0  )  const

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.

Returns:
String amino acid sequence
Sample BALL::NMRStarFile::getSample ( String  label  )  const

Get the sample with name label. If no sample with name label exist a dummy sample is returned.

Sample BALL::NMRStarFile::getSample ( Position  i  )  const

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.

bool BALL::NMRStarFile::hasMonomericPolymer ( String  name  )  const

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.

bool BALL::NMRStarFile::hasSample ( String  label  )  const

Return true if the file contains a sample named label, false otherwise.

bool BALL::NMRStarFile::isMonomericPolymer ( String  chemical_unit_label  ) 

Check if label is a monomeric polymer.

Returns true if a monomer with name chemical_unit_label exists, false otherwise.

bool BALL::NMRStarFile::isValidSingleValue_ ( String  value  )  [private]

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


Member Data Documentation

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.

Definition at line 866 of file NMRStarFile.h.

Definition at line 863 of file NMRStarFile.h.

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.

Definition at line 72 of file NMRStarFile.h.

Definition at line 856 of file NMRStarFile.h.

stores, which shifts are given in the file

Definition at line 855 of file NMRStarFile.h.

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.

Monomeric Polymer information.

Definition at line 852 of file NMRStarFile.h.

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.

the number of shift data sets

Definition at line 825 of file NMRStarFile.h.

Definition at line 75 of file NMRStarFile.h.

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.

the data for shift references

Definition at line 846 of file NMRStarFile.h.

characters, that denote non-available values

Definition at line 878 of file NMRStarFile.h.

Definition at line 822 of file NMRStarFile.h.


Generated on Tue Dec 7 19:12:45 2010 for BALL by  doxygen 1.5.9