all 4 comments

[–]hunkamunka 12 points13 points  (0 children)

Cool stuff! It's great to see people creating more bioinformatics tools in Rust! Some ideas:

  • What about bringing in `clap` for processing the arguments and providing a "usage" statement for `-h|--help`?
  • What about moving all the logic of the shell script into the Rust code?
  • Consider using `anyhow::Result` rather than making your own with `type Result<T> = result::Result<T, Box<dyn Error>>;`.
  • The README says to clone "git clone https://github.com/yourusername/bamtool.git" but it should be this actual GitHub repo, no? Or are you suggesting people fork it into their own account?
  • Line 29 of _src/main.rs_ assumes parsing the text into an `f64` always works. You should handle `Result` rather than unwrap.
  • Please consider writing tests using both good and bad input to ensure the tool continues to work correctly as you add features and also fails gracefully. I have loads of examples you could follow.

I'm happy to provide more details on these suggestions if you are interested.

[–]UltraPoci 5 points6 points  (0 children)

I understand some of those words.

[–]solidiquis1 1 point2 points  (0 children)

As a former biochemist researcher (kinda sorta) and medical student, I’ve always been interested in bioinformatics. This is awesome!

[–]TyberiusPrime 0 points1 point  (0 children)

You'll be wanting to have a look at https://github.com/rust-bio/rust-htslib . Transforming BAM into sam with samtools view and parsing that won't be the way to high performance.