Skip to content

Commit

Permalink
write the README and make some cosmetic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tonymugen committed Sep 21, 2023
1 parent 4be9e2e commit eb1ab7f
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.21)
project(subsetfa
VERSION 0.1
VERSION 0.5
LANGUAGES CXX
)
include(CheckCXXCompilerFlag)
Expand Down
51 changes: 50 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,50 @@
This is a small utility that extracts records from a FASTA file based on names provided in a list file.
# Overview

This is a small utility that extracts records from a FASTA file based on names provided in a list file. Depends only on a compiler that supports C++-14 and `cmake` version 3.21 or later.

# Download and install

Clone the repository

```sh
git clone https://github.com/tonymugen/subsetfa
```

Next, create a build directory

```sh
cd subsetfa
mkdir build
```

Run cmake

```sh
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
cmake --install .
```

Installation may require root privileges.

# Tests

Optionally, one can also build the unit tests. These require [Catch2](https://github.com/catchorg/Catch2), although its installation is taken care of by `cmake`. To build the tests, create a `build-Tests` directory, say, and run

```sh
cd build
cmake -DCMAKE_BUILD_TYPE=Test -DBUILD_TESTS=ON ..
cmake --build .
```

To run the tests from the build directory, simply run

```sh
./tests
```

# Run the tool

The binary is `subsetfa`. It requires a multi-sequence FASTA file and a list of FASTA headers for sequences to be extracted. Headers must match those in the target FASTA file exactly, those that do not match anything will be ignored. A name of the output FASTA file can also be provided. If not, the default name subset.fasta will be used. The order of records in the output will not necessarily be the same as in the original file. Running `subsetfa` without any arguments will print the command line flag syntax information.

2 changes: 1 addition & 1 deletion apps/subsetfa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/** \file
* \author Anthony J. Greenberg
* \copyright Copyright (c) 2023 Anthony J. Greenberg
* \version 0.1
* \version 0.5
*
* Uses the fastaObj methods to extract records from a multi-record FASTA file.
* Records must be listed in a separate file as FASTA headers that match some in the FASTA file.
Expand Down
2 changes: 1 addition & 1 deletion include/fastaObj.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/** \file
* \author Anthony J. Greenberg
* \copyright Copyright (c) 2023 Anthony J. Greenberg
* \version 0.1
* \version 0.5
*
* Definitions and interface documentation for the class that holds FASTA file data.
*
Expand Down
2 changes: 1 addition & 1 deletion include/utilities.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/** \file
* \author Anthony J. Greenberg
* \copyright Copyright (c) 2023 Anthony J. Greenberg
* \version 0.1
* \version 0.5
*
* Definitions and interface documentation various utility functions.
*
Expand Down
2 changes: 1 addition & 1 deletion src/fastaObj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/** \file
* \author Anthony J. Greenberg
* \copyright Copyright (c) 2023 Anthony J. Greenberg
* \version 0.1
* \version 0.5
*
* Implementation of the class that holds FASTA file data.
*
Expand Down
2 changes: 1 addition & 1 deletion src/utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/** \file
* \author Anthony J. Greenberg
* \copyright Copyright (c) 2023 Anthony J. Greenberg
* \version 0.1
* \version 0.5
*
* Implementation of various utility functions.
*
Expand Down

0 comments on commit eb1ab7f

Please sign in to comment.