Compare commits
No commits in common. "c1b7df1172a9ddf13ff354f06752072f93439a4e" and "c601a8b65f1832439e64e37d3137fe0cf5ed10b3" have entirely different histories.
c1b7df1172
...
c601a8b65f
4 changed files with 2 additions and 38 deletions
|
@ -1,12 +0,0 @@
|
||||||
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
24
README.md
|
@ -1,24 +0,0 @@
|
||||||
|
|
||||||
- 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 (unsigned long pos : positions) {
|
for (int 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