82 Str +=
"<Empty Sequence>";
84 }
else if (!SeqID->
IsGi() && !SeqID->
IsPdb()) {
85 Str +=
"<Non-gi/pdb Sequence Types Unsupported>";
91 Str += NStr::NumericToString<TGi>(GI);
92 }
else if (SeqID->
IsPdb()) {
97 sprintf(
buf,
"pdb %s_%c",pPDB_ID.
GetMol().
Get().c_str(),chain);
99 if(chain==
' ')
buf[
len-2]=0;
114 return "<Empty Sequence>";
122 Str = NStr::NumericToString<TGi>(GI);
123 }
else if (SeqID->
IsPdb()) {
138 if ( (
int)Str.size() <
Len) {
139 Str.append(
Len - Str.size(),
' ');
154 list< CRef< CCdd_id > >::const_iterator
i, ibegin, iend;
158 for (
i = ibegin;
i != iend; ++
i) {
174 string s =
"Accession " +
id.GetGid().GetAccession();
175 if (
id.GetGid().IsSetDatabase()) {
176 s.append(
" Database " +
id.GetGid().GetDatabase());
178 if (
id.GetGid().IsSetRelease()) {
179 s.append(
" Release " +
id.GetGid().GetRelease());
181 if (
id.GetGid().IsSetVersion()) {
186 return "Unset/Unknown Cdd_id";
210 static const std::string allowed =
"-ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789[],(){}<>.";
212 for (
i=0;
i<prosite.size();
i++) {
213 if (allowed.find(
toupper((
unsigned char) prosite[
i])) == std::string::npos)
break;
215 if (
i != prosite.size())
throw "invalid ProSite character";
216 if (prosite[prosite.size() - 1] !=
'.')
throw "ProSite pattern must end with '.'";
221 bool inGroup =
false;
222 for (
i=0;
i<prosite.size();
i++) {
225 bool characterHandled =
true;
226 switch (prosite[
i]) {
227 case '-':
case '.':
case '>':
232 if (prosite[
i] ==
'>') *regex +=
'$';
238 characterHandled =
false;
241 if (characterHandled)
continue;
243 (
isalpha((
unsigned char) prosite[
i]) &&
toupper((
unsigned char) prosite[
i]) !=
'X') ||
244 prosite[
i] ==
'[' || prosite[
i] ==
'{')) {
250 switch (prosite[
i]) {
267 *regex +=
toupper((
unsigned char) prosite[
i]);
273 catch (
const char *err) {
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
bool Prosite2Regex(const std::string &prosite, std::string *regex, std::string *errString)
string CddIdString(const CCdd &cdd)
bool SameCDAccession(const CCdd_id &id1, const CCdd_id &id2)
const int CDTreeColorCycle[]
void Make_GI_or_PDB_String_CN3D(const CRef< CSeq_id > SeqID, std::string &Str)
string GetSeqIDStr(const CRef< CSeq_id > &SeqID)
const int kNumColorsInCDTreeColorCycle
string Make_SeqID_String(const CRef< CSeq_id > SeqID, bool Pad, int Len)
const TPrim & Get(void) const
string GetSeqIdString(bool with_version=false) const
Return seqid string with optional version for text seqid type.
bool Empty(void) const THROWS_NONE
Check if CRef is empty – not pointing to any object, which means having a null value.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
const TId & GetId(void) const
Get the Id member data.
const TAccession & GetAccession(void) const
Get the Accession member data.
E_Choice Which(void) const
Which variant is currently selected.
const TGid & GetGid(void) const
Get the variant data.
const Tdata & Get(void) const
Get the member data.
@ e_Gid
holds accession/version pairs
@ e_Uid
for synchronization with Entrez holds PSSM-Ids
bool IsStr(void) const
Check if variant Str is selected.
bool IsId(void) const
Check if variant Id is selected.
const TStr & GetStr(void) const
Get the variant data.
TId GetId(void) const
Get the variant data.
TChain GetChain(void) const
Get the Chain member data.
const TPdb & GetPdb(void) const
Get the variant data.
bool IsOther(void) const
Check if variant Other is selected.
bool IsPdb(void) const
Check if variant Pdb is selected.
TGi GetGi(void) const
Get the variant data.
const TMol & GetMol(void) const
Get the Mol member data.
const TOther & GetOther(void) const
Get the variant data.
const TLocal & GetLocal(void) const
Get the variant data.
bool IsLocal(void) const
Check if variant Local is selected.
bool IsGi(void) const
Check if variant Gi is selected.
const TAccession & GetAccession(void) const
Get the Accession member data.