Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
R3
legacy
bedtools2
Commits
b47dbefc
Commit
b47dbefc
authored
Jul 15, 2015
by
arq5x
Browse files
settle on uint32_t signature for QuickString. Resolves #267 and #271?
parent
86bce5cb
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/coverageFile/coverageFile.cpp
View file @
b47dbefc
...
...
@@ -83,11 +83,11 @@ void CoverageFile::giveFinalReport(RecordOutputMgr *outputMgr) {
float
depthPct
=
(
float
)
basesAtDepth
/
(
float
)
_totalQueryLen
;
_finalOutput
=
"all
\t
"
;
_finalOutput
.
append
(
depth
);
_finalOutput
.
append
(
static_cast
<
uint32_t
>
(
depth
)
)
;
_finalOutput
.
append
(
"
\t
"
);
_finalOutput
.
append
(
basesAtDepth
);
_finalOutput
.
append
(
static_cast
<
uint32_t
>
(
basesAtDepth
)
)
;
_finalOutput
.
append
(
"
\t
"
);
_finalOutput
.
append
(
_totalQueryLen
);
_finalOutput
.
append
(
static_cast
<
uint32_t
>
(
_totalQueryLen
)
)
;
_finalOutput
.
append
(
"
\t
"
);
format
(
depthPct
);
...
...
@@ -138,7 +138,7 @@ size_t CoverageFile::countBasesAtDepth(size_t depth) {
void
CoverageFile
::
doCounts
(
RecordOutputMgr
*
outputMgr
,
RecordKeyVector
&
hits
)
{
_finalOutput
=
hits
.
size
();
_finalOutput
=
static_cast
<
uint32_t
>
(
hits
.
size
()
)
;
outputMgr
->
printRecord
(
hits
.
getKey
(),
_finalOutput
);
}
...
...
@@ -147,9 +147,9 @@ void CoverageFile::doPerBase(RecordOutputMgr *outputMgr, RecordKeyVector &hits)
//loop through all bases in query, printing full record and metrics for each
const
Record
*
queryRec
=
hits
.
getKey
();
for
(
size_t
i
=
0
;
i
<
_queryLen
;
i
++
)
{
_finalOutput
=
i
+
1
;
_finalOutput
=
static_cast
<
uint32_t
>
(
i
+
1
)
;
_finalOutput
.
append
(
"
\t
"
);
_finalOutput
.
append
(
_depthArray
[
i
]);
_finalOutput
.
append
(
static_cast
<
uint32_t
>
(
_depthArray
[
i
])
)
;
outputMgr
->
printRecord
(
queryRec
,
_finalOutput
);
}
...
...
@@ -181,11 +181,11 @@ void CoverageFile::doHist(RecordOutputMgr *outputMgr, RecordKeyVector &hits)
size_t
numBasesAtDepth
=
iter
->
second
;
float
coveredBases
=
(
float
)
numBasesAtDepth
/
(
float
)
_queryLen
;
_finalOutput
=
depth
;
_finalOutput
=
static_cast
<
uint32_t
>
(
depth
)
;
_finalOutput
.
append
(
"
\t
"
);
_finalOutput
.
append
(
numBasesAtDepth
);
_finalOutput
.
append
(
static_cast
<
uint32_t
>
(
numBasesAtDepth
)
)
;
_finalOutput
.
append
(
"
\t
"
);
_finalOutput
.
append
(
_queryLen
);
_finalOutput
.
append
(
static_cast
<
uint32_t
>
(
_queryLen
)
)
;
_finalOutput
.
append
(
"
\t
"
);
format
(
coveredBases
);
...
...
@@ -199,11 +199,11 @@ void CoverageFile::doDefault(RecordOutputMgr *outputMgr, RecordKeyVector &hits)
size_t
nonZeroBases
=
_queryLen
-
countBasesAtDepth
(
0
);
float
coveredBases
=
(
float
)
nonZeroBases
/
(
float
)
_queryLen
;
_finalOutput
=
hits
.
size
();
_finalOutput
=
static_cast
<
uint32_t
>
(
hits
.
size
()
)
;
_finalOutput
.
append
(
"
\t
"
);
_finalOutput
.
append
(
nonZeroBases
);
_finalOutput
.
append
(
static_cast
<
uint32_t
>
(
nonZeroBases
)
)
;
_finalOutput
.
append
(
"
\t
"
);
_finalOutput
.
append
(
_queryLen
);
_finalOutput
.
append
(
static_cast
<
uint32_t
>
(
_queryLen
)
)
;
_finalOutput
.
append
(
"
\t
"
);
format
(
coveredBases
);
...
...
src/utils/general/QuickString.cpp
View file @
b47dbefc
...
...
@@ -105,11 +105,11 @@ QuickString &QuickString::operator = (uint32_t val) {
return
*
this
;
}
QuickString
&
QuickString
::
operator
=
(
size_t
val
)
{
clear
();
append
(
val
);
return
*
this
;
}
//
QuickString &QuickString::operator = (size_t val) {
//
clear();
//
append(val);
//
return *this;
//
}
QuickString
&
QuickString
::
operator
=
(
float
val
)
{
clear
();
...
...
@@ -158,10 +158,11 @@ QuickString &QuickString::operator += (uint32_t num) {
return
*
this
;
}
QuickString
&
QuickString
::
operator
+=
(
size_t
num
)
{
append
(
num
);
return
*
this
;
}
// QuickString &QuickString::operator += (size_t num) {
// append(num);
// return *this;
// }
QuickString
&
QuickString
::
operator
+=
(
float
num
)
{
append
(
num
);
return
*
this
;
...
...
@@ -273,12 +274,12 @@ void QuickString::append(int num) {
}
void
QuickString
::
append
(
uint32_t
num
)
{
int2str
((
int
)
num
,
*
this
,
true
);
int2str
((
int
)
num
,
*
this
,
true
);
}
void
QuickString
::
append
(
size_t
num
)
{
int2str
((
int
)
num
,
*
this
,
true
);
}
//
void QuickString::append(size_t num) {
//
int2str((int)num, *this, true);
//
}
void
QuickString
::
append
(
float
num
)
{
append
(
ToString
(
num
));
...
...
src/utils/general/QuickString.h
View file @
b47dbefc
...
...
@@ -38,7 +38,7 @@ public:
QuickString
&
operator
=
(
char
);
QuickString
&
operator
=
(
int
);
QuickString
&
operator
=
(
uint32_t
);
QuickString
&
operator
=
(
size_t
);
//
QuickString &operator = (size_t);
QuickString
&
operator
=
(
float
);
QuickString
&
operator
=
(
double
);
QuickString
&
operator
+=
(
const
QuickString
&
);
...
...
@@ -47,7 +47,7 @@ public:
QuickString
&
operator
+=
(
char
);
QuickString
&
operator
+=
(
int
);
QuickString
&
operator
+=
(
uint32_t
);
QuickString
&
operator
+=
(
size_t
);
//
QuickString &operator += (size_t);
QuickString
&
operator
+=
(
float
);
QuickString
&
operator
+=
(
double
);
...
...
@@ -74,7 +74,7 @@ public:
//for better performance.
void
append
(
int
num
);
void
append
(
uint32_t
num
);
void
append
(
size_t
num
);
//
void append(size_t num);
void
append
(
float
num
);
void
append
(
double
num
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment