(
void);
61 virtual int Run(
void);
62 virtual void Exit(
void);
78arg_desc->SetUsageContext(
GetArguments().GetProgramBasename(),
79 "n-mer nucleotide repeat finding program");
83arg_desc->AddPositional
85 "fasta format file to read (\"-\" for stdin)",
88arg_desc->AddDefaultKey
90 "Minimum number of repeat units for a dinucleotide repeat " 91 "(0 to suppress dinucleotide search)",
94arg_desc->AddDefaultKey
95(
"3",
"trinuc_min",
96 "Minimum number of repeat units for a trinucleotide repeat " 97 "(0 to suppress trinucleotide search)",
100arg_desc->AddDefaultKey
101(
"4",
"tetranuc_min",
102 "Minimum number of repeat units for a tetranucleotide repeat " 103 "(0 to suppress tetranucleotide search)",
122vector<int> minima(5);
123minima[2] = args[
"2"].AsInteger();
124minima[3] = args[
"3"].AsInteger();
125minima[4] = args[
"4"].AsInteger();
135cout <<
"id\trepeat_unit\tnumber_of_repeats\tfrom\tto"<< endl;
141vector<TSeqPos> starts, ends;
149 const string id= itr->GetFirstId()->AsFastaString();
151 for(
unsigned int n= 2;
n<= 4; ++
n) {
152 if(minima[
n] == 0) {
160 for(
unsigned intk = 0; k < starts.size(); k++) {
161 stringrep_unit = seq.substr(starts[k],
n);
163 if(rep_unit.find_first_not_of(rep_unit.substr(0, 1), 1)
171 if(rep_unit[2] == rep_unit[0] &&
172rep_unit[3] == rep_unit[1]) {
178 intrep_num = (ends[k] - starts[k] + 1) /
n;
181cout <<
id<<
'\t'<< rep_unit <<
'\t'<< rep_num <<
'\t' 182<< starts[k] + 1 <<
'\t'<< ends[k] + 1 << endl;
204 int main(
intargc,
const char* argv[])
User-defined methods of the data storage class.
Base class for reading FASTA sequences.
static void FindNucNmerRepeats(const string &seq, int n, int min_repeats, vector< TSeqPos > &starts, vector< TSeqPos > &ends)
Find all cases of at least min_repeats consecutive occurrences of any n-mer consisting of unambiguous...
virtual void Init(void)
Initialize the application.
virtual int Run(void)
Run the application.
virtual void Exit(void)
Cleanup on application exit.
static TSeqPos Convert(const CSeq_data &in_seq, CSeq_data *out_seq, CSeq_data::E_Choice to_code, TSeqPos uBeginIdx=0, TSeqPos uLength=0, bool bAmbig=false, Uint4 seed=17734276)
Simple implementation of ILineReader for i(o)streams.
Template class for iteration on objects of class C (non-medifiable version)
Operators to edit gaps in sequences.
void HideStdArgs(THideStdArgs hide_mask)
Set the hide mask for the Hide Std Flags.
virtual const CArgs & GetArgs(void) const
Get parsed command line arguments.
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.
virtual void SetupArgDescriptions(CArgDescriptions *arg_desc)
Setup the command line argument descriptions.
const CNcbiArguments & GetArguments(void) const
Get the application's cached unprocessed command-line arguments.
@ fHideLogfile
Hide log file description.
@ fHideConffile
Hide configuration file description.
@ fHideVersion
Hide version description.
@ eInputFile
Name of file (must exist and be readable)
@ eInteger
Convertible into an integer number (int or Int8)
void SetDiagStream(CNcbiOstream *os, bool quick_flush=true, FDiagCleanup cleanup=0, void *cleanup_data=0, const string &stream_name="")
Set diagnostic stream.
@ eDS_Default
Try standard log file (app.name + ".log") in /log/, use stderr on failure.
CRef< CSeq_entry > ReadSet(int max_seqs=kMax_Int, ILineErrorListener *pMessageListener=nullptr)
Read multiple sequences (by default, as many as are available.)
@ fAssumeNuc
Assume nucs unless accns indicate otherwise.
CConstBeginInfo ConstBegin(const C &obj)
Get starting point of non-modifiable object hierarchy.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
const TIupacna & GetIupacna(void) const
Get the variant data.
@ e_Iupacna
IUPAC 1 letter nuc acid code.
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
Defines command line argument related classes.
Defines unified interface to application:
int main(int argc, const char *argv[])
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