I'm pretty new to OOP in c++ so bear with me here.
In my header that defines my member variables;
class AntibodyJunction
{
private:
//raw seq
seqan::Dna5 _raw_sequence;
//private funcs
void _setVGeneQueryStartTranslation();
public:
//V D and J constructor
AntibodyJunction(AlignAntibody &, AlignAntibody &, AlignAntibody &, seqan::Dna5 &);
~AntibodyJunction() {};
};
and in cpp
AntibodyJunction::AntibodyJunction(AlignAntibody & VGene, AlignAntibody &JGene,AlignAntibody & DGene, seqan::Dna5 & raw_sequence)
{
//...some other declaration...//
seqan::Dna5String _raw_sequence = raw_sequence;
std::cout << "constructor parameter\n" << raw_sequence << std::endl;
std::cout << "Template dna5\n" << _raw_sequence << std::endl;
_setVGeneQueryStartTranslation();
};
void AntibodyJunction::_setVGeneQueryStartTranslation(){
std::cout << "other raw seq\n" << _raw_sequence << std::endl;
//...lots of other stuff
}
and the output ->
constructor parameter
CAGCGATTAGTGGAGTCTGGGGG
Template dna5
CAGCGATTAGTGGAGTCTGGGGG
other raw seq
the member variable _raw_sequence
is blank when I try to access it within a class function. I understand that I could just do everything in the constructor, but I'd like to understand why it is resetting. seqan::Dna5 is just a template container for dna strings from the seqan library for working with biological data. It holds dna sequences. Here is the doc. It's confusing because everything else I'm accessing in this function seems to be available.