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') {
60 const char *helixNr = helix->
helixNr(pos);
67 bool is_end_and_start = helix->
is_pairpos(pos);
71 error =
GBS_global_string(
"xstring out of sync at position %zu (approximately)\nRefold helices around position!", pos);
76 if (is_end_and_start) {
79 next_is_start = !next_is_start;
83 next_is_start = !next_is_start;
93 char *xstring = ARB_alloc<char>(xlength+1);
94 memset(xstring,
'.', xlength);
101 const char *semi = strchr(foldedHelices,
';');
105 const char *helixNr =
NULp;
108 if (taggedHelixNr[0] ==
'!') {
109 helixNr = taggedHelixNr+1;
111 if (xpos >= 0) ++xpos;
114 helixNr = taggedHelixNr;
122 sec_assert(xpos >= 0 &&
size_t(xpos) < xlength);
128 foldedHelices = semi+1;
139 const char *start_helix_nr =
NULp;
140 int no_of_helices = 0;
144 size_t lastpos = helix->
size()-1;
146 char *x_buffer = ARB_alloc<char>(xlength+1);
147 memset(x_buffer,
'.', xlength);
148 x_buffer[xlength] = 0;
150 for (
size_t pos=0; ; pos++) {
151 const char *helix_nr =
NULp;
154 helix_nr = helix->
helixNr(pos);
156 if (helix_nr==start_helix_nr) {
160 if (start_helix_nr) {
162 helix_nr = helix->
helixNr(pos);
163 char flag = rel_helix[rel_pos++];
171 x_buffer[start_helix] =
'x';
172 x_buffer[end_helix+1] =
'x';
174 else if (flag!=
'0') {
187 start_helix_nr = helix_nr;
191 if (start_helix_nr) {
197 *no_of_helices_ptr = no_of_helices;
bool is_pairpos(size_t pos) const
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
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)