Improved the fasta parser for better memory handling and better parsing

of the last parts of fasta headers (definitions)
This commit is contained in:
Celine Mercier
2017-10-13 18:54:17 +02:00
parent 52e94bbea7
commit a258d334b1
5 changed files with 83 additions and 84 deletions

View File

@ -52,7 +52,7 @@ void printOnlyHeaderFromTable(element_from_header* header, FILE* output)
fprintf(output,">%s ",header[1].value);
for (i = 2; i <= nbf; i++)
for (i = 2; i < nbf; i++)
{
if (strcmp(header[i].name, "definition") != 0)
{
@ -60,11 +60,10 @@ void printOnlyHeaderFromTable(element_from_header* header, FILE* output)
fprintf(output,"=");
fprintf(output,"%s; ",header[i].value);
}
else if (strcmp(header[i].name, "definition") == 0)
fprintf(output,"%s ", header[i].value);
}
if (strcmp(header[nbf].name, "definition") == 0)
fprintf(output,"%s; ",header[nbf].value);
fprintf(output,"\n");
}