]> git.donarmstrong.com Git - biopieces.git/commitdiff
finished c fasta parser
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Thu, 21 Aug 2008 07:57:55 +0000 (07:57 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Thu, 21 Aug 2008 07:57:55 +0000 (07:57 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@217 74ccb610-7750-0410-82ae-013aeee3265d

code_c/Maasha/src/fasta_count.c
code_c/Maasha/src/repeat-O-matic.c

index 0296d555ca15ee1972b8f22450e9e74e248cab7f..37500e16b05c36bf08af69a192e69254fd1b5ac1 100644 (file)
@@ -1,5 +1,6 @@
 #include "common.h"
 #include "filesys.h"
+#include "seq.h"
 #include "fasta.h"
 
 
index 6b640d68dc347d4831affa2d1784c657485538cf..392964c7d1ea515999b8c2d894d13bc9eec87d91 100644 (file)
@@ -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;
 }