当前位置: 首页>>代码示例>>C++>>正文


C++ SequenceSet::load方法代码示例

本文整理汇总了C++中SequenceSet::load方法的典型用法代码示例。如果您正苦于以下问题:C++ SequenceSet::load方法的具体用法?C++ SequenceSet::load怎么用?C++ SequenceSet::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SequenceSet的用法示例。


在下文中一共展示了SequenceSet::load方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: go

int Application::go(int argc,char *argv[])
{
  // Process command line
  CommandLine cmd(argc,argv,"");
  if(cmd.numArgs()!=3)
    throw "\n\
threshold <in.schema> <input-dir> <threshold>\n\
\n\
";
  String schemaFile=cmd.arg(0);
  String inDir=cmd.arg(1);
  threshold=cmd.arg(2).asDouble();

  // Misc. initialization
  cout.precision(10);
  cerr.precision(10);
  BOOM::catchFloatOverflow();

  // Load the training set
  schema=Schema(schemaFile);
  D=schema.getNumContinuous();
  trainingSet.load(inDir,schema);

  // Apply thresholding to the data
  applyThreshold();

  // Save the results
  trainingSet.save();

  return 0;
}
开发者ID:bmajoros,项目名称:MUMMIE,代码行数:31,代码来源:threshold.C

示例2: go

int Application::go(int argc,char *argv[])
{
  // Process command line
  CommandLine cmd(argc,argv,"");
  if(cmd.numArgs()!=5) 
    throw "\n\
hack-known-sites [options] <training-dir> <schema.txt> <signal-name> <margin-around-peak> <motifs>\n\
";
  String dir=cmd.arg(0);
  String schemaFile=cmd.arg(1);
  String signalName=cmd.arg(2);
  int margin=cmd.arg(3).asInt();
  String motifs=cmd.arg(4);

  // Misc. initialization
  cout.precision(10);
  cerr.precision(10);
  BOOM::catchFloatOverflow();
  BOOM::Vector<String> &motifV=*motifs.getFields(",");
  Regex r("([^\/]+)\\.fastb");

  // Load schema
  Schema schema(schemaFile);
  sigID=schema.lookupContinuousID(signalName);
  openID=schema.lookupContinuousID("unpaired");
  alphabet=schema.getAlphabet(0);

  // Load the training set
  cerr<<"loading training data"<<endl;
  trainingSet.load(dir,schema);

  // Process sequences
  cerr<<"processing sequences"<<endl;
  BOOM::Vector<float> all, cluster;
  BOOM::Array1D< BOOM::Vector<double> > offsets(2*WINDOW_SIZE+1);
  BOOM::Vector<double> motifClusterSizes, otherClusterSizes;
  const int N=trainingSet.size();
  int nextSeqID=1;
  for(int i=0 ; i<N ; ++i) {
    EmissionSequence &S=*trainingSet[i];
    if(!r.search(S.getFilename())) throw S.getFilename();
    String substrate=r[1];
    int begin;
    double prevX=0;
    double maxX=-1;
    int maxPos;
    const int L=S.length();
    for(int pos=0 ; pos<L ; ++pos) {
      const Emission &e=S[pos];
      const double x=e[sigID];
      all.push_back(e[openID]);
      if(prevX==0 && x>0) { begin=pos; maxX=x; maxPos=pos; }
      else if(prevX>0 && x>0 && x>maxX) { maxX=x; maxPos=pos; }
      else if(prevX>0 && x==0) {
	int from, to;
	if(1) {
	  if(findMotif(maxPos,from,to,motifV,margin,S)) {
	  /*
	  cout<<substrate<<"\tpositive\tgroup\t"<<begin<<"\t"<<pos<<"\t1\t+\t.\n";
	  cout<<substrate<<"\tmotif\tsite\t"<<from<<"\t"<<to<<"\t1\t+\t.\n";
	  */
	  //cout<<maxX<<endl;
	  /*
	  EmissionSequence *subseq=S.getSubsequence(begin,pos-begin);
	  Sequence *seq=subseq->getDiscreteSeq(0);
	  delete subseq;
	  cout<<">"<<nextSeqID++<<endl;
	  seq->printOn(cout,schema.getAlphabet(0));
	  cout<<endl;
	  delete seq;
	  */

	  for(int delta=-WINDOW_SIZE ; delta<=WINDOW_SIZE ; ++delta) {
	    //int x=to+delta;
	    int x=maxPos+delta;
	    if(x<0 || x>=L) continue;
	    double y=S[x][openID];
	    offsets[delta+WINDOW_SIZE].push_back(y);
	  }

	  //motifClusterSizes.push_back(pos-begin);
	  }
	}
	else {//for(int i=begin ; i<pos ; ++i) {
	  /*
	  cout<<substrate<<"\tnegative\tgroup\t"<<begin+1<<"\t"<<pos<<"\t1\t+\t.\n";
	  cout<<substrate<<"\tdecoy\tsite\t"<<maxPos-margin<<"\t"<<maxPos+margin<<"\t1\t+\t.\n";
	  */
	  //cout<<maxX<<endl;
	  /*
	  //EmissionSequence *subseq=S.getSubsequence(begin,pos-begin);
	  if(maxPos>margin && maxPos+margin<L) {
	    EmissionSequence *subseq=S.getSubsequence(maxPos-margin,2*margin);
	    Sequence *seq=subseq->getDiscreteSeq(0);
	    delete subseq;
	    cout<<">"<<nextSeqID++<<endl;
	    seq->printOn(cout,schema.getAlphabet(0));
	    cout<<endl;
	    delete seq;
	  }
//.........这里部分代码省略.........
开发者ID:bmajoros,项目名称:MUMMIE,代码行数:101,代码来源:hack-known-sites.C


注:本文中的SequenceSet::load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。