Skip to content

Commit

Permalink
code
Browse files Browse the repository at this point in the history
  • Loading branch information
何伟明(Weiming He) committed Dec 21, 2022
1 parent 1b7f828 commit 728a094
Show file tree
Hide file tree
Showing 64 changed files with 30,168 additions and 29 deletions.
79 changes: 79 additions & 0 deletions BamDeal.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <cstdlib>
#include <stdio.h>
#include <string.h>
#include <zlib.h>
#include "src/convert/covert.h"
#include "src/modify/modify.h"
#include "src/statistics/statistics.h"
#include "src/visualize/visualize.h"

using namespace std;

int convert_main(int argc, char *argv[]) ;
int modify_main(int argc, char *argv[]);
int statistics_main(int argc, char *argv[]);
int visualize_main(int argc, char *argv[]);

static int AllTools_usage ()
{
cerr <<"Program: BamDeal\nVersion: 0.27\thewm2008@gmail.com\t"<<__DATE__<<endl;

cerr<<""
"\n"
"\tUsage:\n\n"
"\t\tconvert convert tools\n"
"\t\tmodify modify tools\n"
"\t\tstatistics statistics analysis tools\n"
"\t\tvisualize visualize tools for bam\n"
"\n"
"\t\tHelp Show help in detail\n"
"\n";
return 1;
}

static int AllTools_usage2 ()
{
cerr <<"Program: BamDeal\nVersion: 0.27\thewm2008@gmail.com\t"<<__DATE__<<endl;

cerr<<""
"\n"
"\tUsage:\n\n"
"\t\tconvert convert tools\n"
"\t\tmodify modify tools\n"
"\t\tstatistics statistics analysis tools\n"
"\t\tvisualize visualize tools for bam\n"
"\n"
"\t\tHelp Show help in detail\n"
"\n"
"\t\t✉️ hewm2008@gmail.com / hewm2008@qq.com\n"
"\t\tjoin the QQ Group : 12529366\n"
"\n";
return 1;
}


int main(int argc, char *argv[])
{
if (argc < 2) { return AllTools_usage(); }
else if (strcmp(argv[1], "convert") == 0) { return convert_main(argc-1, argv+1) ; }
else if (strcmp(argv[1], "statistics") == 0) { return statistics_main(argc-1, argv+1) ; }
else if (strcmp(argv[1], "visualize") == 0) { return visualize_main(argc-1, argv+1) ; }
else if (strcmp(argv[1], "modify") == 0) { return modify_main(argc-1, argv+1) ; }
else if (strcmp(argv[1], "Help") == 0 || strcmp(argv[1], "help") == 0 || strcmp(argv[1], "?")== 0 || ( argv[1][0] == '-' &&( argv[1][1] =='h' || argv[1][1] =='H' || argv[1][1] =='?' ) ) || strcmp(argv[1], "less") == 0 )
{
return AllTools_usage2();
}
else
{
cerr<<"BamDeal [main] unrecognized command "<<argv[1]<<endl;
return 1;
}

return 0;
}


34 changes: 34 additions & 0 deletions Install.Readme
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

make sure:
a. libhts / htslib (>=1.12) had done ( http://www.htslib.org/download/)
b. gcc/g++ ver >= 4.8 // support Flag [ --std=c++11 ]

#############################
Only two step :

1 ./configure
# you can usr the usr the LDFLAGS to find the htslib library and CXXFLAGS and CFLAGS to find the htslib header
# ./configure LDFLAGS=-L/usr/lib/ CFLAGS="-I/usr/include/" CXXFLAGS="-I/usr/include/"
# Export LIBRARY/CFLAGS/CXXFLAGS environment variables to set the htslib path also can be a way to compile, such : export LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH

2 make


Note if it can't work . follow below B1-B6 or use the static Compiled [BamDeal_Linux ]

############################################
#autoscan ./
#cp configure.scan configure.ac

# if can't work, follow below 6 commands
B1: aclocal #// src/automake-1.9/aclocal
B2: autoconf #// src/automake-1.9/autoconf
B3: autoheader #// src/automake-1.9/autoheader
B4: automake --add-missing #// src/automake-1.9/automake --add-missing
B5: ./configure
B6: make
#############################################
#swimming in the sky & flying in the sea#



1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Loading

0 comments on commit 728a094

Please sign in to comment.