Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Update number formatting for braf-fusion plots (5/N) #68

Merged
merged 7 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions analyses/braf-fusions/01-get-breakpoint-exons.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,14 @@ braf_fusions <- braf_fusions %>%
FusionName == "KIAA1549--BRAF" ~ glue::glue("{left_exon_rank}:{right_exon_rank}"),
FusionName == "BRAF--KIAA1549" ~ glue::glue("{right_exon_rank}:{left_exon_rank}")
)) %>%
dplyr::select(-subjectHits, -queryHits)
dplyr::select(-subjectHits, -queryHits) %>%
dplyr::mutate(breakpoint_exons = str_replace(
str_replace(breakpoint_exons,
":8", ":08"),
":9", ":09"))

# add column indicating if breakpoint is common or rare/novel
common_breakpoints <- c("16:9", "15:9", "16:11", "18:10")
common_breakpoints <- c("16:09", "15:09", "16:11", "18:10")

braf_fusions <- braf_fusions %>%
dplyr::mutate(breakpoint_type = case_when(
Expand Down
125 changes: 56 additions & 69 deletions analyses/braf-fusions/01-get-breakpoint-exons.html
Original file line number Diff line number Diff line change
Expand Up @@ -432,41 +432,24 @@ <h4 class="date">2024</h4>
<p>Load libraries and set directories</p>
<pre class="r"><code>library(data.table)
library(tidyverse)</code></pre>
<pre><code>## ── Attaching core tidyverse packages ──────────────────────────────────────────────────────────────────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.1 ✔ readr 2.1.4
## ✔ forcats 1.0.0 ✔ stringr 1.5.0
## ✔ ggplot2 3.4.2 ✔ tibble 3.2.1
## ✔ lubridate 1.9.2 ✔ tidyr 1.3.0
## ✔ purrr 1.0.1
## ── Conflicts ────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::between() masks data.table::between()
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::first() masks data.table::first()
## ✖ lubridate::hour() masks data.table::hour()
## ✖ lubridate::isoweek() masks data.table::isoweek()
## ✖ dplyr::lag() masks stats::lag()
## ✖ dplyr::last() masks data.table::last()
## ✖ lubridate::mday() masks data.table::mday()
## ✖ lubridate::minute() masks data.table::minute()
## ✖ lubridate::month() masks data.table::month()
## ✖ lubridate::quarter() masks data.table::quarter()
## ✖ lubridate::second() masks data.table::second()
## ✖ purrr::transpose() masks data.table::transpose()
## ✖ lubridate::wday() masks data.table::wday()
## ✖ lubridate::week() masks data.table::week()
## ✖ lubridate::yday() masks data.table::yday()
## ✖ lubridate::year() masks data.table::year()
## ℹ Use the conflicted package (&lt;http://conflicted.r-lib.org/&gt;) to force all conflicts to become errors</code></pre>
<pre><code>## ── Attaching packages ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse 1.3.2 ──
## ✔ ggplot2 3.4.0 ✔ purrr 1.0.1
## ✔ tibble 3.1.8 ✔ dplyr 1.1.0
## ✔ tidyr 1.3.0 ✔ stringr 1.5.0
## ✔ readr 2.1.3 ✔ forcats 1.0.0
## ── Conflicts ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::between() masks data.table::between()
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::first() masks data.table::first()
## ✖ dplyr::lag() masks stats::lag()
## ✖ dplyr::last() masks data.table::last()
## ✖ purrr::transpose() masks data.table::transpose()</code></pre>
<pre class="r"><code>library(GenomicRanges)</code></pre>
<pre><code>## Loading required package: stats4
## Loading required package: BiocGenerics
##
## Attaching package: &#39;BiocGenerics&#39;
##
## The following objects are masked from &#39;package:lubridate&#39;:
##
## intersect, setdiff, union
##
## The following objects are masked from &#39;package:dplyr&#39;:
##
## combine, intersect, setdiff, union
Expand All @@ -488,10 +471,6 @@ <h4 class="date">2024</h4>
##
## Attaching package: &#39;S4Vectors&#39;
##
## The following objects are masked from &#39;package:lubridate&#39;:
##
## second, second&lt;-
##
## The following objects are masked from &#39;package:dplyr&#39;:
##
## first, rename
Expand All @@ -512,10 +491,6 @@ <h4 class="date">2024</h4>
##
## Attaching package: &#39;IRanges&#39;
##
## The following object is masked from &#39;package:lubridate&#39;:
##
## %within%
##
## The following objects are masked from &#39;package:dplyr&#39;:
##
## collapse, desc, slice
Expand Down Expand Up @@ -543,7 +518,7 @@ <h4 class="date">2024</h4>
<pre class="r"><code>braf_fusions &lt;- read_tsv(fusion_file) %&gt;%
dplyr::filter(FusionName %in% c(&quot;KIAA1549--BRAF&quot;, &quot;BRAF--KIAA1549&quot;))</code></pre>
<pre><code>## Rows: 81348 Columns: 22
## ── Column specification ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
## ── Column specification ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
## Delimiter: &quot;\t&quot;
## chr (20): Sample, FusionName, LeftBreakpoint, RightBreakpoint, DomainRetaine...
## dbl (1): caller.count
Expand Down Expand Up @@ -592,6 +567,9 @@ <h4 class="date">2024</h4>
# add row ids to be used when assessing breakpoint-exon overlaps
dplyr::mutate(subjectHits = row_number())</code></pre>
<pre><code>## Joining with `by = join_by(ensembl_exon_id)`</code></pre>
<pre><code>## Warning in left_join(., exons_structure_bm[, c(&quot;ensembl_exon_id&quot;, &quot;exon_chrom_start&quot;, : Each row in `x` is expected to match at most 1 row in `y`.
## ℹ Row 27 of `x` matches multiple rows.
## ℹ If multiple matches are expected, set `multiple = &quot;all&quot;` to silence this warning.</code></pre>
<p>Create exon GRanges object</p>
<pre class="r"><code>exon_granges &lt;- GRanges(
seqnames = exons_bm$chromosome_name,
Expand Down Expand Up @@ -634,11 +612,15 @@ <h4 class="date">2024</h4>
FusionName == &quot;KIAA1549--BRAF&quot; ~ glue::glue(&quot;{left_exon_rank}:{right_exon_rank}&quot;),
FusionName == &quot;BRAF--KIAA1549&quot; ~ glue::glue(&quot;{right_exon_rank}:{left_exon_rank}&quot;)
)) %&gt;%
dplyr::select(-subjectHits, -queryHits)</code></pre>
dplyr::select(-subjectHits, -queryHits) %&gt;%
dplyr::mutate(breakpoint_exons = str_replace(
str_replace(breakpoint_exons,
&quot;:8&quot;, &quot;:08&quot;),
&quot;:9&quot;, &quot;:09&quot;))</code></pre>
<pre><code>## Joining with `by = join_by(queryHits)`
## Joining with `by = join_by(queryHits)`</code></pre>
<pre class="r"><code># add column indicating if breakpoint is common or rare/novel
common_breakpoints &lt;- c(&quot;16:9&quot;, &quot;15:9&quot;, &quot;16:11&quot;, &quot;18:10&quot;)
common_breakpoints &lt;- c(&quot;16:09&quot;, &quot;15:09&quot;, &quot;16:11&quot;, &quot;18:10&quot;)

braf_fusions &lt;- braf_fusions %&gt;%
dplyr::mutate(breakpoint_type = case_when(
Expand All @@ -650,9 +632,9 @@ <h4 class="date">2024</h4>
file.path(results_dir, &quot;braf-fusions-exon-annotation.tsv&quot;))</code></pre>
<p>Print session info</p>
<pre class="r"><code>sessionInfo()</code></pre>
<pre><code>## R version 4.2.3 (2023-03-15)
<pre><code>## R version 4.2.2 (2022-10-31)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 22.04.3 LTS
## Running under: Ubuntu 22.04.1 LTS
##
## Matrix products: default
## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
Expand All @@ -673,35 +655,40 @@ <h4 class="date">2024</h4>
## other attached packages:
## [1] biomaRt_2.54.1 GenomicRanges_1.50.2 GenomeInfoDb_1.34.9
## [4] IRanges_2.32.0 S4Vectors_0.36.2 BiocGenerics_0.44.0
## [7] lubridate_1.9.2 forcats_1.0.0 stringr_1.5.0
## [10] dplyr_1.1.1 purrr_1.0.1 readr_2.1.4
## [13] tidyr_1.3.0 tibble_3.2.1 ggplot2_3.4.2
## [16] tidyverse_2.0.0 data.table_1.14.8
## [7] forcats_1.0.0 stringr_1.5.0 dplyr_1.1.0
## [10] purrr_1.0.1 readr_2.1.3 tidyr_1.3.0
## [13] tibble_3.1.8 ggplot2_3.4.0 tidyverse_1.3.2
## [16] data.table_1.15.0
##
## loaded via a namespace (and not attached):
## [1] Biobase_2.58.0 httr_1.4.5 sass_0.4.5
## [4] bit64_4.0.5 vroom_1.6.1 jsonlite_1.8.4
## [7] bslib_0.4.2 BiocFileCache_2.6.1 blob_1.2.4
## [10] GenomeInfoDbData_1.2.9 yaml_2.3.7 progress_1.2.2
## [13] pillar_1.9.0 RSQLite_2.3.1 glue_1.6.2
## [16] digest_0.6.31 XVector_0.38.0 colorspace_2.1-0
## [19] htmltools_0.5.5 XML_3.99-0.14 pkgconfig_2.0.3
## [22] zlibbioc_1.44.0 scales_1.2.1 tzdb_0.3.0
## [25] timechange_0.2.0 KEGGREST_1.38.0 generics_0.1.3
## [28] cachem_1.0.7 withr_2.5.0 cli_3.6.1
## [31] magrittr_2.0.3 crayon_1.5.2 memoise_2.0.1
## [34] evaluate_0.20 fansi_1.0.4 xml2_1.3.3
## [37] tools_4.2.3 prettyunits_1.1.1 hms_1.1.3
## [40] lifecycle_1.0.3 munsell_0.5.0 AnnotationDbi_1.60.2
## [43] Biostrings_2.66.0 compiler_4.2.3 jquerylib_0.1.4
## [46] rlang_1.1.0 grid_4.2.3 RCurl_1.98-1.12
## [49] rappdirs_0.3.3 bitops_1.0-7 rmarkdown_2.21
## [52] gtable_0.3.3 DBI_1.1.3 curl_5.0.0
## [55] R6_2.5.1 knitr_1.42 fastmap_1.1.1
## [58] bit_4.0.5 utf8_1.2.3 filelock_1.0.2
## [61] rprojroot_2.0.3 stringi_1.7.12 parallel_4.2.3
## [64] vctrs_0.6.2 png_0.1-8 dbplyr_2.3.2
## [67] tidyselect_1.2.0 xfun_0.38</code></pre>
## [1] bitops_1.0-7 fs_1.6.0 lubridate_1.9.1
## [4] bit64_4.0.5 filelock_1.0.3 progress_1.2.2
## [7] httr_1.4.4 rprojroot_2.0.3 tools_4.2.2
## [10] backports_1.4.1 bslib_0.4.2 utf8_1.2.3
## [13] R6_2.5.1 DBI_1.1.3 colorspace_2.1-0
## [16] withr_2.5.0 tidyselect_1.2.0 prettyunits_1.1.1
## [19] curl_5.0.0 bit_4.0.5 compiler_4.2.2
## [22] cli_3.6.0 rvest_1.0.3 Biobase_2.58.0
## [25] xml2_1.3.3 sass_0.4.5 scales_1.2.1
## [28] rappdirs_0.3.3 digest_0.6.31 rmarkdown_2.20
## [31] XVector_0.38.0 pkgconfig_2.0.3 htmltools_0.5.4
## [34] dbplyr_2.3.0 fastmap_1.1.0 rlang_1.0.6
## [37] readxl_1.4.1 RSQLite_2.2.20 jquerylib_0.1.4
## [40] generics_0.1.3 jsonlite_1.8.4 vroom_1.6.1
## [43] googlesheets4_1.0.1 RCurl_1.98-1.14 magrittr_2.0.3
## [46] GenomeInfoDbData_1.2.9 Rcpp_1.0.10 munsell_0.5.0
## [49] fansi_1.0.4 lifecycle_1.0.3 stringi_1.7.12
## [52] yaml_2.3.7 zlibbioc_1.44.0 BiocFileCache_2.6.1
## [55] grid_4.2.2 blob_1.2.3 parallel_4.2.2
## [58] crayon_1.5.2 Biostrings_2.66.0 haven_2.5.1
## [61] hms_1.1.2 KEGGREST_1.38.0 knitr_1.42
## [64] pillar_1.8.1 reprex_2.0.2 XML_3.99-0.16.1
## [67] glue_1.6.2 evaluate_0.20 modelr_0.1.10
## [70] vctrs_0.5.2 png_0.1-8 tzdb_0.3.0
## [73] cellranger_1.1.0 gtable_0.3.1 assertthat_0.2.1
## [76] cachem_1.0.6 xfun_0.42 broom_1.0.3
## [79] googledrive_2.0.0 gargle_1.3.0 AnnotationDbi_1.60.2
## [82] memoise_2.0.1 timechange_0.2.0 ellipsis_0.3.2</code></pre>



Expand Down
Loading