예제 #1
0
        //Method that use the basic details of the mutation and generate all extra details.
        public void extractExtraData()
        {
            try
            {
                //get gene details from lodal db, if not exit create new gene and add it to locel db
                _gene = MainBL.getGene(_geneName, _chrom);
                if (_gene == null)
                {
                    _gene = MainBL.addGene(_geneName, _chrom);
                }

                _strand = _gene.Strand;
                if (_strand.Equals('+'))
                {
                    _cosmicDetails = MainBL.getCosmicDetails(_chromNum, _position, _ref, _var);
                }
                else if (_strand.Equals('-'))
                {
                    _cosmicDetails = MainBL.getCosmicDetails(_chromNum, _position, OppositeNuc(_ref), OppositeNuc(_var));
                }

                setVarRefCodons(_gene.getOffsetInCodon(_position));
            }
            catch (Exception)
            {
                throw;
            }
            //sets the rest of the mutation details.
            if (!_refCodon.Equals("No Coding"))
            {
                _varAA = GeneralMethods.getAminoAcid(_varCodon);
                _refAA = GeneralMethods.getAminoAcid(_refCodon);
            }
            else
            {
                _varAA = "-----";
                _refAA = "-----";
            }
            if (_cosmicDetails != null)
            {
                _cosmicName    = _cosmicDetails.ElementAt(0);
                _pMutationName = _cosmicDetails.ElementAt(1);
                _cMutationName = _cosmicDetails.ElementAt(2);
            }
            else
            {
                _cosmicName    = "-----";
                _pMutationName = "-----";
                _cMutationName = "-----";
            }
        }
예제 #2
0
 //First constructor - gets the basic mutation data generate all the extra data, use for new mutation that not exist in local database.
 public Mutation(string chrom, int position, string geneSym, char refNuc, char varNuc)
 {
     _chrom    = chrom;
     _chromNum = chrom.Replace("chr", "");
     _position = position;
     _geneName = geneSym;
     _ref      = refNuc;
     _var      = varNuc;
     _mutId    = this.generateMutId();
     try
     {
         extractExtraData();
         if (!MainBL.mutationExist(this))
         {
             MainBL.addMutation(this);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }