From: martinahansen Date: Mon, 21 Jul 2008 03:50:48 +0000 (+0000) Subject: changed wib dir from BP_DATA to ~/ucsc X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=85d8c378792d64aa26325bd1e6e750aa44fd83f0;p=biopieces.git changed wib dir from BP_DATA to ~/ucsc git-svn-id: http://biopieces.googlecode.com/svn/trunk@178 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/code_c/Maasha/src/gmon.out b/code_c/Maasha/src/gmon.out index efb143a..0459c2d 100644 Binary files a/code_c/Maasha/src/gmon.out and b/code_c/Maasha/src/gmon.out differ diff --git a/code_c/Maasha/src/repeat-O-matic.c b/code_c/Maasha/src/repeat-O-matic.c index 905d298..8ce9232 100644 --- a/code_c/Maasha/src/repeat-O-matic.c +++ b/code_c/Maasha/src/repeat-O-matic.c @@ -11,16 +11,12 @@ complete the human genome in roughly 30 minutes. */ - - - -#include -#include #include "common.h" #include "filesys.h" #include "fasta.h" -#define OLIGO_SIZE 15 +// #define OLIGO_SIZE 15 +#define OLIGO_SIZE 5 #define SIZE ( 1 << ( OLIGO_SIZE * 2 ) ) #define UINT_BITS 32 @@ -28,17 +24,17 @@ #define C 1 /* 01 on the rightmost two bits of bin. */ #define G 2 /* 10 on the rightmost two bits of bin. */ -uint mask_create( int oligo_size ); uint *oligo_count( char *path ); +uint mask_create( int oligo_size ); void oligo_count_output( char *path, uint *array ); void fixedstep_put_entry( char *chr, int beg, int step_size, uint *block_array, int block_size ); int main( int argc, char *argv[] ) { - char *path; - uint *array; + char *path = NULL; + uint *array = NULL; - path = argv[ 1 ]; + path = argv[ 1 ]; array = oligo_count( path ); @@ -48,46 +44,24 @@ int main( int argc, char *argv[] ) } -uint mask_create( int oligo_size ) -{ - /* Martin A. Hansen, June 2008 */ - - /* Create a bit mask for binary encode oligos less than sizeof( uint ). */ - - uint i; - uint mask; - - mask = 0; - - for ( i = 0; i < oligo_size; i++ ) - { - mask <<= 2; - - mask |= 3; - } - - return mask; -} - - uint *oligo_count( char *path ) { /* Martin A. Hansen, June 2008 */ /* Count the occurence of all oligos of a fixed size in a FASTA file. */ - uint *array; - uint i; - uint mask; - uint bin; - uint bin_rc1; - uint bin_rc2; - uint j; - uint A_rc = ( 3 << ( UINT_BITS - 2 ) ); /* 11 on the leftmost two bits an uint. */ - uint G_rc = ( 2 << ( UINT_BITS - 2 ) ); /* 10 on the leftmost two bits an uint. */ - uint C_rc = ( 1 << ( UINT_BITS - 2 ) ); /* 01 on the leftmost two bits an uint. */ - struct seq_entry *entry; - FILE *fp; + uint *array = NULL; + uint i = 0; + uint mask = 0; + uint bin = 0; + uint bin_rc1 = 0; + uint bin_rc2 = 0; + uint j = 0; + uint A_rc = ( 3 << ( UINT_BITS - 2 ) ); /* 11 on the leftmost two bits an uint. */ + uint G_rc = ( 2 << ( UINT_BITS - 2 ) ); /* 10 on the leftmost two bits an uint. */ + uint C_rc = ( 1 << ( UINT_BITS - 2 ) ); /* 01 on the leftmost two bits an uint. */ + struct seq_entry *entry = NULL; + FILE *fp = NULL; array = mem_get_zero( sizeof( uint ) * SIZE ); @@ -150,6 +124,28 @@ uint *oligo_count( char *path ) } +uint mask_create( int oligo_size ) +{ + /* Martin A. Hansen, June 2008 */ + + /* Create a bit mask for binary encode oligos less than sizeof( uint ). */ + + uint i; + uint mask; + + mask = 0; + + for ( i = 0; i < oligo_size; i++ ) + { + mask <<= 2; + + mask |= 3; + } + + return mask; +} + + void oligo_count_output( char *path, uint *array ) { /* Martin A. Hansen, June 2008 */ diff --git a/code_c/Maasha/src/test.c b/code_c/Maasha/src/test.c index f7ed89e..6a89d40 100644 --- a/code_c/Maasha/src/test.c +++ b/code_c/Maasha/src/test.c @@ -16,7 +16,7 @@ int main( int argc, char *argv[] ) fscanf( "%s\t%d\t%d", fp, chr, chr_beg, chr_end ); - print ( "CHR: %s CHR_BEG: %d CHR_END: %d\n", chr, chr_beg, chr_end ); + printf( "CHR: %s CHR_BEG: %d CHR_END: %d\n", chr, chr_beg, chr_end ); close_stream( fp ); diff --git a/code_c/Maasha/src/test_fasta.c b/code_c/Maasha/src/test_fasta.c index 86a4698..f966764 100644 --- a/code_c/Maasha/src/test_fasta.c +++ b/code_c/Maasha/src/test_fasta.c @@ -3,6 +3,28 @@ #include "list.h" #include "fasta.h" +int main() +{ + char *file = NULL; + FILE *fp = NULL; + struct seq_entry *entry = NULL; + + file = "/Users/m.hansen/test.fna"; + + fp = read_open( file ); + + while ( ( fasta_get_entry( fp, entry ) != NULL ) ) + { + printf( "seq_name: %s seq: %s seq_len: %i\n", entry->seq_name, entry->seq, entry->seq_len ); + } + + close_stream( fp ); + + return 0; +} + +/* + int main() { char *file = "/Users/m.hansen/test.fna"; @@ -20,3 +42,4 @@ int main() return 0; } +*/ diff --git a/code_perl/Maasha/Biopieces.pm b/code_perl/Maasha/Biopieces.pm index 06d4b3d..e883884 100644 --- a/code_perl/Maasha/Biopieces.pm +++ b/code_perl/Maasha/Biopieces.pm @@ -5609,7 +5609,7 @@ sub script_upload_to_ucsc $wig_file = "$options->{ 'table' }.wig"; $wib_file = "$options->{ 'table' }.wib"; - $wib_dir = "$ENV{ 'BP_DATA' }/genomes/$options->{ 'database' }/wib"; + $wib_dir = "$ENV{ 'HOME' }/ucsc/wib"; Maasha::Common::dir_create_if_not_exists( $wib_dir );