Skip to content

Commit

Permalink
test: Remove unnecessary code in test_extract.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
cauliyang committed Nov 7, 2023
1 parent e9cc401 commit 74cfaa4
Show file tree
Hide file tree
Showing 3 changed files with 156 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rboss"
version = "0.2.0"
version = "0.3.0"
edition = "2021"
authors = ["Yangyang Li"]
homepage = "https://github.com/cauliyang/rboss"
Expand Down
155 changes: 155 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
# Rust Bioinformatics Toolbox (rboss)

Rust Bioinformatics Toolbox, abbreviated as rboss, is a command-line tool designed to facilitate various operations on bioinformatics files.
It provides a range of commands to manipulate sequence data files commonly used in bioinformatics, such as BAM, FASTA, and FASTQ formats.

## Minimum Supported Rust Version (MSRV)

This project adheres to a Minimum Supported Rust Version (MSRV) policy.
The Minimum Supported Rust Version (MSRV) is 1.70.0.
We ensure that all code within the project is compatible with this version or newer to maintain stability and compatibility.

## Features

- **High Performance**: Take advantage of Rust's performance for heavy computational tasks.
- **Safety**: Rust's strong type system and ownership model ensure safety across bioinformatics operations.
- **Concurrency**: Utilize Rust's modern concurrency tools for parallel data processing.

## Installation

You can install `rboss` using Cargo, the Rust package manager. Ensure you have Rust and Cargo installed on your system, then run:

```sh
cargo install rboss
```

## Getting Started

To begin using `rboss`, you may invoke it with the following syntax:

```sh
rboss [OPTIONS] [COMMAND]
```

`rboss` provides several commands to perform different operations:

### Commands

- `extract` (aliases: `e`): Extract reads from a BAM file.

Usage:

```sh
rboss extract [OPTIONS] <BAM_FILE>
```

- `index`: Index a BAM file to speed up read access.

Usage:

```sh
rboss index <BAM_FILE>
```

- `fa2fq`: Convert a FASTA file to FASTQ format.

Usage:

```sh
rboss fa2fq <FASTA_FILE>
```

- `fq2fa`: Convert a FASTQ file to FASTA format.

Usage:

```sh
rboss fq2fa <FASTQ_FILE>
```

- `rsoft`: Create soft links to files with the same suffix in one directory recursively.

Usage:

```sh
rboss rsoft <TARGET_DIR> -s <SUFFIX>
```

- `help`: Print detailed help information for `rboss` or its subcommands.

Usage:

```sh
rboss help [COMMAND]
```

### Options

- `--generate <GENERATOR>`: Generate shell completions for `rboss` for the specified shell. Possible values include `bash`, `elvish`, `fish`, `powershell`, and `zsh`.

- `-v`, `--verbose`: Increase verbosity. The more occurrences of this flag, the more detailed the output.

- `-q`, `--quiet`: Decrease verbosity. The more occurrences of this flag, the less detailed the output.

- `-h`, `--help`: Print help information for `rboss` and its subcommands.

- `-V`, `--version`: Print the version information for `rboss`.

## Examples

Extracting reads from a BAM file based on `reads.txt`:

```sh
rboss extract reads.txt sample.bam
```

Indexing a BAM file:

```sh
rboss index sample.bam
```

Converting a FASTA file to FASTQ:

```sh
rboss fa2fq sample.fasta
```

Converting a FASTQ file to FASTA:

```sh
rboss fq2fa sample.fastq
```

Creating soft links for files with a `.txt` or `.csv` suffix:

```sh
rboss rsoft /path/to/directory -s txt csv
```

For further help on any specific command, you can use the `help` command:

```sh
rboss help extract
```

For the latest updates and more detailed documentation, please visit the official `rboss` repository.

## Contributing

Contributions to `rboss` are welcome. If you have suggestions for improvements or have identified issues, please open an issue or a pull request in the repository.

Thank you for using `rboss`, the versatile Rust-powered toolbox for bioinformatics data manipulation!

## License

rboss is distributed under the terms of both the MIT license and the Apache License (Version 2.0). See LICENSE-APACHE and LICENSE-MIT for details.

## Community

Join us on [Discord/Gitter/Forum] to discuss rboss development, ask questions, and collaborate with other contributors.

## Credits

rboss is being actively developed and maintained by bioinformatics enthusiasts and the Rust community.
We thank all contributors for their efforts.
17 changes: 0 additions & 17 deletions tests/test_extract.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use assert_cmd::cmd::Command;
use pretty_assertions::assert_eq;
use std::fs;

#[test]
fn test_rboss() {
Expand All @@ -11,28 +9,18 @@ fn test_rboss() {
#[test]
fn test_extract() {
// read to vec<u8>
let ground_truth = fs::read("tests/data/extract_1.sam").unwrap();
let ground_truth_sha256 = sha256::digest(ground_truth.as_slice());

let mut cmd = Command::cargo_bin("rboss").unwrap();
cmd.args([
"extract",
"tests/data/extract_1.txt",
"tests/data/reads.bam",
]);
cmd.assert().success();

let output = cmd.output().expect("failed to execute process");
let output_sha256 = sha256::digest(output.stdout.as_slice());

assert_eq!(ground_truth_sha256, output_sha256);
}

#[test]
fn test_extract_binary() {
// read to vec<u8>
let ground_truth = fs::read("tests/data/extract_1.bam").unwrap();
let ground_truth_sha256 = sha256::digest(ground_truth.as_slice());

let mut cmd = Command::cargo_bin("rboss").unwrap();
cmd.args([
Expand All @@ -42,9 +30,4 @@ fn test_extract_binary() {
"-b",
]);
cmd.assert().success();

let output = cmd.output().expect("failed to execute process");
let output_sha256 = sha256::digest(output.stdout.as_slice());

assert_eq!(ground_truth_sha256, output_sha256);
}

0 comments on commit 74cfaa4

Please sign in to comment.