Skip to content

Commit

Permalink
Upgrade to v0.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
wen-chen committed Sep 30, 2021
1 parent a55f279 commit 71a6837
Show file tree
Hide file tree
Showing 21 changed files with 6,067 additions and 143 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ os:


script:
- make linux
- make
4 changes: 4 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v0.5.2
Support download via bioconda;
Use ghc::filesystem instead of std::filesystem for the cross-platform compatibility.

v0.5.1
Use robin_hood::unordered_map instead of std::unordered_map for performance improvement;
The program rwr adds support for the weights and direction of the network;
Expand Down
10 changes: 3 additions & 7 deletions INSTALL
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
The GCEN requires compiler and library support for the ISO C++ 2017 standard.

To compile the GCEN in Linux:
make linux
To compile the GCEN, please run the following command:
make

To compile the GCEN in macOS:
make macos

To compile the GCEN in Windows:
make windows
The executable files are located in the ./bin and ./util directory.
96 changes: 33 additions & 63 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,63 +1,33 @@
CXX = g++
LFLAGS = -std=c++17 -static-libstdc++ -O3 -Wall
MFLAGS = -std=c++17 -static-libgcc -O3 -Wall
WFLAGS = -std=c++17 -static -O3 -Wall


linux:
mkdir -p bin
mkdir -p util

$(CXX) src/data_norm.cpp -o bin/data_norm $(LFLAGS)
$(CXX) src/data_filter.cpp -o bin/data_filter $(LFLAGS)
$(CXX) src/network_build.cpp -o bin/network_build -pthread $(LFLAGS)
$(CXX) src/module_identify.cpp -o bin/module_identify -pthread $(LFLAGS)
$(CXX) src/annotate.cpp -o bin/annotate -pthread -lstdc++fs $(LFLAGS)
$(CXX) src/rwr.cpp -o bin/rwr $(LFLAGS)

$(CXX) src/data_stat.cpp -o util/data_stat $(LFLAGS)
$(CXX) src/network_merge.cpp -o util/network_merge $(LFLAGS)
$(CXX) src/enrich.cpp -o util/enrich $(LFLAGS)
$(CXX) src/generate_expr_matrix_from_rsem.cpp -o util/generate_expr_matrix_from_rsem $(LFLAGS)
$(CXX) src/generate_expr_matrix_from_stringtie.cpp -o util/generate_expr_matrix_from_stringtie $(LFLAGS)


macos:
mkdir -p bin
mkdir -p util

$(CXX) src/data_norm.cpp -o bin/data_norm $(MFLAGS)
$(CXX) src/data_filter.cpp -o bin/data_filter $(MFLAGS)
$(CXX) src/network_build.cpp -o bin/network_build -pthread $(MFLAGS)
$(CXX) src/module_identify.cpp -o bin/module_identify -pthread $(MFLAGS)
$(CXX) src/annotate.cpp -o bin/annotate -pthread -lstdc++fs $(MFLAGS)
$(CXX) src/rwr.cpp -o bin/rwr $(MFLAGS)

$(CXX) src/data_stat.cpp -o util/data_stat $(MFLAGS)
$(CXX) src/network_merge.cpp -o util/network_merge $(MFLAGS)
$(CXX) src/enrich.cpp -o util/enrich $(MFLAGS)
$(CXX) src/generate_expr_matrix_from_rsem.cpp -o util/generate_expr_matrix_from_rsem $(MFLAGS)
$(CXX) src/generate_expr_matrix_from_stringtie.cpp -o util/generate_expr_matrix_from_stringtie $(MFLAGS)


windows:
mkdir -p bin
mkdir -p util

$(CXX) src/data_norm.cpp -o bin/data_norm $(WFLAGS)
$(CXX) src/data_filter.cpp -o bin/data_filter $(WFLAGS)
$(CXX) src/network_build.cpp -o bin/network_build -pthread $(WFLAGS)
$(CXX) src/module_identify.cpp -o bin/module_identify -pthread $(WFLAGS)
$(CXX) src/annotate.cpp -o bin/annotate -pthread -lstdc++fs $(WFLAGS)
$(CXX) src/rwr.cpp -o bin/rwr $(WFLAGS)

$(CXX) src/data_stat.cpp -o util/data_stat $(WFLAGS)
$(CXX) src/network_merge.cpp -o util/network_merge $(WFLAGS)
$(CXX) src/enrich.cpp -o util/enrich $(WFLAGS)
$(CXX) src/generate_expr_matrix_from_rsem.cpp -o util/generate_expr_matrix_from_rsem $(WFLAGS)
$(CXX) src/generate_expr_matrix_from_stringtie.cpp -o util/generate_expr_matrix_from_stringtie $(WFLAGS)


clean:
rm -rf bin
rm -rf util
PREFIX = .
CCFLAGS = -std=c++17 -O3 -Wall


ifeq ($(OS),Windows_NT)
CCFLAGS += -static -D AMD64
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
CCFLAGS += -static-libstdc++ -D LINUX
endif
ifeq ($(UNAME_S),Darwin)
CCFLAGS += -D OSX
endif
endif


all:
mkdir -p $(PREFIX)/bin
mkdir -p $(PREFIX)/util

$(CXX) src/data_norm.cpp -o $(PREFIX)/bin/data_norm $(CCFLAGS)
$(CXX) src/data_filter.cpp -o $(PREFIX)/bin/data_filter $(CCFLAGS)
$(CXX) src/network_build.cpp -o $(PREFIX)/bin/network_build -pthread $(CCFLAGS)
$(CXX) src/module_identify.cpp -o $(PREFIX)/bin/module_identify -pthread $(CCFLAGS)
$(CXX) src/annotate.cpp -o $(PREFIX)/bin/annotate -pthread $(CCFLAGS)
$(CXX) src/rwr.cpp -o $(PREFIX)/bin/rwr $(CCFLAGS)

$(CXX) src/data_stat.cpp -o $(PREFIX)/util/data_stat $(CCFLAGS)
$(CXX) src/network_merge.cpp -o $(PREFIX)/util/network_merge $(CCFLAGS)
$(CXX) src/enrich.cpp -o $(PREFIX)/util/enrich $(CCFLAGS)
$(CXX) src/generate_expr_matrix_from_rsem.cpp -o $(PREFIX)/util/generate_expr_matrix_from_rsem $(CCFLAGS)
$(CXX) src/generate_expr_matrix_from_stringtie.cpp -o $(PREFIX)/util/generate_expr_matrix_from_stringtie $(CCFLAGS)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## GCEN: an easy toolkit of Gene Co-Expression Network analysis for lncRNA annotation
## GCEN: an easy toolkit of Gene Co-Expression Network analysis for lncRNAs annotation

[![platforms](https://img.shields.io/badge/platforms-Linux%20%7C%20macOS%20%7C%20Windows-yellowgreen)](https://www.biochen.org/gcen/)
[![release version](https://img.shields.io/github/v/release/wen-chen/gcen)](https://www.biochen.org/gcen)
Expand Down Expand Up @@ -243,4 +243,4 @@ rwr -n ../sample_data/gene_co_expr.network -g ../sample_data/rwr_interested_gene
To understand the format of the input and output files for each program, please take a look at the sample data included in the software package.

#### Contact
Wen Chen, Ph.D. Candidate, [email protected]
Wen Chen, Ph.D. Candidate, [email protected]
10 changes: 5 additions & 5 deletions src/annotate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
#include <iostream>
#include <vector>
#include <unordered_map>
#include <experimental/filesystem> // -std=c++17 -lstdc++fs
#include <thread> // Multithreading
#include "third_party/ghc/filesystem.hpp"
#include "util/func.hpp"
#include "util/enrich_util.hpp"
#include "util/hypergeometric_p_value.hpp"


void go_annot_help() {
std::cout << "GCEN 0.5.1 by Wen Chen ([email protected], https://www.biochen.com/gcen)\n";
std::cout << version;
std::cout << "annotate usage:\n";
std::cout << " annotate -g go-basic.obo -a gene_go_association_file -n input_network -o out_dir\n";
std::cout << "options:\n";
Expand Down Expand Up @@ -71,7 +71,7 @@ void module_kegg_annotate(int n, int thread_num, std::vector <std::unordered_set
int main(int argc, char* argv[]) {
if (argc < 2) {
go_annot_help();
return -1;
return 0;
}

// get options
Expand Down Expand Up @@ -175,7 +175,7 @@ int main(int argc, char* argv[]) {
propagate(assoc_map, go_term_map);

// mkdir
std::experimental::filesystem::create_directories(out_dir);
ghc::filesystem::create_directories(out_dir);

// annotation
std::unordered_set <std::string> background_gene_set;
Expand Down Expand Up @@ -235,7 +235,7 @@ int main(int argc, char* argv[]) {
assoc_parser(assoc_file_name, K_map, assoc_map);

// mkdir
std::experimental::filesystem::create_directories(out_dir);
ghc::filesystem::create_directories(out_dir);

// annotate
std::unordered_set <std::string> background_gene_set;
Expand Down
4 changes: 2 additions & 2 deletions src/data_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


void data_filter_help() {
std::cout << "GCEN 0.5.1 by Wen Chen ([email protected], https://www.biochen.com/gcen)\n";
std::cout << version;
std::cout << "data_filter usage:\n";
std::cout << " data_filter -i input_file -o output_file\n";
std::cout << "options:\n";
Expand All @@ -26,7 +26,7 @@ void data_filter_help() {
int main(int argc, char* argv[]) {
if (argc < 2) {
data_filter_help();
return -1;
return 0;
}

// get option
Expand Down
4 changes: 2 additions & 2 deletions src/data_norm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


void data_norm_help() {
std::cout << "GCEN 0.5.1 by Wen Chen ([email protected], https://www.biochen.com/gcen)\n";
std::cout << version;
std::cout << "data_norm usage:\n";
std::cout << " data_norm -i input_file -o output_file -m normalization_method\n";
std::cout << "options:\n";
Expand All @@ -22,7 +22,7 @@ void data_norm_help() {
int main(int argc, char* argv[]) {
if (argc < 2) {
data_norm_help();
return -1;
return 0;
}

// get option
Expand Down
4 changes: 2 additions & 2 deletions src/data_stat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


void data_stat_help() {
std::cout << "GCEN 0.5.1 by Wen Chen ([email protected], https://www.biochen.com/gcen)\n";
std::cout << version;
std::cout << "data_stat usage:\n";
std::cout << " data_stat -i input_file\n";
std::cout << "options:\n";
Expand All @@ -21,7 +21,7 @@ void data_stat_help() {
int main(int argc, char* argv[]) {
if (argc < 2) {
data_stat_help();
return -1;
return 0;
}

// get option
Expand Down
4 changes: 2 additions & 2 deletions src/enrich.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


void enrich_help() {
std::cout << "GCEN 0.5.1 by Wen Chen ([email protected], https://www.biochen.com/gcen)\n";
std::cout << version;
std::cout << "enrich usage:\n";
std::cout << " enrich -e enrichment_gene_list_file -b background_gene_list_file -g go-basic.obo "
"-a gene_go_association_file -p p_value_cutoff -o out_put_file\n";
Expand All @@ -36,7 +36,7 @@ void enrich_help() {
int main(int argc, char* argv[]) {
if (argc < 2) {
enrich_help();
return -1;
return 0;
}

// get options
Expand Down
4 changes: 2 additions & 2 deletions src/generate_expr_matrix_from_rsem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


void rsem_help() {
std::cout << "GCEN 0.5.1 by Wen Chen ([email protected], https://www.biochen.com/gcen)\n";
std::cout << version;
std::cout << "generate_expr_matrix_from_rsem usage:\n";
std::cout << " generate_expr_matrix_from_rsem -i input_file -o output_file\n";
std::cout << "options:\n";
Expand All @@ -30,7 +30,7 @@ void read_sample_file(std::string sample_file_name, int i, std::string flag,
int main(int argc, char* argv[]) {
if (argc < 2) {
rsem_help();
return -1;
return 0;
}

// get option
Expand Down
4 changes: 2 additions & 2 deletions src/generate_expr_matrix_from_stringtie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


void stringtie_help() {
std::cout << "GCEN 0.5.1 by Wen Chen ([email protected], https://www.biochen.com/gcen)\n";
std::cout << version;
std::cout << "generate_expr_matrix_from_stringtie usage:\n";
std::cout << " generate_expr_matrix_from_stringtie -i input_file -o output_file\n";
std::cout << "options:\n";
Expand All @@ -32,7 +32,7 @@ void read_sample_file(std::string sample_file_name, int i, std::string flag,
int main(int argc, char* argv[]) {
if (argc < 2) {
stringtie_help();
return -1;
return 0;
}

// get option
Expand Down
4 changes: 2 additions & 2 deletions src/module_identify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static std::mutex mutex_lock;


void module_identify_help() {
std::cout << "GCEN 0.5.1 by Wen Chen ([email protected], https://www.biochen.com/gcen)\n";
std::cout << version;
std::cout << "module_identify usage:\n";
std::cout << " module_identify -i input_file -o output_file\n";
std::cout << "options:\n";
Expand Down Expand Up @@ -128,7 +128,7 @@ void ThreadFunc(int n, int thread_num, std::vector <std::string> & node_vec,
int main(int argc, char* argv[]) {
if (argc < 2) {
module_identify_help();
return -1;
return 0;
}

// get option
Expand Down
4 changes: 2 additions & 2 deletions src/network_build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


void network_build_help() {
std::cout << "GCEN 0.5.1 by Wen Chen ([email protected], https://www.biochen.com/gcen)\n";
std::cout << version;
std::cout << "network_build usage:\n";
std::cout << " network_build -i gene_expression_file -o co_expression_network_file\n";
std::cout << "options:\n";
Expand Down Expand Up @@ -45,7 +45,7 @@ void ThreadFunc_FDR(int n, int thread_num, int GeneNum, int SampleNum, std::vect
int main(int argc, char* argv[]) {
if (argc < 2) {
network_build_help();
return -1;
return 0;
}

// get option
Expand Down
4 changes: 2 additions & 2 deletions src/network_merge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


void network_merge_help() {
std::cout << "GCEN 0.5.1 by Wen Chen ([email protected], https://www.biochen.com/gcen)\n";
std::cout << version;
std::cout << "network_merge usage:\n";
std::cout << " network_merge -i input_files -o output_file\n";
std::cout << "options:\n";
Expand All @@ -22,7 +22,7 @@ void network_merge_help() {
int main(int argc, char* argv[]) {
if (argc < 2) {
network_merge_help();
return -1;
return 0;
}

// get option
Expand Down
4 changes: 2 additions & 2 deletions src/rwr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


void rwr_help() {
std::cout << "GCEN 0.5.1 by Wen Chen ([email protected], https://www.biochen.com/gcen)\n";
std::cout << version;
std::cout << "rwr usage:\n";
std::cout << " rwr -n input_network -g gene_list -o output_result\n";
std::cout << "options:\n";
Expand All @@ -27,7 +27,7 @@ void rwr_help() {
int main(int argc, char* argv[]) {
if (argc < 2) {
rwr_help();
return -1;
return 0;
}

// get option
Expand Down
Loading

0 comments on commit 71a6837

Please sign in to comment.