Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
biopet.biopet
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirrors
biopet.biopet
Commits
0c2b2242
Commit
0c2b2242
authored
10 years ago
by
Peter van 't Hof
Browse files
Options
Downloads
Patches
Plain Diff
Switch to case classes
parent
a4a4697f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/VcfStats.scala
+24
-25
24 additions, 25 deletions
...k/src/main/scala/nl/lumc/sasc/biopet/tools/VcfStats.scala
with
24 additions
and
25 deletions
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/VcfStats.scala
+
24
−
25
View file @
0c2b2242
...
...
@@ -61,14 +61,13 @@ object VcfStats extends ToolCommand {
*/
}
/** Class to store sample to sample compare stats */
class
SampleToSampleStats
{
/** Number of genotypes match with other sample */
var
genotypeOverlap
:
Int
=
0
/** Number of alleles also found in other sample */
var
alleleOverlap
:
Int
=
0
/**
* Class to store sample to sample compare stats
* @param genotypeOverlap Number of genotypes match with other sample
* @param alleleOverlap Number of alleles also found in other sample
*/
case
class
SampleToSampleStats
(
var
genotypeOverlap
:
Int
=
0
,
var
alleleOverlap
:
Int
=
0
)
{
/** Add an other class */
def
+=
(
other
:
SampleToSampleStats
)
{
this
.
genotypeOverlap
+=
other
.
genotypeOverlap
...
...
@@ -76,14 +75,13 @@ object VcfStats extends ToolCommand {
}
}
/** class to store all sample relative stats */
class
SampleStats
{
/** Stores all genotype relative stats */
val
genotypeStats
:
mutable.Map
[
String
,
mutable.Map
[
Any
,
Int
]]
=
mutable
.
Map
()
/** Stores sample to sample compare stats */
val
sampleToSample
:
mutable.Map
[
String
,
SampleToSampleStats
]
=
mutable
.
Map
()
/**
* class to store all sample relative stats
* @param genotypeStats Stores all genotype relative stats
* @param sampleToSample Stores sample to sample compare stats
*/
case
class
SampleStats
(
val
genotypeStats
:
mutable.Map
[
String
,
mutable.Map
[
Any
,
Int
]]
=
mutable
.
Map
(),
val
sampleToSample
:
mutable.Map
[
String
,
SampleToSampleStats
]
=
mutable
.
Map
())
{
/** Add an other class */
def
+=
(
other
:
SampleStats
)
:
Unit
=
{
for
((
key
,
value
)
<-
other
.
sampleToSample
)
{
...
...
@@ -98,13 +96,13 @@ object VcfStats extends ToolCommand {
}
}
class
Stats
{
/** Stores are general stats */
val
generalStats
:
mutable.Map
[
String
,
mutable.Map
[
Any
,
Int
]]
=
mutable
.
Map
()
/** Stores all sample/genotype specific stats
*/
val
samples
Stats
:
mutable.Map
[
String
,
SampleStats
]
=
mutable
.
Map
()
/**
* General stats class to store vcf stats
* @param
generalStats
Stores are general stats
* @param samplesStats Stores all sample/genotype specific stats
*/
case
class
Stats
(
val
general
Stats
:
mutable.Map
[
String
,
mutable.Map
[
Any
,
Int
]
]
=
mutable
.
Map
()
,
val
samplesStats
:
mutable.Map
[
String
,
SampleStats
]
=
mutable
.
Map
())
{
/** Add an other class */
def
+=
(
other
:
Stats
)
:
Stats
=
{
for
((
key
,
value
)
<-
other
.
samplesStats
)
{
...
...
@@ -207,8 +205,9 @@ object VcfStats extends ToolCommand {
val
stats
=
createStats
logger
.
info
(
"Starting on: "
+
interval
)
for
(
record
<-
reader
.
query
(
interval
.
getSequence
,
interval
.
getStart
,
interval
.
getEnd
)
if
record
.
getStart
<=
interval
.
getEnd
)
{
for
(
record
<-
reader
.
query
(
interval
.
getSequence
,
interval
.
getStart
,
interval
.
getEnd
)
if
record
.
getStart
<=
interval
.
getEnd
)
{
mergeNestedStatsMap
(
stats
.
generalStats
,
checkGeneral
(
record
))
for
(
sample1
<-
samples
)
yield
{
val
genotype
=
record
.
getGenotype
(
sample1
)
...
...
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