void printStats(int uid, long long length, long long A_count, long long T_count, long long G_count, long long C_count, FILE *output) { long long total_count = A_count + T_count + G_count + C_count; fprintf(output, "Total statistics for %d chromosomes\n\n", uid); fprintf(output, "Length: %lld\n", length); fprintf(output, "Nucleotide frequencies:\n"); fprintf(output, "A: % 10lld % 5.2f%%\n", A_count, ((double)A_count / total_count) * 100); fprintf(output, "T: % 10lld % 5.2f%%\n", T_count, ((double)T_count / total_count) * 100); fprintf(output, "G: % 10lld % 5.2f%%\n", G_count, ((double)G_count / total_count) * 100); fprintf(output, "C: % 10lld % 5.2f%%\n", C_count, ((double)C_count / total_count) * 100); fprintf(output, "GC content: %.2f%%\n\n", ((double)(G_count + C_count) / total_count) * 100); } void printFileContent_fgetc_putchar_rewind(FILE *file) { int c; rewind(file); // reset the file position while ((c = fgetc(file)) != EOF) { putchar(c); } printf("\n"); } void printFileContent_fgetc_putchar_fseek(FILE *file) { fseek(file, 0, SEEK_SET); // Set the file position indicator to the beginning of the file int c; while ((c = fgetc(file)) != EOF) { putchar(c); } printf("\n"); } void printFileContent_getc_printf(FILE *f) { int c; while ((c = getc(f)) != EOF){ printf("%c",c); } printf("\n"); } void printFileContent_fread_buffer(FILE *file) { fseek(file, 0, SEEK_SET); // Set the file position indicator to the beginning of the file char buffer[MAX_LINE_LENGTH]; size_t bytesRead; while ((bytesRead = fread(buffer, 1, MAX_LINE_LENGTH, file)) > 0) { fwrite(buffer, 1, bytesRead, stdout); // Print buffer content to stdout } printf("\n"); } void printFileContent_fgets_printf(FILE *file) { fseek(file, 0, SEEK_SET); // Set the file position indicator to the beginning of the file char line[MAX_LINE_LENGTH]; while (fgets(line, MAX_LINE_LENGTH, file) != NULL) { printf("%s", line); // Print each line to stdout } printf("\n"); } void printFileContent_getc_putchar(FILE *file) { fseek(file, 0, SEEK_SET); // Set the file position indicator to the beginning of the file int c; while ((c = getc(file)) != EOF) { putchar(c); // Print each character to stdout } printf("\n"); } ... char *line = NULL; int chromosome_cunter = 0; size_t len = 0; ssize_t read; char *currentUID = NULL; while ((read = getline(&line, &len, fasta)) != -1) { if (line[0] == '>') { ...