21 const BI_helix *helix = get_helixDef();
24 if (start1 == -1)
return NULp;
29 if (
size_t(start1)<start2) {
53 bool next_is_start =
true;
58 for (
size_t pos = 0; pos<xlength && !
error; ++pos) {
59 if (x_string[pos] ==
'x') {
61 const char *helixNr = helix->
helixNr(pos);
68 bool is_end_and_start = pairType !=
HELIX_NONE;
72 error =
GBS_global_string(
"xstring out of sync at position %zu (approximately)\nRefold helices around position!", pos);
77 if (is_end_and_start) {
80 next_is_start = !next_is_start;
84 next_is_start = !next_is_start;
94 char *xstring = ARB_alloc<char>(xlength+1);
95 memset(xstring,
'.', xlength);
102 const char *semi = strchr(foldedHelices,
';');
106 const char *helixNr =
NULp;
109 if (taggedHelixNr[0] ==
'!') {
110 helixNr = taggedHelixNr+1;
112 if (xpos >= 0) ++xpos;
115 helixNr = taggedHelixNr;
123 sec_assert(xpos >= 0 &&
size_t(xpos) < xlength);
129 foldedHelices = semi+1;
140 const char *start_helix_nr =
NULp;
141 int no_of_helices = 0;
145 size_t lastpos = helix->
size()-1;
147 char *x_buffer = ARB_alloc<char>(xlength+1);
148 memset(x_buffer,
'.', xlength);
149 x_buffer[xlength] = 0;
151 for (
size_t pos=0; ; pos++) {
152 const char *helix_nr =
NULp;
156 helix_nr = helix->
helixNr(pos);
158 if (helix_nr==start_helix_nr) {
162 if (start_helix_nr) {
164 helix_nr = helix->
helixNr(pos);
165 char flag = rel_helix[rel_pos++];
173 x_buffer[start_helix] =
'x';
174 x_buffer[end_helix+1] =
'x';
176 else if (flag!=
'0') {
189 start_helix_nr = helix_nr;
193 if (start_helix_nr) {
199 *no_of_helices_ptr = no_of_helices;
const size_t * getHelixPositions(const char *helixNr) const
long first_position(const char *helixNr) const
const char * GBS_global_string(const char *templat,...)
size_t opposite_position(size_t pos) const
void cat(const char *from)
char * ARB_strpartdup(const char *start, const char *end)
char * SEC_xstring_to_foldedHelixList(const char *x_string, size_t xlength, const BI_helix *helix, GB_ERROR &error)
long last_position(const char *helixNr) const
char * SEC_foldedHelixList_to_xstring(const char *foldedHelices, size_t xlength, const BI_helix *helix, GB_ERROR &error)
static void error(const char *msg)
const char * helixNr(size_t pos) const
BI_PAIR_TYPE pairtype(size_t pos) const
void nprintf(size_t maxlen, const char *templat,...) __ATTR__FORMAT_MEMBER(2)
char * old_decode_xstring_rel_helix(GB_CSTR rel_helix, size_t xlength, const BI_helix *helix, int *no_of_helices_ptr)