Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NeuroBits
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
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpibr
scic
NeuroBits
Commits
e2db5bc4
Commit
e2db5bc4
authored
8 years ago
by
Georgi Tushev
Browse files
Options
Downloads
Patches
Plain Diff
additional stats
parent
8f017761
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
NeuroBitsBatchStats.pl
+71
-16
71 additions, 16 deletions
NeuroBitsBatchStats.pl
with
71 additions
and
16 deletions
NeuroBitsBatchStats.pl
+
71
−
16
View file @
e2db5bc4
...
@@ -18,10 +18,24 @@ my @punctaStatsFiles = glob("$path_name/punctaStats*.txt");
...
@@ -18,10 +18,24 @@ my @punctaStatsFiles = glob("$path_name/punctaStats*.txt");
# loop through list
# loop through list
foreach
my
$ntFile
(
@neuroTreeFiles
)
foreach
my
$ntFile
(
@neuroTreeFiles
)
{
{
# extranct name for neuroTree file
my
$name
=
$ntFile
=~
m/$path_name\/?(.*)\_neuroTree\_.*.txt/
?
$
1
:
"
<unknown>
";
my
$name
=
$ntFile
=~
m/$path_name\/?(.*)\_neuroTree\_.*.txt/
?
$
1
:
"
<unknown>
";
my
@tmp
=
grep
{
/\_$name\_/
}
@punctaStatsFiles
;
my
$psFile
=
$tmp
[
0
];
# find corresponding punctaStats file
my
$psFile
=
"
<unknown>
";
my
$nsQry
=
$name
;
$nsQry
=~
s/[^A-Za-z0-9\_\-]//g
;
foreach
my
$psQry
(
@punctaStatsFiles
)
{
my
$tmp
=
$psQry
;
$tmp
=~
s/$path_name\///
;
$tmp
=~
s/\.txt//
;
$tmp
=~
s/[^A-Za-z0-9\_\-]//g
;
$psFile
=
$psQry
if
(
$tmp
=~
m/.*\_$name\_.*/
);
}
# process files
ParseNeuroTreeFile
(
$ntFile
,
\
%
{
$hash
{
$name
}});
ParseNeuroTreeFile
(
$ntFile
,
\
%
{
$hash
{
$name
}});
ParsePunctaStatsFile
(
$psFile
,
\
%
{
$hash
{
$name
}});
ParsePunctaStatsFile
(
$psFile
,
\
%
{
$hash
{
$name
}});
}
}
...
@@ -116,35 +130,76 @@ sub PrintCustomTable($)
...
@@ -116,35 +130,76 @@ sub PrintCustomTable($)
{
{
my
$hash_ref
=
$_
[
0
];
my
$hash_ref
=
$_
[
0
];
# print header
# print header
print
"
#file
\t
Soma.Area
\t
Soma.Puncta
";
print
"
#file
";
print
"
\t
Density.Total
";
# puncta.(arbor + soma)/ (span.arbor + area.soma)
print
"
\t
Puncta.Soma
\t
Area.Soma
\t
Density.Soma
";
# puncta.soma / area.soma
print
"
\t
Puncta.Arbor
\t
Span.Arbor
\t
Density.Arbor
";
# puncta.arbor / span.arbor
print
"
\t
Ratio.Puncta.(Arbor/Soma)
";
# puncta.arbor / puncta.soma
print
"
\t
Ratio.Area.(Arbor/Soma)
";
# span.arbor / area.soma
print
"
\t
Ratio.Density.(Arbor/Soma)
";
# density.arbor / density.soma
for
(
my
$k
=
1
;
$k
<
10
;
$k
++
)
for
(
my
$k
=
1
;
$k
<
10
;
$k
++
)
{
{
print
"
\t
Order.
$k
.Span
\t
Order.
$k
.Puncta
";
print
"
\t
Puncta.Order.
$k
";
print
"
\t
Span.Order.
$k
";
print
"
\t
Density.Order.
$k
";
}
}
print
"
\t
Arbor.Span
\t
Arbor.Puncta
";
print
"
\n
";
print
"
\n
";
# print data
# print data
foreach
my
$file
(
keys
%
{
$hash_ref
})
foreach
my
$file
(
keys
%
{
$hash_ref
})
{
{
print
$hash_ref
->
{
$file
}{"
name
"},"
\t
";
# file
my
$file_name
=
$hash_ref
->
{
$file
}{"
name
"};
# soma
my
$area_soma
=
exists
(
$hash_ref
->
{
$file
}{"
span
"}{
0
})
?
$hash_ref
->
{
$file
}{"
span
"}{
0
}
:
0
;
my
$puncta_soma
=
exists
(
$hash_ref
->
{
$file
}{"
puncta
"}{
0
})
?
$hash_ref
->
{
$file
}{"
puncta
"}{
0
}
:
0
;
my
$density_soma
=
(
$area_soma
>
0
)
?
(
$puncta_soma
/
$area_soma
)
:
"
NaN
";
my
$arbor_span
=
0
;
# arbor
my
$puncta_count
=
0
;
my
$span_arbor
=
0
;
for
(
my
$depth
=
0
;
$depth
<
10
;
$depth
++
)
my
$puncta_arbor
=
0
;
my
@span_branch_list
=
(
0
)
x
9
;
my
@puncta_branch_list
=
(
0
)
x
9
;
my
@density_branch_list
=
("
NaN
")
x
9
;
for
(
my
$depth
=
1
;
$depth
<
10
;
$depth
++
)
{
{
my
$span
=
exists
(
$hash_ref
->
{
$file
}{"
span
"}{
$depth
})
?
$hash_ref
->
{
$file
}{"
span
"}{
$depth
}
:
0
;
# current branch data
$arbor_span
+=
$span
if
(
$depth
>
0
);
my
$span_branch
=
exists
(
$hash_ref
->
{
$file
}{"
span
"}{
$depth
})
?
$hash_ref
->
{
$file
}{"
span
"}{
$depth
}
:
0
;
my
$puncta_branch
=
exists
(
$hash_ref
->
{
$file
}{"
puncta
"}{
$depth
})
?
$hash_ref
->
{
$file
}{"
puncta
"}{
$depth
}
:
0
;
my
$density_branch
=
(
$span_branch
>
0
)
?
(
$puncta_branch
/
$span_branch
)
:
"
NaN
";
# update lists
$span_branch_list
[
$depth
-
1
]
=
$span_branch
;
$puncta_branch_list
[
$depth
-
1
]
=
$puncta_branch
;
$density_branch_list
[
$depth
-
1
]
=
$density_branch
;
my
$count
=
exists
(
$hash_ref
->
{
$file
}{"
puncta
"}{
$depth
})
?
$hash_ref
->
{
$file
}{"
puncta
"}{
$depth
}
:
0
;
# accumulate arbor span and puncta
$puncta_count
+=
$count
if
(
$depth
>
0
);
$span_arbor
+=
$span_branch
;
$puncta_arbor
+=
$puncta_branch
;
print
$span
,"
\t
",
$count
,"
\t
";
}
}
print
$arbor_span
,"
\t
",
$puncta_count
;
my
$density_arbor
=
(
$span_arbor
>
0
)
?
(
$puncta_arbor
/
$span_arbor
)
:
"
NaN
";
my
$ratio_density
=
(
$density_soma
eq
"
NaN
"
||
$density_arbor
eq
"
NaN
"
||
$density_soma
==
0
)
?
"
NaN
"
:
(
$density_arbor
/
$density_soma
);
# output
print
$file_name
;
print
"
\t
",(
$puncta_soma
+
$puncta_arbor
)
/($area_soma + $span_arbor); # puncta.(arbor + soma)/
(
span
.
arbor
+
area
.
soma
)
print
"
\t
",
$puncta_soma
,"
\t
",
$area_soma
,"
\t
",
$density_soma
;
# puncta.soma / area.soma
print
"
\t
",
$puncta_arbor
,"
\t
",
$span_arbor
,"
\t
",
$density_arbor
;
# puncta.arbor / span.arbor
print
"
\t
",
$puncta_arbor
/ $puncta_soma; # puncta.arbor /
puncta
.
soma
print
"
\t
",
$span_arbor
/ $area_soma; # span.arbor /
area
.
soma
print
"
\t
",
$ratio_density
;
# density.arbor / density.soma
for
(
my
$k
=
1
;
$k
<
10
;
$k
++
)
{
print
"
\t
",
$puncta_branch_list
[
$k
-
1
];
print
"
\t
",
$span_branch_list
[
$k
-
1
];
print
"
\t
",
$density_branch_list
[
$k
-
1
];
}
print
"
\n
";
print
"
\n
";
}
}
...
...
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