Skip to content

Commit f687aa2

Browse files
committed
--merge works, transition to htslib completed
1 parent 2729a86 commit f687aa2

4 files changed

Lines changed: 8 additions & 4 deletions

File tree

gclib/GSam.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,15 @@ GSamRecord::GSamRecord(const char* qname, int32_t gseq_tid,
2929
b=bam_init1();
3030
size_t l_qname=strlen(qname);
3131
size_t l_seq=0;
32-
if (qseq!=NULL) l_seq=strlen(qseq);
32+
if (qseq!=NULL) {
33+
l_seq=strlen(qseq);
34+
}
35+
//-- passed pos is 1-based
3336
if (pos<=0 || gseq_tid<0) {
3437
flag |= BAM_FUNMAP;
3538
pos=-1;
3639
}
40+
pos--;
3741
if (reverse) flag|=BAM_FREVERSE;
3842

3943
bam_set1(b, l_qname, qname, flag,

gclib/GSam.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class GSamRecord: public GSeg {
7575

7676
GSamRecord(const char* qname, int32_t gseq_tid,
7777
int pos, bool reverse, GDynArray<uint32_t>& cigar,
78-
const char* qseq, const char* quals=NULL);
78+
const char* qseq=NULL, const char* quals=NULL);
7979

8080
void init(bam1_t* from_b, sam_hdr_t* b_header=NULL, bool adopt_b=false) {
8181
clear();

stringtie.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include "proc_mem.h"
1212
#endif
1313

14-
#define VERSION "2.1.7"
14+
#define VERSION "2.1.7-htslib"
1515

1616
//#define DEBUGPRINT 1
1717

tmerge.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ GStr TInputFiles::convert2BAM(GStr& gtf, int idx) {
5656
//cigar+='M';
5757
cigar.Add( (m.exons[k]->len() << BAM_CIGAR_SHIFT) | BAM_CMATCH);
5858
}
59-
GSamRecord brec(m.getID(), t_id, m.start, false, cigar, "*");
59+
GSamRecord brec(m.getID(), t_id, m.start, false, cigar);
6060
if (m.strand=='-' || m.strand=='+') {
6161
GStr tag("XS:A:");
6262
tag+=m.strand;

0 commit comments

Comments
 (0)