X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=code_c%2FMaasha%2Fsrc%2Fbed2tag_contigs.c;h=b1bff76679046e2ad928bf3f02693293d9b9a4c1;hb=92dba07b3dd9837ed90212126998a8a1f9e00652;hp=ae61b359ddcfbea6f391d35f2c835eced72f2e7a;hpb=0f0dd167be99f185b327beee5c49363ae2e1c8b2;p=biopieces.git diff --git a/code_c/Maasha/src/bed2tag_contigs.c b/code_c/Maasha/src/bed2tag_contigs.c index ae61b35..b1bff76 100644 --- a/code_c/Maasha/src/bed2tag_contigs.c +++ b/code_c/Maasha/src/bed2tag_contigs.c @@ -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++; }