Getting Started19 Aug 2015
Other than a good text editor (please don’t email me about some other editor) and *nix terminal, you will need a few items, not the least of which is Rust. Since I am on a Mac, I use the excellent Homebrew to install Rust:
$ brew install rust
Rust includes the Cargo tool that helps out with creating the proper package layout, and helps in testing and compiling code. Let’s use it to create a simple command line that will take a DNA sequence as input and give the reverse complement.
$ cargo new revcomp --bin
This creates the following structure:
$ tree -p revcomp revcomp ├── [-rw-r--r--] Cargo.toml └── [drwxr-xr-x] src └── [-rw-r--r--] main.rs
- [ ] The program must take in an argument consisting of DNA sequence via STDIN
- [ ] If the input is not DNA (consists only of “ATGC” characters), then throw an error
- [ ] Else output the reverese complement sequence as STDOUT
In the next post I will go through this program in detail.