Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
ecoprimers
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
OBITools
ecoprimers
Commits
73236c72
Commit
73236c72
authored
Jan 22, 2019
by
Celine Mercier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
version 0.5: ecoPrimers can now read *.ldx files (local taxa)
parent
eb8d4452
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
14 deletions
+35
-14
VERSION
VERSION
+2
-2
ecoprimer.c
src/ecoprimer.c
+1
-1
ecoPCR.h
src/libecoPCR/ecoPCR.h
+1
-1
ecotax.c
src/libecoPCR/ecotax.c
+31
-10
No files found.
VERSION
View file @
73236c72
0.4
\ No newline at end of file
0.5
\ No newline at end of file
src/ecoprimer.c
View file @
73236c72
...
...
@@ -20,7 +20,7 @@
#include"libthermo/thermostats.h"
#define VERSION "0.
4
"
#define VERSION "0.
5
"
/* TR: by default, statistics are made on species level*/
#define DEFAULTTAXONRANK "species"
...
...
src/libecoPCR/ecoPCR.h
View file @
73236c72
...
...
@@ -219,7 +219,7 @@ econameidx_t *read_nameidx(const char *filename,ecotaxonomy_t *taxonomy);
* @return pointer to a taxonomy index structure
*/
ecotxidx_t
*
read_taxonomyidx
(
const
char
*
filename
);
ecotxidx_t
*
read_taxonomyidx
(
const
char
*
filename
,
const
char
*
filename2
);
ecotaxonomy_t
*
read_taxonomy
(
const
char
*
prefix
,
int32_t
readAlternativeName
);
...
...
src/libecoPCR/ecotax.c
View file @
73236c72
...
...
@@ -10,23 +10,41 @@ static ecotx_t *readnext_ecotaxon(FILE *f,ecotx_t *taxon);
* @param pointer to the database (.tdx file)
* @return a ecotxidx_t structure
*/
ecotxidx_t
*
read_taxonomyidx
(
const
char
*
filename
)
ecotxidx_t
*
read_taxonomyidx
(
const
char
*
filename
,
const
char
*
filename2
)
{
int32_t
count
;
int32_t
count2
;
FILE
*
f
;
FILE
*
f2
;
ecotxidx_t
*
index
;
int32_t
i
;
f
=
open_ecorecorddb
(
filename
,
&
count
,
1
);
f
=
open_ecorecorddb
(
filename
,
&
count
,
1
);
f2
=
open_ecorecorddb
(
filename2
,
&
count2
,
0
);
index
=
(
ecotxidx_t
*
)
ECOMALLOC
(
sizeof
(
ecotxidx_t
)
+
sizeof
(
ecotx_t
)
*
(
count
-
1
),
index
=
(
ecotxidx_t
*
)
ECOMALLOC
(
sizeof
(
ecotxidx_t
)
+
sizeof
(
ecotx_t
)
*
(
count
+
count2
-
1
),
"Allocate taxonomy"
);
index
->
count
=
count
;
index
->
count
=
count
+
count2
;
fprintf
(
stderr
,
"Reading %d taxa...
\n
"
,
count
);
for
(
i
=
0
;
i
<
count
;
i
++
){
readnext_ecotaxon
(
f
,
&
(
index
->
taxon
[
i
]));
index
->
taxon
[
i
].
parent
=
index
->
taxon
+
(
size
_t
)
index
->
taxon
[
i
].
parent
;
index
->
taxon
[
i
].
parent
=
index
->
taxon
+
(
int32
_t
)
index
->
taxon
[
i
].
parent
;
}
if
(
count2
>
0
)
fprintf
(
stderr
,
"Reading %d local taxa...
\n
"
,
count2
);
else
fprintf
(
stderr
,
"No local taxon
\n
"
);
for
(
i
=
0
;
i
<
count2
;
i
++
){
readnext_ecotaxon
(
f2
,
&
(
index
->
taxon
[
count
+
i
]));
index
->
taxon
[
count
+
i
].
parent
=
index
->
taxon
+
(
int32_t
)
index
->
taxon
[
count
+
i
].
parent
;
}
return
index
;
}
...
...
@@ -111,33 +129,36 @@ ecotaxonomy_t *read_taxonomy(const char *prefix,int32_t readAlternativeName)
{
ecotaxonomy_t
*
tax
;
char
*
filename
;
char
*
filename2
;
int
buffsize
;
tax
=
ECOMALLOC
(
sizeof
(
ecotaxonomy_t
),
"Allocate taxonomy structure"
);
"Allocate taxonomy structure"
);
buffsize
=
strlen
(
prefix
)
+
10
;
filename
=
ECOMALLOC
(
buffsize
,
"Allocate filename"
);
"Allocate filename"
);
filename2
=
ECOMALLOC
(
buffsize
,
"Allocate filename"
);
snprintf
(
filename
,
buffsize
,
"%s.rdx"
,
prefix
);
tax
->
ranks
=
read_rankidx
(
filename
);
snprintf
(
filename
,
buffsize
,
"%s.tdx"
,
prefix
);
snprintf
(
filename2
,
buffsize
,
"%s.ldx"
,
prefix
);
tax
->
taxons
=
read_taxonomyidx
(
filename
);
tax
->
taxons
=
read_taxonomyidx
(
filename
,
filename2
);
if
(
readAlternativeName
)
{
snprintf
(
filename
,
buffsize
,
"%s.ndx"
,
prefix
);
snprintf
(
filename
,
buffsize
,
"%s.ndx"
,
prefix
);
tax
->
names
=
read_nameidx
(
filename
,
tax
);
}
else
tax
->
names
=
NULL
;
return
tax
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment