A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/analyze-shift_8cpp_source.html below:

NCBI C++ ToolKit: src/objtools/variation/process/analyze-shift.cpp Source File

84  virtual void Init

(

void

);

86  virtual void

Exit(

void

);

87  bool

ProcessHGVS(

string

&expression,

CRef<CScope>

scope,

CHgvsReader

&reader,

int

&pos_left,

int

&pos_right,

bool

&is_shifted,

bool

&is_different,

int

&dleft,

int

&dright);

94

arg_desc->SetUsageContext(GetArguments().GetProgramBasename(),

"Analyze Shift in HGVS objects"

);

97

SetupArgDescriptions(arg_desc.release());

107

vector<CRef<CSeq_annot> > annots;

113

}

catch

(...) {

return false

;}

114  if

(annots.size() != 1)

return false

;

116  a

->Assign(*annots.front());

118  if

(

a

->GetData().GetFtable().empty() ||

a

->GetData().GetFtable().size() != 1)

return false

;

119  if

(!

a

->GetData().GetFtable().front()->IsSetLocation())

return false

;

121  if

(

a

->GetData().GetFtable().front()->GetData().GetVariation().GetData().IsSet())

123  for

(CVariation_ref::TData::TSet::TVariations::const_iterator inst =

a

->GetData().GetFtable().front()->GetData().GetVariation().GetData().GetSet().GetVariations().begin();

124

inst !=

a

->GetData().GetFtable().front()->GetData().GetVariation().GetData().GetSet().GetVariations().end(); ++inst)

125  if

((*inst)->IsSetData() && (*inst)->GetData().IsInstance() && (*inst)->IsSetData() && (*inst)->GetData().GetInstance().IsSetType() && (*inst)->GetData().GetInstance().GetType() !=

CVariation_inst::eType_identity

)

126  type

= (*inst)->GetData().GetInstance().GetType();

128  else if

(

a

->GetData().GetFtable().front()->GetData().GetVariation().GetData().IsInstance() &&

a

->GetData().GetFtable().front()->GetData().GetVariation().GetData().GetInstance().IsSetType()

130  type

=

a

->GetData().GetFtable().front()->GetData().GetVariation().GetData().GetInstance().GetType();

136

CSeq_loc &orig_loc =

a

->SetData().SetFtable().front()->SetLocation();

138  int

orig_left = pos_left;

139  int

orig_right = pos_right;

140  if

(orig_loc.IsInt())

142

orig_left = orig_loc.GetInt().GetFrom();

143

orig_right = orig_loc.GetInt().GetTo();

145  else if

(orig_loc.IsPnt())

147

orig_left = orig_loc.GetPnt().GetPoint();

148

orig_right = orig_left;

150  if

(orig_left != pos_left || orig_right != pos_right)

151

is_different =

true

;

155  int

pos = orig_loc.GetInt().GetTo();

158  if

(orig_loc.GetInt().IsSetStrand())

159

pnt.

SetStrand

( orig_loc.GetInt().GetStrand() );

160

pnt.

SetId

().Assign(orig_loc.GetInt().GetId());

161

orig_loc.SetPnt().Assign(pnt);

167  const

CSeq_loc &loc =

a

->GetData().GetFtable().front()->GetLocation();

169  if

(

a

->GetData().GetFtable().front()->GetData().GetVariation().GetData().IsSet())

171  for

(CVariation_ref::TData::TSet::TVariations::const_iterator inst =

a

->GetData().GetFtable().front()->GetData().GetVariation().GetData().GetSet().GetVariations().begin();

172

inst !=

a

->GetData().GetFtable().front()->GetData().GetVariation().GetData().GetSet().GetVariations().end(); ++inst)

173  if

( (*inst)->IsSetData() && (*inst)->GetData().IsInstance() && (*inst)->GetData().GetInstance().IsSetDelta() && (*inst)->GetData().GetInstance().GetDelta().size() == 1 &&

174

(*inst)->GetData().GetInstance().GetDelta().front()->IsSetSeq() && (*inst)->GetData().GetInstance().GetDelta().front()->GetSeq().IsLiteral() &&

175

(*inst)->GetData().GetInstance().GetDelta().front()->GetSeq().GetLiteral().IsSetSeq_data() && (*inst)->GetData().GetInstance().GetDelta().front()->GetSeq().GetLiteral().GetSeq_data().IsIupacna())

176

ref = (*inst)->GetData().GetInstance().GetDelta().front()->GetSeq().GetLiteral().GetSeq_data().GetIupacna().Get();

178  else if

(

a

->GetData().GetFtable().front()->GetData().GetVariation().GetData().IsInstance() &&

a

->GetData().GetFtable().front()->GetData().GetVariation().GetData().GetInstance().IsSetDelta()

179

&&

a

->GetData().GetFtable().front()->GetData().GetVariation().GetData().GetInstance().GetDelta().size() == 1

180

&&

a

->GetData().GetFtable().front()->GetData().GetVariation().GetData().GetInstance().GetDelta().front()->IsSetSeq()

181

&&

a

->GetData().GetFtable().front()->GetData().GetVariation().GetData().GetInstance().GetDelta().front()->GetSeq().IsLiteral()

182

&&

a

->GetData().GetFtable().front()->GetData().GetVariation().GetData().GetInstance().GetDelta().front()->GetSeq().GetLiteral().IsSetSeq_data()

183

&&

a

->GetData().GetFtable().front()->GetData().GetVariation().GetData().GetInstance().GetDelta().front()->GetSeq().GetLiteral().GetSeq_data().IsIupacna())

184

ref =

a

->GetData().GetFtable().front()->GetData().GetVariation().GetData().GetInstance().GetDelta().front()->GetSeq().GetLiteral().GetSeq_data().GetIupacna().Get();

188  if

(ref.empty())

return false

;

192

pos_left = loc.GetPnt().GetPoint();

193

pos_right = pos_left;

195  else if

(loc.IsInt())

197

pos_left = loc.GetInt().GetFrom();

198

pos_right = loc.GetInt().GetTo();

202  if

(pos_left != orig_left || pos_right != orig_right)

204

dleft = orig_left - pos_left;

205

dright = pos_right - orig_right;

232  while

(!line_reader.

AtEOF

())

234  string

line = *(++line_reader);

237

vector<string> tokens;

238

NStr::Tokenize(line,

"|"

,tokens);

239  string

snp_id = tokens[0];

240  string

hgvs = tokens[1];

241  string

gi = tokens[2];

242  string

start = tokens[3];

243  string

stop = tokens[4];

244  string

isClinical = tokens[5];

247  bool

is_shifted =

false

;

248  bool

is_different =

false

;

251  if

(ProcessHGVS(hgvs,scope,reader,pos_left,pos_right,is_shifted,is_different,dleft,dright))

253

ostr <<snp_id<<

"|"

<<hgvs<<

"|"

<<isClinical<<

"|"

<<is_different<<

"|"

<<is_shifted<<

"|"

;

255

ostr << dleft<<

"|"

<<dright<<

"|"

<<pos_left<<

"|"

<<pos_right<<

"|"

;

259

ostr << line <<

"ERROR_HGVS_PROCESSING"

<<endl;

266 int main

(

int

argc,

const char

* argv[])

269  return

AnalyzeShiftApp.

AppMain

(argc, argv);

User-defined methods of the data storage class.

User-defined methods of the data storage class.

int main(int argc, const char *argv[])

Data loader implementation that uses the blast databases.

virtual void Init(void)

Initialize the application.

virtual void Exit(void)

Cleanup on application exit.

bool ProcessHGVS(string &expression, CRef< CScope > scope, CHgvsReader &reader, int &pos_left, int &pos_right, bool &is_shifted, bool &is_different, int &dleft, int &dright)

virtual int Run()

Run the application.

static TRegisterLoaderInfo RegisterInObjectManager(CObjectManager &om, CReader *reader=0, CObjectManager::EIsDefault is_default=CObjectManager::eDefault, CObjectManager::TPriority priority=CObjectManager::kPriority_NotSet)

CRef< CGC_Assembly > GetAssembly(const string &acc, const string &mode)

virtual void ReadSeqAnnots(vector< CRef< CSeq_annot > > &, CNcbiIstream &, ILineErrorListener *=0)

Simple implementation of ILineReader for i(o)streams.

static void NormalizeVariation(CVariation &var, ETargetContext target_ctxt, CScope &scope)

Include a standard set of the NCBI C++ Toolkit most basic headers.

User-defined methods of the data storage class.

int AppMain(int argc, const char *const *argv, const char *const *envp=0, EAppDiagStream diag=eDS_Default, const char *conf=NcbiEmptyCStr, const string &name=NcbiEmptyString)

Main function (entry point) for the NCBI application.

@ fPreOpen

Open file right away; for eInputFile, eOutputFile, eIOFile.

@ eInputFile

Name of file (must exist and be readable)

@ eOutputFile

Name of file (must be writable)

bool AtEOF(void) const

Indicates (negatively) whether there is any more input.

static CRef< CObjectManager > GetInstance(void)

Return the existing object manager or create one.

void AddDefaults(TPriority pri=kPriority_Default)

Add default data loaders from object manager.

IO_PREFIX::ostream CNcbiOstream

Portable alias for ostream.

IO_PREFIX::istream CNcbiIstream

Portable alias for istream.

static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)

Convert string to int.

void Run(void)

Enter the main loop.

void SetPoint(TPoint value)

Assign a value to Point data member.

void SetId(TId &value)

Assign a value to Id data member.

void SetStrand(TStrand value)

Assign a value to Strand data member.

@ eType_identity

delta=[]

Lightweight interface for getting lines of data with minimal memory copying.

Defines the CNcbiApplication and CAppException classes for creating NCBI applications.

#define GetArgs

Avoid preprocessor name clash with the NCBI C Toolkit.

Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...

NetCache ICache client specs.

Reader-writer based streams.

C++ I/O stream wrappers to compress/decompress data on-the-fly.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4