#include <iostream>#include <string>#include <vector>#include <algorithm>#include <sstream>#include <set>#include <cstring>Go to the source code of this file.
Functions | |
| int | wc (const string &str) |
| bool | isnumber (const string &str) |
| bool | isnumber (const string &str, const string dc) |
| bool | isupper (const string &str) |
| void | upper (const char lo[], char *up) |
| string | getLower (const string &str) |
| void | strTolower (string &str) |
| void | strTolower (const string &str1, string &str2) |
| void | strToupper (string &str) |
| string | str2upper (const string &str) |
| string | lc (const string &str) |
| int | cmp_nocase (const string &s1, const string &s2) |
| bool | intersect (vector< string > &s1, vector< string > &s2) |
| string | delall (const string &str, const char c) |
| string | delall (const string &str, const string &c) |
| string | deleteChr (const string &str, char c) |
| string | tr (const string &str, char i, char o) |
| void | trim (string &str) |
| void | trimLeadingSpace (string &str) |
| void | dlc (char a[]) |
| void | rmtsp (char a[]) |
| void | rmsp (char a[]) |
| void | singleSpace (string &str) |
| void | rmsp (const char a[], char b[]) |
| void | rmdquote (char a[]) |
| void | rpldquote (char a[], const char r) |
| void | newline (istream &ins) |
| int | getNumber (char *&ptr) |
| int | getInt (const string &str) |
| vector< int > | getAllInt (const string &str) |
| int | itoa (unsigned int n, char a[]) |
| string | itos (int n) |
| template<class T> | |
| string | toString (const T &val) |
| template<class T> | |
| string | anyToString (const T &val) |
| vector< int > | extractInt (const string &str) |
| int | substr (const char ln[], int s, char sub[]) |
| int | substr (const char ln[], int s, int f, char sub[]) |
| void | firstwd (const char ln[], char sub[], char term=' ') |
| string | firstword (const string &str, const string &delim=" ,.()") |
| void | lastwd (const char ln[], char wd[], char sep= ' ') |
| string | lastword (const string &str, const string &delim=" ,.()") |
| string | acronym (const string &str, int n=1) |
| string | acronymWithDigit (const string &str, int n=1) |
| string | acronymWithTag (const string &str, int n=1) |
| void | append (char *&head, const char *tail, int &len, int &maxlen, int incr) |
| void | append (char *&head, const char *tail, int &len, int &maxlen) |
| vector< string > | split (const string &str, const char sep='\t') |
| vector< string > | split (const string &str, const char sep[]) |
| vector< string > | splitOneOf (const string &str, const string &delims=",. \t") |
| vector< string > | dissect (const string &str, const string &delims=",. \t") |
| set< string > | digest2set (const string &str, const string &delims=",. \t") |
| pair< string, string > | breakString (const string &str, const string &sep) |
| void | writeSequence (const string &seq, ostream &ous, const int width=70) |
| int | isName (char *n) |
| bool | codonIsStop (const string &codon) |
| bool | subseqIsStop (const string &seq, int i) |
| string acronym | ( | const string & | str, | |
| int | n = 1 | |||
| ) |
acronym based on, at most, n letters of each word
| string acronymWithDigit | ( | const string & | str, | |
| int | n = 1 | |||
| ) |
| string acronymWithTag | ( | const string & | str, | |
| int | n = 1 | |||
| ) |
| string anyToString | ( | const T & | val | ) | [inline] |
Make a long name so it will be different I tried to use name space but I have a hard time to compile and link!
Referenced by ESTAssembly::ESTAssembly(), ESTModel::ESTModel(), ESTAssembly::setName(), and ESTAssembly::setTitle().
| void append | ( | char *& | head, | |
| const char * | tail, | |||
| int & | len, | |||
| int & | maxlen | |||
| ) |
| void append | ( | char *& | head, | |
| const char * | tail, | |||
| int & | len, | |||
| int & | maxlen, | |||
| int | incr | |||
| ) |
Referenced by Alnview::namesToString(), Alnview::readFile(), feature::readloc(), kzseq::readSeq(), and Alnview::toString().
| pair<string,string> breakString | ( | const string & | str, | |
| const string & | sep | |||
| ) |
break a string into two parts according the the separator sep
Referenced by Gmapath::Gmapath(), and readandstoreGmap().
| int cmp_nocase | ( | const string & | s1, | |
| const string & | s2 | |||
| ) |
compare to string and ignoring case
Referenced by Aceobj::at(), find(), and feature::isGoodGeneSymbol().
| bool codonIsStop | ( | const string & | codon | ) |
References strToupper().
| string delall | ( | const string & | str, | |
| const string & | c | |||
| ) |
delete all string c from str
| string delall | ( | const string & | str, | |
| const char | c | |||
| ) |
delete all character from a string
Referenced by main(), and feature::makeGeneSymbol().
| string deleteChr | ( | const string & | str, | |
| char | c | |||
| ) |
alias for delall
Referenced by Gmapath::Gmapath().
| set<string> digest2set | ( | const string & | str, | |
| const string & | delims = ",. \t" | |||
| ) |
Referenced by deflineBetter().
| vector<string> dissect | ( | const string & | str, | |
| const string & | delims = ",. \t" | |||
| ) |
anything in delims will be discarded only the none-delims char are left, and packed in the vector more or less digestions same as split, but will use any of the characters as separators leading and trailing separators are discarded
Referenced by acedbinfo::acedbinfo(), feature::acronymWithAllDigits(), acronymWithTag(), dumpFromModel(), getinslen(), dbinfo::init(), Journal::Journal(), main(), feature::makeGeneSymbol(), Refreader::newRef(), Reference::parseJournal(), parseOneFile(), pgdbinfo::pgdbinfo(), gbseq::read(), Matrix::read(), readconf(), and readUnwantedTaxid().
| void dlc | ( | char | a[] | ) |
delete last character from an C-string a
Referenced by head::getHead().
| vector<int> extractInt | ( | const string & | str | ) |
Referenced by main(), and locseg::parse().
| void firstwd | ( | const char | ln[], | |
| char | sub[], | |||
| char | term = ' ' | |||
| ) |
Referenced by head::loadSeqInfo().
| string firstword | ( | const string & | str, | |
| const string & | delim = " ,.()" | |||
| ) |
| vector<int> getAllInt | ( | const string & | str | ) |
extract all integer numbers in the string
Referenced by Gmapalnseg::Gmapalnseg(), Gmapath::Gmapath(), and readandstoreGmap().
| int getInt | ( | const string & | str | ) |
return the first integer number in the string
Referenced by readandstoreGmap().
| string getLower | ( | const string & | str | ) |
Referenced by feature::writeAceProtein(), and feature::writeSource().
| int getNumber | ( | char *& | ptr | ) |
Conversion to other types such as integer, double
Referenced by Date::gbstr(), and feature::readloc().
| bool intersect | ( | vector< string > & | s1, | |
| vector< string > & | s2 | |||
| ) |
| int isName | ( | char * | n | ) |
References isupper().
| bool isnumber | ( | const string & | str, | |
| const string | dc | |||
| ) |
| bool isnumber | ( | const string & | str | ) |
Referenced by feature::acronymWithAllDigits(), main(), and feature::makeGeneSymbol().
| bool isupper | ( | const string & | str | ) |
References isupper().
Referenced by feature::acronymWithAllDigits(), ref::au2list(), isName(), isupper(), feature::makeGeneSymbol(), and feature::shortIsGeneSymbol().
| int itoa | ( | unsigned int | n, | |
| char | a[] | |||
| ) |
reverse of atoi convert into an array of char
Referenced by seqinfo::getcntstr(), main(), feature::wjoinseg(), feature::writeAllele(), feature::writeRNA(), feature::writeSource(), and feature::writeToken().
| string itos | ( | int | n | ) |
convert integer type to string type the toString() method is more generic
Referenced by alignProtein(), breakonecl(), ESTAssembly::breakPrefixModel(), ESTAssembly::breakSuffixModel(), ESTAssemblyid::breakup(), ESTAssembly::budMinusPrefixModel(), ESTAssembly::budMinusSuffixModel(), ESTAssembly::budPlusPrefixModel(), ESTAssembly::budPlusSuffixModel(), Dynaln::buildAlnInfo(), checkBadStopIndex(), constructJGIModel(), create_modelaln(), ChainAvgrange::dbrows(), dumpFromModel(), RNAModel::genomicIndex(), Progparam::getBadExonTable(), Progparam::getBadModelFile(), Progparam::getBadModelTable(), Progparam::getGoodExonTable(), Progparam::getGoodModelFile(), Progparam::getGoodModelTable(), Progparam::getModelClusterFile(), Progparam::getModelClusterTable(), locseg::getOperation(), feature::goodGeneSymbol(), mRNAModel::growCDS3Prime(), JGIModel::JGIModel(), main(), Refwithty::makeKey(), mergeNeighbor(), mRNAModelUpdate::name(), mRNAModel::name(), feature::nextGeneSymbol(), alignmentRunner::operator()(), RNAModel::RNAIndex(), Coverdepth::searchDip(), mRNAModel::setRNACDS(), Noschain::subchain(), bioseq::subseq(), Noschain::subsequence(), mRNAModelUpdate::title(), Noschain::trimBeforePoint(), feature::writeCDS(), feature::writeImmuno(), writeJobInstruction(), feature::writemRNA(), feature::writeRNA(), feature::writeSegCDS(), feature::writeSegmRNA(), and feature::writeSource().
| void lastwd | ( | const char | ln[], | |
| char | wd[], | |||
| char | sep = ' ' | |||
| ) |
| string lastword | ( | const string & | str, | |
| const string & | delim = " ,.()" | |||
| ) |
| string lc | ( | const string & | str | ) |
| void newline | ( | istream & | ins | ) |
This function is not so good and should be removed in the future
| void rmdquote | ( | char | a[] | ) |
Referenced by head::getHead().
| void rmsp | ( | const char | a[], | |
| char | b[] | |||
| ) |
remove all spaces
| void rmtsp | ( | char | a[] | ) |
Referenced by rmsp().
| void rpldquote | ( | char | a[], | |
| const char | r | |||
| ) |
Referenced by head::getHead().
| void singleSpace | ( | string & | str | ) |
Referenced by feature::cleanGene(), main(), and feature::nojunkGene().
| vector<string> split | ( | const string & | str, | |
| const char | sep[] | |||
| ) |
separate str into an array of strings using sep as delimiter sep is a string Same behavior as the char version seprator. Anything in betwee sep will be an array element. For example, if sep is ?? then ??tabc?? will have three elements, the first and the third are empty strings
| sep | is the delimiter that is a c_string as compare to the single character version. |
| vector<string> split | ( | const string & | str, | |
| const char | sep = '\t' | |||
| ) |
A version of split that will separate a string into elements separated by sep that is a single character. It even returns empty string as elements if nothing is in between sep.
| vector<string> splitOneOf | ( | const string & | str, | |
| const string & | delims = ",. \t" | |||
| ) |
use one of the separators ( ,.;), no more will discard the leading separators This function should be removed, it is confusing All split functions should not discard leading fields. Needs to redefine.
Referenced by Alnchain::Alnchain().
| string str2upper | ( | const string & | str | ) |
| void strTolower | ( | const string & | str1, | |
| string & | str2 | |||
| ) |
| void strTolower | ( | string & | str | ) |
| void strToupper | ( | string & | str | ) |
References toupper().
Referenced by codonIsStop(), feature::shortIsGeneSymbol(), subseqIsStop(), and gbprtseq::writeAce().
| bool subseqIsStop | ( | const string & | seq, | |
| int | i | |||
| ) |
seq must be in upper case
| i. | is the index of the subsequence of 3 nt. |
References strToupper().
Referenced by mRNAModel::trimCDSStop(), and mRNAModel::trimCDSTail().
| int substr | ( | const char | ln[], | |
| int | s, | |||
| int | f, | |||
| char | sub[] | |||
| ) |
picks non-whitespace substring from s to f returns the length of the substring s starting index, f ending index (inclusive)
| int substr | ( | const char | ln[], | |
| int | s, | |||
| char | sub[] | |||
| ) |
Extraction picks substring from index s to a white space of ln, copy to sub sub is set to the substring without any whitespace at beginning or end. If from s to the end is all whitespace, then return 0 and sub is set to empty C string. returns strlen of the substr, 0 if no substr, or substr is empty s is 0-based index
Referenced by acronymWithTag(), Book::Book(), feature::getTaxid(), head::loadSeqInfo(), main(), Refreader::newRef(), locseg::parse(), Reference::parseJournal(), RangeChain::RangeChain(), Gsubreader::read(), readandstoreSam(), feature::readloc(), feature::RNAdump(), prt::writeAce(), and feature::writeAceDNA().
| string toString | ( | const T & | val | ) | [inline] |
this can be used to conver most of the build-in types to string
| string tr | ( | const string & | str, | |
| char | i, | |||
| char | o | |||
| ) |
converting all character i to o in str
Referenced by feature::insertGeneSymbol(), feature::insertQualifier(), feature::makeGeneSymbol(), gbseq::read(), and feature::writeFeature().
| void trim | ( | string & | str | ) |
removing trailing spaces if exist
| void trimLeadingSpace | ( | string & | str | ) |
remove all leading spaces
Referenced by readandstoreGmap().
| void upper | ( | const char | lo[], | |
| char * | up | |||
| ) |
References toupper().
Referenced by align_get_dist(), align_path(), exon_cores(), extend_bw(), extend_fw(), Date::smtoi(), Xextend_bw(), and Xextend_fw().
| int wc | ( | const string & | str | ) |
Referenced by feature::getGeneSymbol(), main(), feature::makeGeneSymbol(), feature::separateAllele(), and feature::shortIsGeneSymbol().
| void writeSequence | ( | const string & | seq, | |
| ostream & | ous, | |||
| const int | width = 70 | |||
| ) |
Referenced by gbdnaseq::writeAce(), gbprtseq::writeAce(), and feature::writeProtein().
1.5.6