本文整理汇总了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;
}
示例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;
}
//.........这里部分代码省略.........