Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Przemyslaw Kaminski
haskell-gargantext
Commits
c08d6972
Commit
c08d6972
authored
Mar 14, 2019
by
Alexandre Delanoë
Committed by
Quentin Lobbé
Mar 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PHYLO] cLouvain in IO Monad fix.
parent
044f740c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
16 deletions
+17
-16
Phylo.hs
src/Gargantext/Viz/Phylo.hs
+1
-1
Cluster.hs
src/Gargantext/Viz/Phylo/Aggregates/Cluster.hs
+2
-2
Clustering.hs
src/Gargantext/Viz/Phylo/Metrics/Clustering.hs
+14
-13
No files found.
src/Gargantext/Viz/Phylo.hs
View file @
c08d6972
...
@@ -131,7 +131,7 @@ data PhyloGroup =
...
@@ -131,7 +131,7 @@ data PhyloGroup =
,
_phylo_groupLevelParents
::
[
Pointer
]
,
_phylo_groupLevelParents
::
[
Pointer
]
,
_phylo_groupLevelChilds
::
[
Pointer
]
,
_phylo_groupLevelChilds
::
[
Pointer
]
}
}
deriving
(
Generic
,
Show
,
Eq
)
deriving
(
Generic
,
Show
,
Eq
,
Ord
)
data
PhyloBranch
=
data
PhyloBranch
=
PhyloBranch
{
_phylo_branchId
::
(
Level
,
Int
)
PhyloBranch
{
_phylo_branchId
::
(
Level
,
Int
)
...
...
src/Gargantext/Viz/Phylo/Aggregates/Cluster.hs
View file @
c08d6972
...
@@ -37,7 +37,7 @@ import qualified Data.Set as Set
...
@@ -37,7 +37,7 @@ import qualified Data.Set as Set
-- | To apply a Clustering method to a PhyloGraph
-- | To apply a Clustering method to a PhyloGraph
graphToClusters
::
(
Clustering
,[
Double
])
->
PhyloGraph
->
[[
PhyloGroup
]]
graphToClusters
::
(
Clustering
,[
Double
])
->
PhyloGraph
->
[[
PhyloGroup
]]
graphToClusters
(
clust
,
param
)
(
nodes
,
edges
)
=
case
clust
of
graphToClusters
(
clust
,
param
)
(
nodes
,
edges
)
=
case
clust
of
Louvain
->
louvain
(
nodes
,
edges
)
Louvain
->
undefined
--
louvain (nodes,edges)
RelatedComponents
->
relatedComp
0
(
head
nodes
)
(
tail
nodes
,
edges
)
[]
[]
RelatedComponents
->
relatedComp
0
(
head
nodes
)
(
tail
nodes
,
edges
)
[]
[]
...
@@ -49,4 +49,4 @@ phyloToClusters lvl (prox,param) (clus,param') p = Map.fromList
...
@@ -49,4 +49,4 @@ phyloToClusters lvl (prox,param) (clus,param') p = Map.fromList
in
if
null
(
fst
graph
)
in
if
null
(
fst
graph
)
then
[]
then
[]
else
graphToClusters
(
clus
,
param'
)
graph
)
else
graphToClusters
(
clus
,
param'
)
graph
)
(
getPhyloPeriods
p
))
(
getPhyloPeriods
p
))
\ No newline at end of file
src/Gargantext/Viz/Phylo/Metrics/Clustering.hs
View file @
c08d6972
...
@@ -59,19 +59,20 @@ relatedComp idx curr (nodes,edges) next memo
...
@@ -59,19 +59,20 @@ relatedComp idx curr (nodes,edges) next memo
--------------------------------------
--------------------------------------
{-
louvain :: (PhyloNodes,PhyloEdges) -> [Cluster]
louvain :: (PhyloNodes,PhyloEdges) -> [Cluster]
louvain (nodes,edges) = undefined
louvain (nodes,edges) = undefined
-}
-- louvain :: (PhyloNodes,PhyloEdges) -> [Cluster]
-- louvain (nodes,edges) = map (\community -> map (\node -> nodes !! (l_node_id node)) community)
louvain
::
(
PhyloNodes
,
PhyloEdges
)
->
IO
[[
PhyloGroup
]]
-- $ groupBy (l_community_id)
louvain
(
nodes
,
edges
)
=
map
(
\
community
->
map
(
\
node
->
nodes
!!
(
l_node_id
node
))
community
)
-- $ cLouvain
<$>
groupBy
(
\
a
b
->
(
l_community_id
a
)
==
(
l_community_id
b
))
-- $ mapKeys (\(x,y) -> (idx x, idx y))
<$>
(
cLouvain
$
mapKeys
(
\
(
x
,
y
)
->
(
idx
x
,
idx
y
))
$
fromList
edges
)
-- $ fromList edges
where
-- where
--------------------------------------
-- --------------------------------------
idx
::
PhyloGroup
->
Int
-- idx :: PhyloGroup -> Int
idx
e
=
case
elemIndex
e
nodes
of
-- idx e = case elemIndex e nodes of
Nothing
->
panic
"[ERR][Gargantext.Viz.Phylo.Metrics.Clustering] a node is missing"
-- Nothing -> panic "[ERR][Gargantext.Viz.Phylo.Metrics.Clustering] a node is missing"
Just
i
->
i
-- Just i -> i
--------------------------------------
-- --------------------------------------
\ No newline at end of file
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