Skip to content

Commit

Permalink
Merge pull request #71 from cns-iu/pbi-get-organ-label-for-ref-organ
Browse files Browse the repository at this point in the history
Added code to add label to reference organ
  • Loading branch information
andreasbueckle authored Nov 29, 2023
2 parents addae43 + 16c47dd commit 48229a9
Show file tree
Hide file tree
Showing 3 changed files with 296 additions and 280 deletions.
9 changes: 7 additions & 2 deletions ctpop_plots/PlotsPaper.R
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,14 @@ rui_count = more_cols %>% count (as_id)
more_cols = merge(more_cols, rui_count, by.x = "as_id")
colnames(more_cols)[colnames(more_cols) == "n"] <- "rui_locations_per_as"

p = ggplot(more_cols, aes(x = reorder(as_label, -intersection_volume), y = intersection_volume, fill=sex, alpha = rui_locations_per_as))+
# add tissue_block_intersection_percentage
with_ratio = more_cols %>% mutate(
tissue_block_intersection_percentage = intersection_volume/tissue_block_volume
)

p = ggplot(with_ratio, aes(x = organ_label, y = tissue_block_intersection_percentage, fill=sex, alpha = rui_locations_per_as))+
geom_bar(stat = "identity")+
facet_wrap(~organ)+
# facet_wrap(~organ_label)+
scale_y_continuous(labels=scales::number_format(decimal.mark = '.'))+
scale_color_brewer()+
scale_fill_brewer(type="qual", palette = "Dark2")+
Expand Down
15 changes: 13 additions & 2 deletions data-processor/queries/table-s5.rq
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ PREFIX dc: <http://purl.org/dc/terms/>
PREFIX hubmap: <https://entity.api.hubmapconsortium.org/entities/>
PREFIX rui: <http://purl.org/ccf/1.5/>

SELECT DISTINCT ?rui_location ?organ ?as_label ?as_id ?intersection_volume ?as_volume ?tissue_block_volume
SELECT DISTINCT ?rui_location ?organ ?organ_label ?as_label ?as_id ?intersection_volume ?as_volume ?tissue_block_volume

FROM ctpop-graph:
FROM <https://purl.org/ccf/releases/2.2.1/ccf.owl>

WHERE {

# Get tissue block volume
Expand All @@ -36,8 +39,16 @@ WHERE {
ccf:has_reference_organ ?ref_organ ;
ccf:percentage_of_total ?percentage ;
]
]
] .

# get label for reference organ
?ref_organ ccf:representation_of ?organId .
?organId rdfs:label ?organ_label

BIND (?tissue_block_volume * ?percentage as ?intersection_volume)
BIND (REPLACE(REPLACE(REPLACE(STR(?ref_organ), "http://purl.org/ccf/latest/ccf.owl#", ""), "Colon", "LargeIntestine"), "V1.1", "") as ?organ)



}
ORDER BY ?organ ?rui_location DESC(?as_volume)
Loading

0 comments on commit 48229a9

Please sign in to comment.