]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_c/Maasha/src/bed2tag_contigs.c
changed barray from ushort to uint
[biopieces.git] / code_c / Maasha / src / bed2tag_contigs.c
index ae61b359ddcfbea6f391d35f2c835eced72f2e7a..38fd25cb67aae7f430738ba80178b88c2f8611a6 100644 (file)
@@ -70,13 +70,13 @@ int main( int argc, char *argv[] )
     hash      *chr_hash = NULL;
     hash_elem *bucket   = NULL;
     barray    *ba       = NULL;
-    ushort     score    = 0;
+    uint       score    = 0;
     size_t     i        = 0;
     char      *chr      = NULL;
     size_t     beg      = 0;
     size_t     end      = 0;
     size_t     pos      = 0;
-    ushort     max      = 0;
+    uint       max      = 0;
     size_t     id       = 0;
 
     entry    = bed_entry_new( BED_COLS );
@@ -99,10 +99,10 @@ int main( int argc, char *argv[] )
             hash_add( chr_hash, entry->chr, ba );
         }
 
-        score = ( ushort ) get_score( entry->q_id );
+        score = ( uint ) get_score( entry->q_id );
 
-        if ( score > entry->score ) {
-            barray_interval_inc( ba, entry->chr_beg, entry->chr_end - 1, ( short ) score / entry->score );
+        if ( score > entry->score && entry->score > 0 ) {
+            barray_interval_inc( ba, entry->chr_beg, entry->chr_end - 1, ( uint ) ( score / entry->score ) );
         }
     }
 
@@ -123,7 +123,7 @@ int main( int argc, char *argv[] )
 
 //                printf( "chr: %s   pos: %zu   beg: %zu   end: %zu   max: %hd\n", chr, pos, beg, end, max );
 
-                printf( "%s\t%zu\t%zu\tID_%08zu\t%hd\n", chr, beg, end + 1, id, max );
+                printf( "%s\t%zu\t%zu\t%s_%08zu\t%u\n", chr, beg, end + 1, chr, id, ( uint ) max );
 
                 id++;
             }