Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mvapontes committed May 3, 2024
2 parents f574d29 + 83a80b7 commit c11bfff
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 25 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
arch:
- x64
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
Expand All @@ -44,7 +44,7 @@ jobs:
contents: write
statuses: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: '1'
Expand Down
15 changes: 10 additions & 5 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ CurrentModule = KEGGAPI

Documentation for [KEGGAPI](https://github.com/bwbioinfo/KEGGAPI.jl).

```@index
[KEGG](https://www.genome.jp/kegg/)

```@contents
Pages = [
"man/functions.md",
"man/examples.md",
]
Depth = 2
```

## Functions

```@autodocs
Modules = [KEGGAPI]
```
```@index
```
54 changes: 54 additions & 0 deletions docs/src/man/examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Some Examples

## Basics

Examples analogous to [KEGG Conv](https://www.kegg.jp/kegg/rest/keggapi.html#conv)

Querying the API for a simple conversion:

```@example
using KEGGAPI
output = KEGGAPI.conv("eco", "ncbi-geneid");
```

Outputs a list with
1. The API call
2. The column headers of the call ( if the result is tabular )
3. The data

This allows to easily convert to a data frame:

```@example
using DataFrames
DataFrame(
output.data,
output.colnames
)
```

```@example
using KEGGAPI
output = KEGGAPI.conv("ncbi-geneid", "eco");
DataFrame(
output.data,
output.colnames
)
```

```@example
using KEGGAPI
output = KEGGAPI.conv("ncbi-proteinid", "hsa:10458+ece:Z5100");
DataFrame(
output.data,
output.colnames
)
```

```@example
using KEGGAPI
output = KEGGAPI.conv("genes", "ncbi-geneid:948364");
DataFrame(
output.data,
output.colnames
)
```
5 changes: 5 additions & 0 deletions docs/src/man/functions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# KEGGAPI.jl Functions

```@autodocs
Modules = [KEGGAPI]
```
10 changes: 6 additions & 4 deletions src/Conv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ KEGGAPI.conv(<target_db>, <source_db>)
Convert KEGG identifiers to/from outside identifiers.
# Examples
```julia-repl
Example:
```@example
using KEGGAPI
KEGGAPI.conv("eco", "ncbi-geneid")
KEGGAPI.conv("ncbi-geneid", "eco")
KEGGAPI.conv("hsa:10458+ece:Z5100", "ncbi-proteinid")
KEGGAPI.conv("ncbi-geneid:948364", "genes")
KEGGAPI.conv("ncbi-proteinid", "hsa:10458+ece:Z5100")
KEGGAPI.conv("genes", "ncbi-geneid:948364")
```
"""
function conv(target_db::String, source_db::String)
Expand Down
4 changes: 2 additions & 2 deletions src/Find.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ KEGGAPI.find(database, query) -> KeggTupleList
Find entries in a specific database from the KEGG API.
# Examples
```julia-repl
```@example
using KEGGAPI
KEGGAPI.find("compound","glucose")
```
"""
Expand Down
9 changes: 6 additions & 3 deletions src/Get.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@ and returns a vector containing the urls used and the data returned.
The get function will split the vector into groups of 10 and make a request for each chunk.
# Examples
```julia-repl
```@example
using KEGGAPI
kegg_get_genes =
KEGGAPI.kegg_get(
["hsa:10458", "hsa:10458", "hsa:10458", "hsa:10458"],
"ntseq"
)
);
first(kegg_get_genes)
kegg_get_compounds =
KEGGAPI.kegg_get(
["C01290","G00092"]
)
);
first(kegg_get_compounds)
```
"""
function kegg_get(query::Vector{String}, option::String = "")
Expand Down
7 changes: 4 additions & 3 deletions src/Images.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ KEGGAPI.get_image(pathway) -> Image
Get an image of a specific pathway from the KEGG API.
# Examples
```julia-repl
Example:
```@example
KEGGAPI.get_image("hsa00010")
```
"""
Expand All @@ -20,7 +21,7 @@ KEGGAPI.save_image(image, filename) -> filename
Save an image to a file.
# Examples
```julia-repl
```example
image = KEGGAPI.get_image("hsa00010")
KEGGAPI.save_image(image, "glycolysis.png")
```
Expand Down
5 changes: 3 additions & 2 deletions src/Info.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ KEGGAPI.info(database) -> String
Get information about a specific database from the KEGG API.
# Examples
```julia-repl
Example:
```example
KEGGAPI.info("kegg")
```
"""
Expand Down
5 changes: 3 additions & 2 deletions src/Link.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ KEGGAPI.conv(<target_db>, <source_db>)
Find related entries by using database cross-references
# Examples
```julia-repl
Example:
```example
KEGGAPI.link("pathway", "hsa")
```
"""
Expand Down
5 changes: 3 additions & 2 deletions src/List.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ KEGGAPI.list(database)
Get a list of entries from a specific database from the KEGG API.
# Examples
```julia-repl
Example:
```example
KEGGAPI.list("pathway")
```
"""
Expand Down

0 comments on commit c11bfff

Please sign in to comment.