7 for (j=0; j<len; j++) {
8 if (
string[j] ==
'"')
string[j] =
'`';
9 else if (
string[j] ==
'{')
string[j] =
'(';
10 else if (
string[j] ==
'}')
string[j] =
')';
18 for (j=0; j<len; j++) {
19 if (
string[j] ==
'"')
string[j] =
' ';
22 for (j=0;
string[j]==
' ' && j<(
int)strlen(
string); j++) ;
25 for (i=0; i<len - j; i++)
string[i] =
string[i+j];
27 for (j=strlen(
string)-1; j>=0 && (
string[j]==
'\n'||
string[j]==
' '); j--) {
34 FILE *file = fopen(filename,
"w");
36 Warning(
"Cannot open file for output");
46 fprintf(file,
"name \"%s\"\n", this_elem->
short_name);
49 case DNA: fprintf(file,
"type \"DNA\"\n");
break;
50 case RNA: fprintf(file,
"type \"RNA\"\n");
break;
51 case PROTEIN: fprintf(file,
"type \"PROTEIN\"\n");
break;
52 case MASK: fprintf(file,
"type \"MASK\"\n");
break;
53 case TEXT: fprintf(file,
"type \"TEXT\"\n");
break;
55 if (this_elem->
seq_name[0]) fprintf(file,
"longname %s\n", this_elem->
seq_name);
56 if (this_elem->
id[0]) fprintf(file,
"sequence-ID \"%s\"\n", this_elem->
id);
60 if (this_elem->
barcode[0]) fprintf(file,
"barcode \"%s\"\n", this_elem->
barcode);
61 if (this_elem->
membrane[0]) fprintf(file,
"membrane \"%s\"\n", this_elem->
membrane);
62 if (this_elem->
contig[0]) fprintf(file,
"contig \"%s\"\n", this_elem->
contig);
65 if (this_elem->
groupid) fprintf(file,
"group-ID %zu\n", this_elem->
groupid);
70 "creation-date %2d/%2d/%2d %2d:%2d:%2d\n",
92 fprintf(file,
"comments \"%s\"\n", this_elem->
comments);
96 fprintf(file,
"%s", this_elem->
baggage);
99 fprintf(file,
"%s\n", this_elem->
baggage);
102 fprintf(file,
"sequence \"");
104 for (
int k=this_elem->
offset; k<this_elem->seqlen+this_elem->
offset; k++) {
105 if (k%60 == 0) putc(
'\n', file);
108 fprintf(file,
"\"\n");
111 for (
int k=this_elem->
offset; k<this_elem->seqlen+this_elem->
offset; k++) {
112 if (k%60 == 0) putc(
'\n', file);
113 putc(
getelem(this_elem, k), file);
115 fprintf(file,
"\"\n");
117 fprintf(file,
"}\n");
130 static char vname[32];
137 sprintf(vname,
"host:%d:%ld", cnt, *tp);
char short_name[SIZE_SHORT_NAME]
char seq_name[SIZE_SEQ_NAME]
static void RemoveQuotes(char *string)
#define IS_ORIG_SECONDARY
struct TimeStamp::@1 origin
static void StripSpecial(char *string)
void Warning(const char *s)
TYPE * ARB_calloc(size_t nelem)
int getelem(NA_Sequence *a, int b)
int WriteGDE(NA_Alignment &aln, char *filename, int method)
char description[SIZE_DESCRIPTION]
char authority[SIZE_AUTHORITY]