Skip to content

Commit

Permalink
applicativesystem
Browse files Browse the repository at this point in the history
Finished writing the code and had no access to internet since morning and hence pushing it now. Final and binary release.
  • Loading branch information
sciencegenome committed Dec 19, 2024
1 parent 391e857 commit 11290ec
Show file tree
Hide file tree
Showing 9 changed files with 437 additions and 2 deletions.
237 changes: 237 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "rust-lcp-arrays"
version = "0.1.0"
edition = "2021"

[dependencies]
clap = { version = "4.5.23", features = ["derive"] }
33 changes: 31 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,31 @@
# rust-suffix-lcp-arrays
rust suffix lcp arrays
# rust-lcp-arrays

- rust lcp arrays
- kasai algorithm says that use a inverse suffix tree but that is cost consuming.Instead, i implemented a string compression way so that it estimates the proportion of the
match based on the ith offset for the i+1 offset.
- general note: Incase of Golang and RUST, please see the last commit message and if it says compiled binary then it is completed or else still in development version.


```
cargo build
```
```
➜ gauravsablok rust-suffix-lcp git:(main) ✗ ./target/debug/rust-lcp-arrays -h
Usage: rust-lcp-arrays <LCPARRAY_ARG>
Arguments:
<LCPARRAY_ARG> please provide the path to the fastq file
Options:
-h, --help Print help
-V, --version Print version
```
- to run the binary
```
./rust-lcp-arrays ./sample-files/sample.fasta
{[28, 19, 24, 15, 11, 7, 21, 4, 0, 20, 3, 25, 16, 12, 8, 27, 18, 23, 14, 10, 6, 2, 26, 17, 22, 13, 9, 5, 1]: LCPArray { suffixindex: [28, 19, 24, 15, 11, 7, 21, 4, 0, 20, 3, 25, 16, 12, 8, 27, 18, 23, 14, 10, 6, 2, 26, 17, 22, 13, 9, 5, 1], suffixarray: ["A", "ACATGACTGA", "ACTGA", "ACTGACATGACTGA", "ACTGACTGACATGACTGA", "ACTGACTGACTGACATGACTGA", "ATGACTGA", "ATGACTGACTGACTGACATGACTGA", "ATGCATGACTGACTGACTGACATGACTGA", "CATGACTGA", "CATGACTGACTGACTGACATGACTGA", "CTGA", "CTGACATGACTGA", "CTGACTGACATGACTGA", "CTGACTGACTGACATGACTGA", "GA", "GACATGACTGA", "GACTGA", "GACTGACATGACTGA", "GACTGACTGACATGACTGA", "GACTGACTGACTGACATGACTGA", "GCATGACTGACTGACTGACATGACTGA", "TGA", "TGACATGACTGA", "TGACTGA", "TGACTGACATGACTGA", "TGACTGACTGACATGACTGA", "TGACTGACTGACTGACATGACTGA", "TGCATGACTGACTGACTGACATGACTGA"], lcparray: [1, 0, 5, 0, 0, 0, 8, 0, 0, 9, 0, 4, 0, 0, 0, 2, 0, 6, 0, 0, 0, 0, 3, 0, 7, 0, 0, 0, 0] }}
```

Gaurav Sablok
Binary file added rust-lcp-arrays
Binary file not shown.
Binary file added rust-lcp-arrays.tar
Binary file not shown.
2 changes: 2 additions & 0 deletions sample-files/lcp-array.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[28, 19, 24, 15, 11, 7, 21, 4, 0, 20, 3, 25, 16, 12, 8, 27, 18, 23, 14, 10, 6, 2, 26, 17, 22, 13, 9, 5, 1] [28, 19, 24, 15, 11, 7, 21, 4, 0, 20, 3, 25, 16, 12, 8, 27, 18, 23, 14, 10, 6, 2, 26, 17, 22, 13, 9, 5, 1] ["A", "ACATGACTGA", "ACTGA", "ACTGACATGACTGA", "ACTGACTGACATGACTGA", "ACTGACTGACTGACATGACTGA", "ATGACTGA", "ATGACTGACTGACTGACATGACTGA", "ATGCATGACTGACTGACTGACATGACTGA", "CATGACTGA", "CATGACTGACTGACTGACATGACTGA", "CTGA", "CTGACATGACTGA", "CTGACTGACATGACTGA", "CTGACTGACTGACATGACTGA", "GA", "GACATGACTGA", "GACTGA", "GACTGACATGACTGA", "GACTGACTGACATGACTGA", "GACTGACTGACTGACATGACTGA", "GCATGACTGACTGACTGACATGACTGA", "TGA", "TGACATGACTGA", "TGACTGA", "TGACTGACATGACTGA", "TGACTGACTGACATGACTGA", "TGACTGACTGACTGACATGACTGA", "TGCATGACTGACTGACTGACATGACTGA"] [1, 0, 5, 0, 0, 0, 8, 0, 0, 9, 0, 4, 0, 0, 0, 2, 0, 6, 0, 0, 0, 0, 3, 0, 7, 0, 0, 0, 0]

2 changes: 2 additions & 0 deletions sample-files/sample.fasta
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@samplefasta
ATGCATGACTGACTGACTGACATGACTGA
9 changes: 9 additions & 0 deletions src/args.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
use clap::Parser;

#[derive(Debug, Parser)]
#[clap(version)]

pub struct LCPArraysArgs {
/// please provide the path to the fastq file
pub lcparray_arg: String
}
Loading

0 comments on commit 11290ec

Please sign in to comment.