You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4
+
5
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6
+
7
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8
+
9
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4
+
5
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6
+
7
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8
+
9
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copy file name to clipboardexpand all lines: README.md
+20-5
Original file line number
Diff line number
Diff line change
@@ -7,59 +7,73 @@
7
7
8
8
`gtars` is a rust crate that provides a set of tools for working with genomic interval data. Its primary goal is to provide processors for our python package, [`geniml`](https:github.com/databio/geniml), a library for machine learning on genomic intervals. However, it can be used as a standalone library for working with genomic intervals as well.
9
9
10
-
`gtars` provides three things:
10
+
`gtars` provides these things:
11
11
12
12
1. A rust library crate.
13
13
2. A command-line interface, written in rust.
14
-
3. A Python package that provides bindings to the rust library.
14
+
3. A Python package that provides Python bindings to the rust library.
15
+
4. An R package that provides R bindings to the rust library
15
16
16
17
## Repository organization (for developers)
17
18
18
19
This repo is organized like so:
19
20
20
-
1. A rust library crate (`/gtars/lib.rs`) that provides functions, traits, and structs for working with genomic interval data.
21
-
2. A rust binary crate (in `/gtars/main.rs`), a small, wrapper command-line interface for the library crate.
22
-
3. A rust crate (in `/bindings`) that provides Python bindings, and a resulting Python package, so that it can be used within Python.
21
+
1. The main gtars rust package in `/gtars`, which contains two crates:
22
+
1a. A rust library crate (`/gtars/lib.rs`) that provides functions, traits, and structs for working with genomic interval data.
23
+
1b. A rust binary crate (in `/gtars/main.rs`), a small, wrapper command-line interface for the library crate.
24
+
2. Python bindings (in `/bindings/python`), which consists of a rust package with a library crate (no binary crate) and Python package.
25
+
3. R bindings (in `/bindinds/r`), which consists of an R package.
23
26
24
27
This repository is a work in progress, and still in early development.
25
28
26
29
## Installation
30
+
27
31
To install `gtars`, you must have the rust toolchain installed. You can install it by following the instructions [here](https://www.rust-lang.org/tools/install).
28
32
29
33
You may build the binary locally using `cargo build --release`. This will create a binary in `target/release/gtars`. You can then add this to your path, or run it directly.
30
34
31
35
## Usage
36
+
32
37
`gtars` is very early in development, and as such, it does not have a lot of functionality yet. However, it does have a few useful tools. To see the available tools, run `gtars --help`. To see the help for a specific tool, run `gtars <tool> --help`.
33
38
34
39
Alternatively, you can link `gtars` as a library in your rust project. To do so, add the following to your `Cargo.toml` file:
If you'd like to add a new tool, you can do so by creating a new module within the src folder.
46
55
47
56
### New public library crate tools
57
+
48
58
If you want this to be available to users of `gtars`, you can add it to the `gtars` library crate as well. To do so, add the following to `src/lib.rs`:
49
59
```rust
50
60
pubmod <tool_name>;
51
61
```
52
62
53
63
### New binary crate tools
64
+
54
65
Finally, if you want to have command-line functionality, you can add it to the `gtars` binary crate. This requires two steps:
66
+
55
67
1. Create a new `cli` using `clap` inside the `interfaces` module of `src/cli.rs`:
68
+
56
69
```rust
57
70
pubfnmake_new_tool_cli() ->Command {
58
71
59
72
}
60
73
```
61
74
62
75
2. Write your logic in a wrapper function. This will live inside the `functions` module of `src/cli.rs`:
This is a python wrapper around the `gtars` crate. It provides an easy interface for using `gtars` in python. It is currently in early development, and as such, it does not have a lot of functionality yet, but new tools are being worked on right now.
3
2
4
-
## Installation
5
-
You can get `gtars` from PyPI:
6
-
```bash
7
-
pip install gtars
8
-
```
3
+
This is a Python package that wraps the `gtars` crate so you can call gtars code from Python.
4
+
5
+
Documentation for Python bindings is hosted at: https://docs.bedbase.org/gtars/
6
+
7
+
## Brief instructions
9
8
10
-
## Usage
11
-
Import the package, and use the tools:
12
-
```python
13
-
import gtars as gt
9
+
To install the development version, you'll have to build it locally. Build Python bindings like this:
0 commit comments