diff --git a/Makefile b/Makefile index 7da6d09..98a41c4 100644 --- a/Makefile +++ b/Makefile @@ -10,8 +10,9 @@ tests: python valgrind: python valgrind --tool=memcheck --suppressions=facs/utils/valgrind-python.supp nosetests -P -v -s -python: - rm -rf build/ ${PROG}.so && python setup.py build_ext && python setup.py install +python: clean + python setup.py build_ext && python setup.py install clean: + rm -rf build dist $(PROG).egg-info cd facs; make clean diff --git a/facs/big_query.c b/facs/big_query.c index c511d64..ddee6d1 100644 --- a/facs/big_query.c +++ b/facs/big_query.c @@ -75,9 +75,8 @@ int bq_main(int argc, char** argv) return query(source, ref, tole_rate, sampling_rate, list, target_path); } -int query(char* query, char* bloom_filter, double tole_rate, double sampling_rate, char* list, char* target_path) +int query(char* query, char* bloom_filter, float tole_rate, float sampling_rate, char* list, char* target_path) { - gzFile zip; int type = 0, normal = 0; BIGCAST offset = 0; @@ -95,7 +94,7 @@ int query(char* query, char* bloom_filter, double tole_rate, double sampling_rat if (tole_rate==0) tole_rate = mco_suggestion (bl_2->k_mer); - if ((get_size (query)<2*ONEG) && !strstr(query,".gz") & !strstr(query, ".tar")) + if ((get_size (query)<2*ONEG) && !strstr(query,".gz") && !strstr(query, ".tar")) normal = 1; else { @@ -107,7 +106,7 @@ int query(char* query, char* bloom_filter, double tole_rate, double sampling_rat normal = 0; } - if (strstr(query, ".fastq") || strstr(query, ".fq")) + if (strstr(query, ".fastq")!=NULL || strstr(query, ".fq")!=NULL) type = 2; else type = 1; @@ -171,9 +170,12 @@ int query(char* query, char* bloom_filter, double tole_rate, double sampling_rat } //end while if (normal == 0) - free (position); + free (position); + evaluate (detail, File_head->filename, File_head); - //if(zip != NULL) gzclose(zip); + + if (normal == 0) + gzclose(zip); bloom_destroy (bl_2); statistic_save (detail, query, target_path); diff --git a/facs/big_query.h b/facs/big_query.h index 7a2ab44..d764e17 100644 --- a/facs/big_query.h +++ b/facs/big_query.h @@ -11,5 +11,5 @@ extern void clean_list (Queue* head, Queue *tail); extern BIGCAST CHUNKer(gzFile zip,BIGCAST offset,int chunk,char *data,int type); extern BIGCAST CHUNKgz(gzFile zip, BIGCAST offset,int chunk,char *position,char *extra,int type); extern int bq_main (int argc, char **argv); -extern int query (char* query, char* bloom_filter, double tole_rate, double sampling_rate, char* list, char* target_path); +extern int query (char* query, char* bloom_filter, float tole_rate, float sampling_rate, char* list, char* target_path); #endif diff --git a/facs/check.h b/facs/check.h index 2555828..49c21c0 100644 --- a/facs/check.h +++ b/facs/check.h @@ -4,6 +4,6 @@ #include "bloom.h" extern void evaluate (char *detail, char *filename, F_set *File_head); extern void statistic_save (char *detail, char *filename, char* prefix); -void fasta_process (bloom * bl, Queue * info, Queue * tail, F_set *File_head, float sampling_rate, float tole_rate); - +extern void fasta_process (bloom * bl, Queue * info, Queue * tail, F_set *File_head, float sampling_rate, float tole_rate); +extern void fastq_process (bloom * bl, Queue * info, Queue *tail, F_set * File_head, float sampling_rate, float tole_rate); #endif diff --git a/facs/facs b/facs/facs deleted file mode 100755 index 0314035..0000000 Binary files a/facs/facs and /dev/null differ diff --git a/facs/facs.c b/facs/facs.c index 1dbf7cf..12a69fc 100644 --- a/facs/facs.c +++ b/facs/facs.c @@ -28,7 +28,7 @@ PyMODINIT_FUNC init_facs(void) { PyObject *m = Py_InitModule3("_facs", module_methods, module_docstring); if (m == NULL) - return -1; + return; } diff --git a/facs/file_dir.c b/facs/file_dir.c index f38c201..6459a46 100644 --- a/facs/file_dir.c +++ b/facs/file_dir.c @@ -120,7 +120,6 @@ make_list (char *file_user, char *list_user) if (!strstr (dir_info->d_name, ".bloom")) continue; - printf ("file_path->%s\n", file_path); F_set *fset = NEW (F_set); fset->filename = file_path; fset->number = &number; diff --git a/facs/simple_check_1_ge.c b/facs/simple_check_1_ge.c index 74c4b90..68d6fd2 100644 --- a/facs/simple_check_1_ge.c +++ b/facs/simple_check_1_ge.c @@ -38,11 +38,12 @@ fastq_process (bloom * bl, Queue * info, Queue *tail, F_set * File_head, next = info->next->location; } else { next = strchr (p, '\0'); + if ((next-1)=='\n') + next-=1; } - + while (p != next) { - //printf ("p->%0.50s\n",p); temp = jump (p, 2, sampling_rate); //generate random number and judge if need to scan this read if (p != temp) @@ -50,7 +51,6 @@ fastq_process (bloom * bl, Queue * info, Queue *tail, F_set * File_head, p = temp; continue; } - #pragma omp atomic File_head->reads_num++; @@ -59,7 +59,6 @@ fastq_process (bloom * bl, Queue * info, Queue *tail, F_set * File_head, #pragma omp atomic File_head->reads_contam++; } - p = strchr (p, '\n') + 1; p = strchr (p, '\n') + 1; p = strchr (p, '\n') + 1; @@ -84,7 +83,11 @@ fasta_process (bloom * bl, Queue * info, Queue * tail, F_set * File_head, else if (info->next != tail) next = info->next->location; else - next = strchr (info->location, '\0'); + { + next = strchr (info->location, '\0'); + if ((next-1)=='\n') + next -= 1; + } char *p = info->location; diff --git a/facs/simple_remove.c b/facs/simple_remove.c index 9092eed..424be78 100644 --- a/facs/simple_remove.c +++ b/facs/simple_remove.c @@ -67,8 +67,6 @@ int remove_reads(char *source, char *ref, char *list, char *prefix, float tole_r /*-------------------------------------*/ int type = 1; char *position; - //char *clean; - //char *contam; char *clean2; char *contam2; /*-------------------------------------*/ @@ -83,6 +81,7 @@ int remove_reads(char *source, char *ref, char *list, char *prefix, float tole_r /*-------------------------------------*/ position = mmaping (source); type = get_parainfo (position, head); + //printf ("position->%0.10s\n",head->next->location); clean = (char *) malloc (strlen (position) * sizeof (char)); contam = (char *) malloc (strlen (position) * sizeof (char)); clean2 = clean; @@ -96,6 +95,7 @@ int remove_reads(char *source, char *ref, char *list, char *prefix, float tole_r if (tole_rate==0) tole_rate = mco_suggestion (bl_2->k_mer); + //head = head->next; #pragma omp parallel { #pragma omp single nowait diff --git a/setup.cfg b/setup.cfg index 01bb954..21cced6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,2 @@ [egg_info] -tag_build = dev -tag_svn_revision = true +tag_svn_revision = false