From 33dfd469ec9ff66c2cc31f8191ae7205860531eb Mon Sep 17 00:00:00 2001 From: martinahansen Date: Thu, 21 Aug 2008 07:57:55 +0000 Subject: [PATCH] finished c fasta parser git-svn-id: http://biopieces.googlecode.com/svn/trunk@217 74ccb610-7750-0410-82ae-013aeee3265d --- code_c/Maasha/src/fasta_count.c | 1 + code_c/Maasha/src/repeat-O-matic.c | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/code_c/Maasha/src/fasta_count.c b/code_c/Maasha/src/fasta_count.c index 0296d55..37500e1 100644 --- a/code_c/Maasha/src/fasta_count.c +++ b/code_c/Maasha/src/fasta_count.c @@ -1,5 +1,6 @@ #include "common.h" #include "filesys.h" +#include "seq.h" #include "fasta.h" diff --git a/code_c/Maasha/src/repeat-O-matic.c b/code_c/Maasha/src/repeat-O-matic.c index 6b640d6..392964c 100644 --- a/code_c/Maasha/src/repeat-O-matic.c +++ b/code_c/Maasha/src/repeat-O-matic.c @@ -14,6 +14,7 @@ #include "common.h" #include "mem.h" #include "filesys.h" +#include "seq.h" #include "fasta.h" // #define OLIGO_SIZE 15 @@ -63,7 +64,6 @@ uint *oligo_count( char *path ) uint C_rc = ( 1 << ( UINT_BITS - 2 ) ); /* 01 on the leftmost two bits an uint. */ seq_entry *entry = NULL; FILE *fp = NULL; - file_buffer *buffer = NULL; array = mem_get_zero( sizeof( uint ) * SIZE ); @@ -73,7 +73,7 @@ uint *oligo_count( char *path ) fp = read_open( path ); - while ( ( fasta_get_entry( &buffer, &entry ) ) ) + while ( ( fasta_get_entry( fp, &entry ) ) ) { fprintf( stderr, "Counting oligos in: %s ... ", entry->seq_name ); @@ -120,7 +120,9 @@ uint *oligo_count( char *path ) close_stream( fp ); - fasta_free_entry( entry ); + free( entry->seq_name ); + free( entry->seq ); + entry = NULL; return array; } -- 2.39.2