Skip to content

Commit

Permalink
Add initial working CLI for uniwig #1
Browse files Browse the repository at this point in the history
  • Loading branch information
donaldcampbelljr committed Mar 15, 2024
1 parent 8805252 commit abc71f1
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 3 deletions.
6 changes: 5 additions & 1 deletion genimtools/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use clap::Command;
use genimtools::tokenizers;
use genimtools::tools;
use genimtools::vocab;
// use genimtools::uniwig;
use genimtools::uniwig;

pub mod consts {
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
Expand All @@ -23,6 +23,7 @@ fn build_parser() -> Command {
.subcommand(vocab::cli::make_prune_cli())
.subcommand(tokenizers::cli::make_tokenization_cli())
.subcommand(tools::cli::make_tools_cli())
.subcommand(uniwig::cli::create_uniwig_cli())
}

fn main() {
Expand All @@ -39,6 +40,9 @@ fn main() {
Some((tools::consts::TOOLS_CMD, matches)) => {
let _ = tools::cli::handlers::tools_handler(matches);
}
Some((uniwig::consts::UNIWIG_CMD, matches)) => {
uniwig::run_uniwig(matches);
}

_ => unreachable!("Subcommand not found"),
};
Expand Down
14 changes: 14 additions & 0 deletions genimtools/src/uniwig/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Current Manual testing

Full command:
```
cargo run uniwig
```

# Uniwig

Given a set of bed files, we want to produce 2 [BigWig](http://genome.ucsc.edu/goldenPath/help/bigWig.html) files: one track of the start coordinates, one track of the end coordinates, and one track for core coordinates.

# Usage

CLI or Python Bindings
17 changes: 17 additions & 0 deletions genimtools/src/uniwig/cli.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
use clap::{Arg, Command};

use crate::uniwig::consts::UNIWIG_CMD;

pub fn create_uniwig_cli() -> Command {
Command::new(UNIWIG_CMD)
.author("DRC")
.about("Given a set of bed files, we want to produce 2")
.arg(
Arg::new("sorted")
.long("sorted")
.short('s')
.help("Specify if the provided bed file is already sorted by the chromosome number.")
.required(false)
)

}
13 changes: 11 additions & 2 deletions genimtools/src/uniwig/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
pub fn run_uniwig() {
println!("Im running.")
use clap::ArgMatches;

pub mod cli;

pub fn run_uniwig(matches: &ArgMatches) {
println!("Im running. Here are the arguments: {:?}", matches)
}

pub mod consts {
pub const UNIWIG_CMD: &str = "uniwig";

}

0 comments on commit abc71f1

Please sign in to comment.