Skip to content

Commit 863859a

Browse files
authored
tgsgapcloser: add aarch64/arm64 builds (#53497)
* tgsgapcloser: add aarch64/arm64 builds * Update build.sh * Update build.sh * Update build.sh * add patch * Update build.sh * add patch * Update build.sh * clean up recipe * clean up recipe
1 parent 9353e62 commit 863859a

10 files changed

+461
-130
lines changed
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
diff --git a/common/time/timetools.h b/common/time/timetools.h
2+
index d944cf2..dd0a80e 100644
3+
--- a/common/time/timetools.h
4+
+++ b/common/time/timetools.h
5+
@@ -3,6 +3,7 @@
6+
7+
#include <string>
8+
#include <sys/time.h>
9+
+#include <ctime>
10+
11+
namespace BGIQD{
12+
namespace TIME{
13+
diff --git a/main_src_ont/Makefile b/main_src_ont/Makefile
14+
index d4ab8e6..c500e3d 100644
15+
--- a/main_src_ont/Makefile
16+
+++ b/main_src_ont/Makefile
17+
@@ -3,7 +3,7 @@
18+
CC ?= gcc
19+
CXX ?= g++
20+
21+
-CXXFLAGS += -std=c++11\
22+
+CXXFLAGS += -std=c++11 -no-pie\
23+
-I../\
24+
25+
26+
diff --git a/main_src_ont/tgsgapcandidate.cpp b/main_src_ont/tgsgapcandidate.cpp
27+
index 73b34df..10209d7 100644
28+
--- a/main_src_ont/tgsgapcandidate.cpp
29+
+++ b/main_src_ont/tgsgapcandidate.cpp
30+
@@ -188,9 +188,10 @@ struct AppConfig
31+
}
32+
pos_caches_non.clear();
33+
}
34+
- void LogAllChoose(const BGIQD::ONT::ONT2GapInfos & chooses ,
35+
+ bool LogAllChoose(const BGIQD::ONT::ONT2GapInfos & chooses ,
36+
const BGIQD::stLFR::ContigDetail & prev )
37+
{
38+
+ bool succ = false;
39+
for ( const auto & pair : chooses )
40+
{
41+
//auto & pair = chooses.front() ;
42+
@@ -231,6 +232,7 @@ struct AppConfig
43+
else
44+
cut_len += max_hang ;
45+
cut_start = new_cut_start;
46+
+ succ = true;
47+
if( ! candidate_shake_filter )
48+
UpdatePosCache(m1.target_name,cut_start , cut_start+cut_len-1 , false);
49+
else
50+
@@ -282,6 +284,7 @@ struct AppConfig
51+
{
52+
continue ;
53+
}
54+
+ succ = true;
55+
if( ! candidate_shake_filter )
56+
UpdatePosCache(m1.target_name,cut_start , cut_start+cut_len-1, false);
57+
else
58+
@@ -289,6 +292,7 @@ struct AppConfig
59+
}
60+
}
61+
CleanNonRepeatCache();
62+
+ return succ;
63+
}
64+
65+
66+
@@ -358,6 +362,7 @@ struct AppConfig
67+
int no_choose = 0 ;
68+
int no_match = 0 ;
69+
int nread_limit = 0;
70+
+ int noverlap_f = 0 ;
71+
72+
BGIQD::FREQ::Freq<int> gap_both_read_freq ;
73+
BGIQD::FREQ::Freq<int> gap_oo_read_freq ;
74+
@@ -429,7 +434,8 @@ struct AppConfig
75+
}
76+
if( candidate_max > 0 )
77+
SortAndFilterChoose(chooses);
78+
- LogAllChoose(chooses,prev);
79+
+ if(LogAllChoose(chooses,prev) == false)
80+
+ noverlap_f ++ ;
81+
}
82+
}
83+
loger<<BGIQD::LOG::lstart()<<"#gaps : "<<gap_tatal<<BGIQD::LOG::lend() ;
84+
@@ -437,6 +443,7 @@ struct AppConfig
85+
loger<<BGIQD::LOG::lstart()<<"#failed by no common alignment: "<<no_common<<BGIQD::LOG::lend() ;
86+
loger<<BGIQD::LOG::lstart()<<"#failed by orientation check: "<<no_choose<<BGIQD::LOG::lend() ;
87+
loger<<BGIQD::LOG::lstart()<<"#failed by nread check: "<<nread_limit<<BGIQD::LOG::lend() ;
88+
+ loger<<BGIQD::LOG::lstart()<<"#failed by overlap check: "<<noverlap_f<<BGIQD::LOG::lend() ;
89+
}
90+
91+
void PrintCandidate()
92+
diff --git a/main_src_ont/tgsgapcloser.cpp b/main_src_ont/tgsgapcloser.cpp
93+
index f3dd174..89094ea 100644
94+
--- a/main_src_ont/tgsgapcloser.cpp
95+
+++ b/main_src_ont/tgsgapcloser.cpp
96+
@@ -371,6 +371,7 @@ struct AppConfig
97+
pass_gap_size ++ ;
98+
if( tmp.gap_size < 0 )
99+
{
100+
+ ont_overlap = true ;
101+
std::cerr
102+
<<"overlap check c1="<< prev.contig_id<<'\t'
103+
<<"and Try c2="<< next.contig_id<<'\t'
104+
@@ -378,7 +379,6 @@ struct AppConfig
105+
if( tmp.gap_size < -max_hang *1.3 )
106+
continue ;
107+
108+
- ont_overlap = true ;
109+
// verify this overlap
110+
//const auto & left = contigs
111+
int true_overlap = VerifyOverlap(
112+
@@ -409,6 +409,7 @@ struct AppConfig
113+
else
114+
continue ;
115+
}
116+
+ ont_overlap = false;
117+
if( tmp.gap_size == 0 )
118+
{
119+
ont_negotive_gap_size ++ ;
120+
diff --git a/tgsgapcloser b/tgsgapcloser
121+
index ced4eec..466491e 100755
122+
--- a/tgsgapcloser
123+
+++ b/tgsgapcloser
124+
@@ -410,8 +410,10 @@ else
125+
126+
TMP_INPUT_SCAFF_INFO=$OUT_PREFIX".orignial_scaff_infos"
127+
check_file $TMP_INPUT_SCAFF_INFO
128+
+ # pre filter unwanted alignments.
129+
+ awk '{if(($3<1000000)||($2-$3<1000000)) print $0}' $OUT_PREFIX.sub.paf >$OUT_PREFIX.sub.filter.paf
130+
$Candidate --ont_reads_a $TGS_READS \
131+
- --contig2ont_paf $OUT_PREFIX.sub.paf \
132+
+ --contig2ont_paf $OUT_PREFIX.sub.filter.paf \
133+
--min_nread $MIN_NREAD \
134+
--max_nread $MAX_NREAD \
135+
--candidate_max $MAX_CANDIDATE --candidate_shake_filter --candidate_merge \
136+
@@ -626,14 +628,16 @@ else
137+
fi
138+
if [[ ! -e 'done_step_4.2_tag' ]] ; then
139+
print_info_line "4,2 , filling gaps ... "
140+
+ # pre filter unwanted alignments.
141+
+ awk '{if(($3<1000000)||($2-$3<1000000)) print $0}' $OUT_PREFIX.fill.paf >$OUT_PREFIX.fill.filter.paf
142+
if [[ $G_CHECK == 0 ]] ; then
143+
- $GapCloser --ont_reads_a $FINAL_READS --contig2ont_paf $OUT_PREFIX.fill.paf \
144+
+ $GapCloser --ont_reads_a $FINAL_READS --contig2ont_paf $OUT_PREFIX.fill.filter.paf \
145+
--min_match=$MIN_MATCH --min_idy=$MIN_IDY \
146+
--prefix $OUT_PREFIX 1>$OUT_PREFIX.fill.log 2>&1|| exit 1
147+
# remove used paf
148+
rm $OUT_PREFIX.fill.paf
149+
else
150+
- $GapCloser --ont_reads_a $FINAL_READS --contig2ont_paf $OUT_PREFIX.fill.paf \
151+
+ $GapCloser --ont_reads_a $FINAL_READS --contig2ont_paf $OUT_PREFIX.fill.filter.paf \
152+
--min_match=$MIN_MATCH --min_idy=$MIN_IDY \
153+
--prefix $OUT_PREFIX --use_gapsize_check 1>$OUT_PREFIX.fill.log 2>&1|| exit 1
154+
rm $OUT_PREFIX.fill.paf
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
diff --git a/Makefile b/Makefile
2+
index 22c8db1..e9f468c 100644
3+
--- a/Makefile
4+
+++ b/Makefile
5+
@@ -1,8 +1,8 @@
6+
.PHONY: all
7+
8+
-CC ?='gcc'
9+
-CXX ?='g++'
10+
-PREFIX ?='/usr/local/TGS-GapCloser'
11+
+CC ?= $(CC)
12+
+CXX ?= $(CXX)
13+
+PREFIX ?= $(PREFIX)
14+
15+
all: minimap2 minimap2/libminimap2.a
16+
cd main_src_ont && make CC=${CC} CXX=${CXX}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
diff --git a/main_src_ont/Makefile b/main_src_ont/Makefile
2+
index c500e3d..be5d65a 100644
3+
--- a/main_src_ont/Makefile
4+
+++ b/main_src_ont/Makefile
5+
@@ -1,16 +1,12 @@
6+
.PHONY: all clean bin
7+
8+
-CC ?= gcc
9+
-CXX ?= g++
10+
+CC ?= $(CC)
11+
+CXX ?= $(CXX)
12+
13+
-CXXFLAGS += -std=c++11 -no-pie\
14+
- -I../\
15+
+CXXFLAGS += -std=c++14 -O3 -I..
16+
17+
18+
-LD_FLAGS += -L../minimap2\
19+
- -lz\
20+
- -lminimap2\
21+
- -lpthread\
22+
+LD_FLAGS += -L../minimap2 -lz -lminimap2 -lpthread
23+
24+
25+
DEUBG_CXX = ${CXXFLAGS} -g
26+
@@ -55,7 +51,7 @@ all : ${jobs} ${scripts}
27+
tgsgapcloser_cpp = tgsgapcloser.cpp
28+
tgsgapcloser_o = tgsgapcloser.o
29+
tgsgapcloser : clean ${tgsgapcloser_o} ${source_o} ../tgsgapcloserbin
30+
- ${CXX} ${tgsgapcloser_o} ${source_o} ${LD_FLAGS} ${DEUBG_CXX} -o tgsgapcloser
31+
+ ${CXX} ${DEUBG_CXX} ${tgsgapcloser_o} ${source_o} ${LD_FLAGS} -o tgsgapcloser ${LD_FLAGS}
32+
mv $@ ../tgsgapcloserbin/
33+
34+
35+
@@ -64,7 +60,7 @@ tgsgapcloser : clean ${tgsgapcloser_o} ${source_o} ../tgsgapcloserbin
36+
tgsgapcandidate_cpp = tgsgapcandidate.cpp
37+
tgsgapcandidate_o = tgsgapcandidate.o
38+
tgsgapcandidate : clean ${tgsgapcandidate_o} ${source_o} ../tgsgapcloserbin
39+
- ${CXX} ${tgsgapcandidate_o} ${source_o} ${LD_FLAGS} ${DEUBG_CXX} -o tgsgapcandidate
40+
+ ${CXX} ${DEUBG_CXX} ${tgsgapcandidate_o} ${source_o} -o tgsgapcandidate ${LD_FLAGS}
41+
mv $@ ../tgsgapcloserbin/
42+
43+
44+
@@ -73,7 +69,7 @@ tgsgapcandidate : clean ${tgsgapcandidate_o} ${source_o} ../tgsgapcloserbin
45+
tgsseqsplit_cpp = tgsseqsplit.cpp
46+
tgsseqsplit_o = tgsseqsplit.o
47+
tgsseqsplit : clean ${tgsseqsplit_o} ${source_o} ../tgsgapcloserbin
48+
- ${CXX} ${tgsseqsplit_o} ${source_o} ${LD_FLAGS} ${DEUBG_CXX} -o tgsseqsplit
49+
+ ${CXX} ${DEUBG_CXX} ${tgsseqsplit_o} ${source_o} -o tgsseqsplit ${LD_FLAGS}
50+
mv $@ ../tgsgapcloserbin/
51+
52+
53+
@@ -82,7 +78,7 @@ tgsseqsplit : clean ${tgsseqsplit_o} ${source_o} ../tgsgapcloserbin
54+
tgsseqgen_cpp = tgsseqgen.cpp
55+
tgsseqgen_o = tgsseqgen.o
56+
tgsseqgen : clean ${tgsseqgen_o} ${source_o} ../tgsgapcloserbin
57+
- ${CXX} ${tgsseqgen_o} ${source_o} ${LD_FLAGS} ${DEUBG_CXX} -o tgsseqgen
58+
+ ${CXX} ${DEUBG_CXX} ${tgsseqgen_o} ${source_o} -o tgsseqgen ${LD_FLAGS}
59+
mv $@ ../tgsgapcloserbin/
60+
61+
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
diff --git a/main_src_ont/tgsgapcloser.cpp b/main_src_ont/tgsgapcloser.cpp
2+
index 89094ea..c1d93d0 100644
3+
--- a/main_src_ont/tgsgapcloser.cpp
4+
+++ b/main_src_ont/tgsgapcloser.cpp
5+
@@ -1,23 +1,23 @@
6+
-#include "common/args/argsparser.h"
7+
-#include "common/log/log.h"
8+
-#include "common/log/logfilter.h"
9+
-#include "common/files/file_writer.h"
10+
-#include "common/files/file_reader.h"
11+
-#include "common/string/stringtools.h"
12+
-#include "common/error/Error.h"
13+
-#include "common/stl/mapHelper.h"
14+
-#include "common/freq/freq.h"
15+
-
16+
-#include "biocommon/fastq/fastq.h"
17+
-#include "biocommon/fasta/fasta.h"
18+
-#include "biocommon/paf/PAF.h"
19+
-#include "biocommon/seq/tool_func.h"
20+
-
21+
-#include "appcommon/contigPairInfo.h"
22+
-#include "appcommon/ScaffInfo.h"
23+
-#include "appcommon/ONT2Gap.h"
24+
-#include "appcommon/AlignMinimap2.h"
25+
-#include "appcommon/fileName.h"
26+
+#include "../common/args/argsparser.h"
27+
+#include "../common/log/log.h"
28+
+#include "../common/log/logfilter.h"
29+
+#include "../common/files/file_writer.h"
30+
+#include "../common/files/file_reader.h"
31+
+#include "../common/string/stringtools.h"
32+
+#include "../common/error/Error.h"
33+
+#include "../common/stl/mapHelper.h"
34+
+#include "../common/freq/freq.h"
35+
+
36+
+#include "../biocommon/fastq/fastq.h"
37+
+#include "../biocommon/fasta/fasta.h"
38+
+#include "../biocommon/paf/PAF.h"
39+
+#include "../biocommon/seq/tool_func.h"
40+
+
41+
+#include "../appcommon/contigPairInfo.h"
42+
+#include "../appcommon/ScaffInfo.h"
43+
+#include "../appcommon/ONT2Gap.h"
44+
+#include "../appcommon/AlignMinimap2.h"
45+
+#include "../appcommon/fileName.h"
46+
47+
#include <map>
48+
#include <vector>
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
diff --git a/common/log/log.h b/common/log/log.h
2+
index 37971a4..1989706 100644
3+
--- a/common/log/log.h
4+
+++ b/common/log/log.h
5+
@@ -4,7 +4,7 @@
6+
#include <string>
7+
#include <ostream>
8+
#include <sstream>
9+
-#include "common/time/timetools.h"
10+
+#include "../time/timetools.h"
11+
12+
namespace BGIQD{
13+
namespace LOG{
14+
diff --git a/biocommon/fastq/fastq.h b/biocommon/fastq/fastq.h
15+
index c2b8908..62a01ad 100644
16+
--- a/biocommon/fastq/fastq.h
17+
+++ b/biocommon/fastq/fastq.h
18+
@@ -6,8 +6,8 @@
19+
#include <vector>
20+
#include <iostream>
21+
22+
-#include "biocommon/seq/seq.h"
23+
-#include "common/flags/flags.h"
24+
+#include "../seq/seq.h"
25+
+#include "../../common/flags/flags.h"
26+
27+
namespace BGIQD {
28+
namespace FASTQ {
29+
diff --git a/biocommon/fasta/fasta.h b/biocommon/fasta/fasta.h
30+
index aac3b64..563100c 100644
31+
--- a/biocommon/fasta/fasta.h
32+
+++ b/biocommon/fasta/fasta.h
33+
@@ -6,8 +6,8 @@
34+
#include <vector>
35+
#include <cassert>
36+
37+
-#include "biocommon/seq/seq.h"
38+
-#include "common/flags/flags.h"
39+
+#include "../seq/seq.h"
40+
+#include "../../common/flags/flags.h"
41+
42+
namespace BGIQD {
43+
44+
diff --git a/biocommon/paf/PAF.h b/biocommon/paf/PAF.h
45+
index 39901bd..e050c9c 100644
46+
--- a/biocommon/paf/PAF.h
47+
+++ b/biocommon/paf/PAF.h
48+
@@ -2,7 +2,7 @@
49+
#define __BIOCOMMON_PAF_PAF_H__
50+
51+
#include <string>
52+
-#include "biocommon/align_common/align_result.h"
53+
+#include "../align_common/align_result.h"
54+
55+
namespace BGIQD {
56+
namespace PAF {
57+
diff --git a/appcommon/contigPairInfo.h b/appcommon/contigPairInfo.h
58+
index 9ec3c0c..ec18b4e 100644
59+
--- a/appcommon/contigPairInfo.h
60+
+++ b/appcommon/contigPairInfo.h
61+
@@ -3,9 +3,9 @@
62+
63+
#include <cassert>
64+
65+
-#include "appcommon/ScaffInfo.h"
66+
+#include "ScaffInfo.h"
67+
68+
-#include "biocommon/paf/PAF.h"
69+
+#include "../biocommon/paf/PAF.h"
70+
71+
namespace BGIQD {
72+
namespace stLFR {
73+
diff --git a/appcommon/ONT2Gap.h b/appcommon/ONT2Gap.h
74+
index 39023d5..56117d9 100644
75+
--- a/appcommon/ONT2Gap.h
76+
+++ b/appcommon/ONT2Gap.h
77+
@@ -1,8 +1,8 @@
78+
#ifndef __STLFR_ONT2GAP_H__
79+
#define __STLFR_ONT2GAP_H__
80+
81+
-#include "biocommon/paf/PAF.h"
82+
-#include "appcommon/contigPairInfo.h"
83+
+#include "../biocommon/paf/PAF.h"
84+
+#include "contigPairInfo.h"
85+
86+
#include <vector>
87+
88+
diff --git a/appcommon/AlignMinimap2.h b/appcommon/AlignMinimap2.h
89+
index 36bb6b3..0f79528 100644
90+
--- a/appcommon/AlignMinimap2.h
91+
+++ b/appcommon/AlignMinimap2.h
92+
@@ -1,7 +1,7 @@
93+
#ifndef __APPCOMMON_ALIGNMINIMAP2_H__
94+
#define __APPCOMMON_ALIGNMINIMAP2_H__
95+
96+
-#include "minimap2/minimap.h"
97+
+#include "../minimap2/minimap.h"
98+
#include <string>
99+
#include <cstring>
100+
#include <cassert>
101+
diff --git a/appcommon/fileName.h b/appcommon/fileName.h
102+
index c60d885..2e81fd4 100644
103+
--- a/appcommon/fileName.h
104+
+++ b/appcommon/fileName.h
105+
@@ -2,7 +2,7 @@
106+
#define __SOAP2_FILENAME_H__
107+
108+
#include <string>
109+
-#include "common/string/stringtools.h"
110+
+#include "../common/string/stringtools.h"
111+
112+
namespace BGIQD {
113+
namespace SOAP2 {

0 commit comments

Comments
 (0)