diff --git a/.cproject b/.cproject new file mode 100644 index 0000000..9b5d610 --- /dev/null +++ b/.cproject @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..6eeccd3 --- /dev/null +++ b/.project @@ -0,0 +1,83 @@ + + + ecoPCR + + + + + + org.python.pydev.PyDevBuilder + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + org.eclipse.cdt.make.core.fullBuildTarget + all + + + ?name? + + + + org.eclipse.cdt.make.core.enableAutoBuild + false + + + org.eclipse.cdt.make.core.enableFullBuild + true + + + org.eclipse.cdt.make.core.enableCleanBuild + true + + + org.eclipse.cdt.make.core.cleanBuildTarget + clean + + + org.eclipse.cdt.make.core.append_environment + true + + + org.eclipse.cdt.make.core.contents + org.eclipse.cdt.make.core.activeConfigSettings + + + org.eclipse.cdt.make.core.useDefaultBuildCmd + true + + + org.eclipse.cdt.make.core.buildArguments + + + + org.eclipse.cdt.make.core.buildCommand + make + + + org.eclipse.cdt.make.core.autoBuildTarget + all + + + org.eclipse.cdt.make.core.stopOnError + true + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.python.pydev.pythonNature + + diff --git a/.pydevproject b/.pydevproject new file mode 100644 index 0000000..7ecaddf --- /dev/null +++ b/.pydevproject @@ -0,0 +1,7 @@ + + + + +python 2.4 +Default + diff --git a/src/ecoPCR.gz b/src/ecoPCR.gz new file mode 100755 index 0000000..9209860 Binary files /dev/null and b/src/ecoPCR.gz differ diff --git a/src/ecofind.gz b/src/ecofind.gz new file mode 100755 index 0000000..247ccab Binary files /dev/null and b/src/ecofind.gz differ diff --git a/src/ecogrep b/src/ecogrep new file mode 100755 index 0000000..09d3ffe Binary files /dev/null and b/src/ecogrep differ diff --git a/src/ecogrep.gz b/src/ecogrep.gz new file mode 100755 index 0000000..0edd67e Binary files /dev/null and b/src/ecogrep.gz differ diff --git a/src/ecoisundertaxon b/src/ecoisundertaxon new file mode 100755 index 0000000..7db5963 Binary files /dev/null and b/src/ecoisundertaxon differ diff --git a/src/libecoPCR/ecoseq.c b/src/libecoPCR/ecoseq.c index 2ec2614..7f5ba27 100644 --- a/src/libecoPCR/ecoseq.c +++ b/src/libecoPCR/ecoseq.c @@ -4,6 +4,7 @@ #include #include #include +#include static FILE *open_seqfile(const char *prefix,int32_t index); @@ -11,32 +12,32 @@ static FILE *open_seqfile(const char *prefix,int32_t index); ecoseq_t *new_ecoseq() { void *tmp; - + tmp = ECOMALLOC(sizeof(ecoseq_t),"Allocate new ecoseq structure"); - + return tmp; } int32_t delete_ecoseq(ecoseq_t * seq) { - + if (seq) { if (seq->AC) ECOFREE(seq->AC,"Free sequence AC"); - + if (seq->DE) ECOFREE(seq->DE,"Free sequence DE"); - + if (seq->SQ) ECOFREE(seq->SQ,"Free sequence SQ"); - + ECOFREE(seq,"Free sequence structure"); - + return 0; - + } - + return 1; } @@ -49,9 +50,9 @@ ecoseq_t *new_ecoseq_with_data( char *AC, ecoseq_t *tmp; int32_t lstr; tmp = new_ecoseq(); - + tmp->taxid=taxid_idx; - + if (AC) { lstr =strlen(AC); @@ -97,12 +98,14 @@ ecoseq_t *readnext_ecoseq(FILE *f) int32_t comp_status; unsigned long int seqlength; int32_t rs; - + char *c; + int32_t i; + raw = read_ecorecord(f,&rs); - + if (!raw) return NULL; - + if (is_big_endian()) { raw->CSQ_length = swap_int32_t(raw->CSQ_length); @@ -110,44 +113,48 @@ ecoseq_t *readnext_ecoseq(FILE *f) raw->SQ_length = swap_int32_t(raw->SQ_length); raw->taxid = swap_int32_t(raw->taxid); } - + seq = new_ecoseq(); - + seq->taxid = raw->taxid; - + seq->AC = ECOMALLOC(strlen(raw->AC) +1, "Allocate Sequence Accesion number"); strncpy(seq->AC,raw->AC,strlen(raw->AC)); - + seq->DE = ECOMALLOC(raw->DE_length+1, "Allocate Sequence definition"); strncpy(seq->DE,raw->data,raw->DE_length); - + seqlength = seq->SQ_length = raw->SQ_length; - + compressed = raw->data + raw->DE_length; seq->SQ = ECOMALLOC(seqlength+1, "Allocate sequence buffer"); - + comp_status = uncompress((unsigned char*)seq->SQ, &seqlength, (unsigned char*)compressed, raw->CSQ_length); - + if (comp_status != Z_OK) ECOERROR(ECO_IO_ERROR,"I cannot uncompress sequence data"); - + + for (c=seq->SQ,i=0;i= 1024) ECOERROR(ECO_ASSERT_ERROR,"file name is too long"); filename_buffer[filename_length]=0; - + input=open_ecorecorddb(filename_buffer,&seqcount,0); - + if (input) fprintf(stderr,"# Reading file %s containing %d sequences...\n", filename_buffer, seqcount); - + return input; } @@ -186,38 +193,38 @@ ecoseq_t *ecoseq_iterator(const char *prefix) static int32_t current_file_idx = 1; static char current_prefix[1024]; ecoseq_t *seq; - + if (prefix) { current_file_idx = 1; if (current_seq_file) fclose(current_seq_file); - + strncpy(current_prefix,prefix,1023); current_prefix[1024]=0; - + current_seq_file = open_seqfile(current_prefix, current_file_idx); - + if (!current_seq_file) return NULL; - + } - + seq = readnext_ecoseq(current_seq_file); - + if (!seq && feof(current_seq_file)) { current_file_idx++; fclose(current_seq_file); current_seq_file = open_seqfile(current_prefix, current_file_idx); - - + + if (current_seq_file) seq = readnext_ecoseq(current_seq_file); } - + return seq; -} \ No newline at end of file +}