Compare commits
4 commits
c601a8b65f
...
c1b7df1172
Author | SHA1 | Date | |
---|---|---|---|
c1b7df1172 | |||
6989dc4459 | |||
81ffd07220 | |||
713742d668 |
4 changed files with 38 additions and 2 deletions
12
CMakeLists.txt
Normal file
12
CMakeLists.txt
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
cmake_minimum_required(VERSION 3.0)
|
||||||
|
|
||||||
|
project(tnt_script)
|
||||||
|
SET( CMAKE_EXPORT_COMPILE_COMMANDS ON )
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
|
||||||
|
add_executable(gene_marker gene_marker.cpp)
|
||||||
|
add_executable(trim_marker trim_marker.cpp)
|
||||||
|
|
||||||
|
target_compile_options(gene_marker PRIVATE -Wall -Wextra -pedantic -O3)
|
||||||
|
target_compile_options(trim_marker PRIVATE -Wall -Wextra -pedantic -O3)
|
24
README.md
Normal file
24
README.md
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
|
||||||
|
- Author: Guoyi Zhang
|
||||||
|
|
||||||
|
- License: GPLv2
|
||||||
|
|
||||||
|
## gene_marker
|
||||||
|
|
||||||
|
Generate fasta file which `m` means selected position by Gblocks from Gblocks html report file.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
|
||||||
|
```
|
||||||
|
gene_marker <input_file> <output_file>
|
||||||
|
```
|
||||||
|
|
||||||
|
## trim_marker
|
||||||
|
|
||||||
|
Trim the multi-sequence-alignment based on the marker which `m` indicates selected position.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
|
||||||
|
```
|
||||||
|
trim_marker <marker_fasta_file> <input_fasta_file> <output_file>
|
||||||
|
```
|
|
@ -15,7 +15,7 @@
|
||||||
bool checkArguments(int argc, char* argv[]) {
|
bool checkArguments(int argc, char* argv[]) {
|
||||||
if (argc != 3) {
|
if (argc != 3) {
|
||||||
std::cerr << "Usage: " << argv[0]
|
std::cerr << "Usage: " << argv[0]
|
||||||
<< " input_file output_file\n";
|
<< " <input_file> <output_file>\n";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -58,7 +58,7 @@ void extract_characters(const std::string& line, const std::string& file,
|
||||||
const std::vector<int> positions) {
|
const std::vector<int> positions) {
|
||||||
std::ofstream outfile(file, std::ios::app);
|
std::ofstream outfile(file, std::ios::app);
|
||||||
std::string new_line;
|
std::string new_line;
|
||||||
for (int pos : positions) {
|
for (unsigned long pos : positions) {
|
||||||
if (pos <= line.length()) {
|
if (pos <= line.length()) {
|
||||||
new_line += line[pos - 1]; // start from 0
|
new_line += line[pos - 1]; // start from 0
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue