Skip to content

Commit f5ec7ee

Browse files
author
Roman Valls Guimera
committed
Merge with enze, Makefile cleanup and correct PyInit
2 parents 8729291 + 3dba043 commit f5ec7ee

File tree

10 files changed

+26
-22
lines changed

10 files changed

+26
-22
lines changed

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ tests: python
1010
valgrind: python
1111
valgrind --tool=memcheck --suppressions=facs/utils/valgrind-python.supp nosetests -P -v -s
1212

13-
python:
14-
rm -rf build/ ${PROG}.so && python setup.py build_ext && python setup.py install
13+
python: clean
14+
python setup.py build_ext && python setup.py install
1515

1616
clean:
17+
rm -rf build dist $(PROG).egg-info
1718
cd facs; make clean

facs/big_query.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,8 @@ int bq_main(int argc, char** argv)
7575
return query(source, ref, tole_rate, sampling_rate, list, target_path);
7676
}
7777

78-
int query(char* query, char* bloom_filter, double tole_rate, double sampling_rate, char* list, char* target_path)
78+
int query(char* query, char* bloom_filter, float tole_rate, float sampling_rate, char* list, char* target_path)
7979
{
80-
8180
gzFile zip;
8281
int type = 0, normal = 0;
8382
BIGCAST offset = 0;
@@ -95,7 +94,7 @@ int query(char* query, char* bloom_filter, double tole_rate, double sampling_rat
9594
if (tole_rate==0)
9695
tole_rate = mco_suggestion (bl_2->k_mer);
9796

98-
if ((get_size (query)<2*ONEG) && !strstr(query,".gz") & !strstr(query, ".tar"))
97+
if ((get_size (query)<2*ONEG) && !strstr(query,".gz") && !strstr(query, ".tar"))
9998
normal = 1;
10099
else
101100
{
@@ -107,7 +106,7 @@ int query(char* query, char* bloom_filter, double tole_rate, double sampling_rat
107106
normal = 0;
108107
}
109108

110-
if (strstr(query, ".fastq") || strstr(query, ".fq"))
109+
if (strstr(query, ".fastq")!=NULL || strstr(query, ".fq")!=NULL)
111110
type = 2;
112111
else
113112
type = 1;
@@ -171,9 +170,12 @@ int query(char* query, char* bloom_filter, double tole_rate, double sampling_rat
171170

172171
} //end while
173172
if (normal == 0)
174-
free (position);
173+
free (position);
174+
175175
evaluate (detail, File_head->filename, File_head);
176-
//if(zip != NULL) gzclose(zip);
176+
177+
if (normal == 0)
178+
gzclose(zip);
177179
bloom_destroy (bl_2);
178180
statistic_save (detail, query, target_path);
179181

facs/big_query.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ extern void clean_list (Queue* head, Queue *tail);
1111
extern BIGCAST CHUNKer(gzFile zip,BIGCAST offset,int chunk,char *data,int type);
1212
extern BIGCAST CHUNKgz(gzFile zip, BIGCAST offset,int chunk,char *position,char *extra,int type);
1313
extern int bq_main (int argc, char **argv);
14-
extern int query (char* query, char* bloom_filter, double tole_rate, double sampling_rate, char* list, char* target_path);
14+
extern int query (char* query, char* bloom_filter, float tole_rate, float sampling_rate, char* list, char* target_path);
1515
#endif

facs/check.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
#include "bloom.h"
55
extern void evaluate (char *detail, char *filename, F_set *File_head);
66
extern void statistic_save (char *detail, char *filename, char* prefix);
7-
void fasta_process (bloom * bl, Queue * info, Queue * tail, F_set *File_head, float sampling_rate, float tole_rate);
8-
7+
extern void fasta_process (bloom * bl, Queue * info, Queue * tail, F_set *File_head, float sampling_rate, float tole_rate);
8+
extern void fastq_process (bloom * bl, Queue * info, Queue *tail, F_set * File_head, float sampling_rate, float tole_rate);
99
#endif

facs/facs

-206 KB
Binary file not shown.

facs/facs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ PyMODINIT_FUNC init_facs(void)
2828
{
2929
PyObject *m = Py_InitModule3("_facs", module_methods, module_docstring);
3030
if (m == NULL)
31-
return -1;
31+
return;
3232
}
3333

3434

facs/file_dir.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ make_list (char *file_user, char *list_user)
120120
if (!strstr (dir_info->d_name, ".bloom"))
121121
continue;
122122

123-
printf ("file_path->%s\n", file_path);
124123
F_set *fset = NEW (F_set);
125124
fset->filename = file_path;
126125
fset->number = &number;

facs/simple_check_1_ge.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ fastq_process (bloom * bl, Queue * info, Queue *tail, F_set * File_head,
3838
next = info->next->location;
3939
} else {
4040
next = strchr (p, '\0');
41+
if ((next-1)=='\n')
42+
next-=1;
4143
}
42-
44+
4345
while (p != next)
4446
{
45-
//printf ("p->%0.50s\n",p);
4647
temp = jump (p, 2, sampling_rate); //generate random number and judge if need to scan this read
4748

4849
if (p != temp)
4950
{
5051
p = temp;
5152
continue;
5253
}
53-
5454
#pragma omp atomic
5555
File_head->reads_num++;
5656

@@ -59,7 +59,6 @@ fastq_process (bloom * bl, Queue * info, Queue *tail, F_set * File_head,
5959
#pragma omp atomic
6060
File_head->reads_contam++;
6161
}
62-
6362
p = strchr (p, '\n') + 1;
6463
p = strchr (p, '\n') + 1;
6564
p = strchr (p, '\n') + 1;
@@ -84,7 +83,11 @@ fasta_process (bloom * bl, Queue * info, Queue * tail, F_set * File_head,
8483
else if (info->next != tail)
8584
next = info->next->location;
8685
else
87-
next = strchr (info->location, '\0');
86+
{
87+
next = strchr (info->location, '\0');
88+
if ((next-1)=='\n')
89+
next -= 1;
90+
}
8891

8992
char *p = info->location;
9093

facs/simple_remove.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ int remove_reads(char *source, char *ref, char *list, char *prefix, float tole_r
6767
/*-------------------------------------*/
6868
int type = 1;
6969
char *position;
70-
//char *clean;
71-
//char *contam;
7270
char *clean2;
7371
char *contam2;
7472
/*-------------------------------------*/
@@ -83,6 +81,7 @@ int remove_reads(char *source, char *ref, char *list, char *prefix, float tole_r
8381
/*-------------------------------------*/
8482
position = mmaping (source);
8583
type = get_parainfo (position, head);
84+
//printf ("position->%0.10s\n",head->next->location);
8685
clean = (char *) malloc (strlen (position) * sizeof (char));
8786
contam = (char *) malloc (strlen (position) * sizeof (char));
8887
clean2 = clean;
@@ -96,6 +95,7 @@ int remove_reads(char *source, char *ref, char *list, char *prefix, float tole_r
9695

9796
if (tole_rate==0)
9897
tole_rate = mco_suggestion (bl_2->k_mer);
98+
//head = head->next;
9999
#pragma omp parallel
100100
{
101101
#pragma omp single nowait

setup.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
[egg_info]
2-
tag_build = dev
3-
tag_svn_revision = true
2+
tag_svn_revision = false

0 commit comments

Comments
 (0)