Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
treebuilder
Overview
Overview
Details
Activity
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
Huang Di
treebuilder
Commits
5b43ad84
Commit
5b43ad84
authored
Jul 11, 2023
by
Huang Di
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix start_nodes and eq_scc bug
parent
aa3cfc42
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
12 deletions
+35
-12
main.py
+35
-12
No files found.
main.py
View file @
5b43ad84
...
@@ -18,25 +18,41 @@ args = {
...
@@ -18,25 +18,41 @@ args = {
'threshold3'
:
3
,
# gene flow merge threshold
'threshold3'
:
3
,
# gene flow merge threshold
'bidirectional'
:
True
,
# calculate the reversed gene flow
'bidirectional'
:
True
,
# calculate the reversed gene flow
'calculate_pd'
:
True
,
# calculate the gene flow confidence
'calculate_pd'
:
True
,
# calculate the gene flow confidence
'data_path'
:
'data/
test
.log'
,
'data_path'
:
'data/
D_AI_230710
.log'
,
'save_path'
:
'pictures/tree.png'
,
'save_path'
:
'pictures/tree.png'
,
'draw_gene_flow'
:
True
,
'draw_gene_flow'
:
True
,
'gene_flow_display_confidence'
:
0.7
,
'gene_flow_display_confidence'
:
0.7
,
'target_block_list'
:
[
'
Tianyuan
'
],
'target_block_list'
:
[
'
AR14K
'
],
's1_block_list'
:
[
'
Boshan
'
],
's1_block_list'
:
[
'
AR14K
'
],
# 'target_block_list': [],
# 'target_block_list': [],
# 's1_block_list': [],
# 's1_block_list': [],
}
}
populations
=
[
'Tianyuan'
,
populations
=
[
'Kostenki14'
,
'Tianyuan'
,
'AR19K'
,
'AR14K'
,
'Zongri5_1k'
,
'Boshan'
,
'Boshan'
,
'Qihe3'
,
'Qihe'
,
'Donghulin'
,
'Longlin'
,
]
'Dushan'
,
'Baojianshan'
,
'La368'
,
'Bianbian'
,
'Xiaojingshan'
,
'BQGroup'
,
'YJCGroup'
,
'LJZGroup'
,
'YR_MN_WGM'
,
'WLR_MN'
,
'DevilsCave_N'
,
'AR14K'
]
# populations = ['Kostenki14',
# 'Tianyuan',
# 'AR19K',
# 'AR14K',
# 'Zongri5_1k',
# 'Boshan',
# 'Qihe3',
# 'Donghulin',
# ]
#args = {
#args = {
# 'change_greenstar': True,
# 'change_greenstar': True,
...
@@ -114,6 +130,7 @@ print('Analyzing the minimum Z...')
...
@@ -114,6 +130,7 @@ print('Analyzing the minimum Z...')
bottom_threshold
=
0
bottom_threshold
=
0
D_statistics
,
adjusted_D_values
,
triangles
,
redstar_indices
,
min_redstar
,
s2_record
\
D_statistics
,
adjusted_D_values
,
triangles
,
redstar_indices
,
min_redstar
,
s2_record
\
=
read_data
(
data_path
,
bottom_threshold
,
populations
)
=
read_data
(
data_path
,
bottom_threshold
,
populations
)
print
(
s2_record
)
builder
=
TreeBuilder
(
populations
,
triangles
,
s2_record
)
builder
=
TreeBuilder
(
populations
,
triangles
,
s2_record
)
builder
.
D2graph
(
D_statistics
)
builder
.
D2graph
(
D_statistics
)
g
=
builder
.
g
g
=
builder
.
g
...
@@ -203,7 +220,10 @@ for scc_idx, s in enumerate(scc0):
...
@@ -203,7 +220,10 @@ for scc_idx, s in enumerate(scc0):
del
g
.
graph
[
idx
]
del
g
.
graph
[
idx
]
g
.
graph
[
represent
][
'in'
]
.
discard
(
idx
)
g
.
graph
[
represent
][
'in'
]
.
discard
(
idx
)
g
.
graph
[
represent
][
'out'
]
.
discard
(
idx
)
g
.
graph
[
represent
][
'out'
]
.
discard
(
idx
)
if
idx
in
g
.
start_nodes
:
g
.
start_nodes
.
discard
(
idx
)
g
.
start_nodes
.
discard
(
idx
)
else
:
g
.
start_nodes
.
discard
(
represent
)
# note that, the eq set of the node may contain duplicated nodes with different values!!!!!!!
# note that, the eq set of the node may contain duplicated nodes with different values!!!!!!!
# tmp_node_record is used to duplicate them.
# tmp_node_record is used to duplicate them.
# tmp_node_record = []
# tmp_node_record = []
...
@@ -420,7 +440,10 @@ for scc_idx, s in enumerate(scc):
...
@@ -420,7 +440,10 @@ for scc_idx, s in enumerate(scc):
g
.
graph
[
node
][
'in'
]
.
add
(
represent
)
g
.
graph
[
node
][
'in'
]
.
add
(
represent
)
g
.
graph
[
node
][
'in'
]
.
remove
(
idx
)
g
.
graph
[
node
][
'in'
]
.
remove
(
idx
)
del
g
.
graph
[
idx
]
del
g
.
graph
[
idx
]
if
idx
in
g
.
start_nodes
:
g
.
start_nodes
.
discard
(
idx
)
g
.
start_nodes
.
discard
(
idx
)
else
:
g
.
start_nodes
.
discard
(
represent
)
g
.
graph
[
represent
][
'in'
]
.
remove
(
represent
)
g
.
graph
[
represent
][
'in'
]
.
remove
(
represent
)
g
.
graph
[
represent
][
'out'
]
.
remove
(
represent
)
g
.
graph
[
represent
][
'out'
]
.
remove
(
represent
)
if
represent
in
eq_scc
:
if
represent
in
eq_scc
:
...
...
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