Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
i2MassChroQ
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
A compter du 1er avril, attention à vos pipelines :
Nouvelles limitations de Docker Hub
Show more breadcrumbs
PAPPSO
i2MassChroQ
Commits
1c199250
Commit
1c199250
authored
7 years ago
by
Langella Olivier
Browse files
Options
Downloads
Patches
Plain Diff
new function to get histogram
parent
85ac8b26
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/utils/utils.cpp
+18
-0
18 additions, 0 deletions
src/utils/utils.cpp
src/utils/utils.h
+1
-0
1 addition, 0 deletions
src/utils/utils.h
with
19 additions
and
0 deletions
src/utils/utils.cpp
+
18
−
0
View file @
1c199250
...
...
@@ -37,6 +37,24 @@ const QString Utils::getDatabaseName(ExternalDatabase database) {
}
std
::
vector
<
size_t
>
Utils
::
getHistogram
(
std
::
vector
<
pappso
::
pappso_double
>
data_values
,
unsigned
int
number_of_class
)
{
std
::
vector
<
size_t
>
histogram
(
number_of_class
);
std
::
sort
(
data_values
.
begin
(),
data_values
.
end
());
pappso
::
pappso_double
min
=
*
data_values
.
begin
();
pappso
::
pappso_double
max
=
*
(
data_values
.
end
()
-
1
);
pappso
::
pappso_double
offset
=
(
max
-
min
)
/
(
pappso
::
pappso_double
)
number_of_class
;
for
(
pappso
::
pappso_double
value
:
data_values
)
{
histogram
[(
value
/
offset
)]
=
value
;
}
return
histogram
;
}
pappso
::
AaModificationP
Utils
::
guessAaModificationPbyMonoisotopicMassDelta
(
pappso
::
mz
mass
)
{
pappso
::
PrecisionP
precision
=
pappso
::
Precision
::
getDaltonInstance
(
0.01
);
...
...
This diff is collapsed.
Click to expand it.
src/utils/utils.h
+
1
−
0
View file @
1c199250
...
...
@@ -35,6 +35,7 @@ public:
static
const
QString
getDatabaseName
(
ExternalDatabase
database
);
static
const
QString
getXmlDouble
(
pappso
::
pappso_double
number
);
static
pappso
::
AaModificationP
guessAaModificationPbyMonoisotopicMassDelta
(
pappso
::
mz
mass
);
static
std
::
vector
<
size_t
>
getHistogram
(
std
::
vector
<
pappso
::
pappso_double
>
data_values
,
unsigned
int
number_of_class
);
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment