Skip to content

Commit

Permalink
Allow exclude same sponsor/site region in sankey
Browse files Browse the repository at this point in the history
  • Loading branch information
ccunningham101 committed Dec 7, 2023
1 parent ca370b5 commit 993cf51
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions query_ror.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ def site_sponsor(args):
sponsor_country_column = args.sponsor_country_column
site_country_column = args.site_country_column
exclude_indiv_company = args.exclude_indiv_company
exclude_same = args.exclude_same

site_df = load_glob(site_files, site_filter, exclude_indiv_company)
sponsor_df = load_glob(sponsor_files, sponsor_filter, exclude_indiv_company)
Expand All @@ -521,6 +522,9 @@ def site_sponsor(args):
.trial_id.count()
.reset_index()
)

if exclude_same:
counts = counts.loc[counts.who_region != counts.sponsor_who_region]
# Map nodes to node ids
who_map = {name: index for index, name in enumerate(counts.who_region.unique())}
who_sponsor_map = {
Expand Down Expand Up @@ -788,6 +792,11 @@ def multisite(args):
action="store_true",
help="Exclude individuals and companies",
)
site_sponsor_parser.add_argument(
"--exclude-same",
action="store_true",
help="Exclude site/sponsor region the same",
)
site_sponsor_parser.set_defaults(func=site_sponsor)

args = ror_parser.parse_args()
Expand Down

0 comments on commit 993cf51

Please sign in to comment.