File tree 1 file changed +23
-7
lines changed
1 file changed +23
-7
lines changed Original file line number Diff line number Diff line change 1
- # ' Read PCGR Tiers TSV File
1
+ # ' Read PCGR TSV File
2
2
# '
3
- # ' Reads the `snvs_indels.tiers.tsv` file output by PCGR.
4
- # ' @param x Path to PCGR `snvs_indels.tiers.tsv` file.
3
+ # ' Reads the `snvs_indels.tiers.tsv` (or v2's `snv_indel_ann.tsv.gz`) file output
4
+ # ' by PCGR.
5
+ # ' @param x Path to PCGR `snvs_indels.tiers.tsv`/`snv_indel_ann.tsv.gz` file.
5
6
# ' @return A tibble with the contents of the input TSV file, or NULL if x is NULL.
6
7
# '
7
8
# ' @examples
@@ -24,10 +25,25 @@ pcgr_tiers_tsv_read <- function(x = NULL) {
24
25
.default = " c"
25
26
)
26
27
)
27
-
28
- assertthat :: assert_that(
29
- all(c(" CONSEQUENCE" , " TIER" , " AF_TUMOR" ) %in% colnames(d ))
30
- )
28
+ assertthat :: assert_that(" CONSEQUENCE" %in% colnames(d ))
29
+ if (! " TIER" %in% colnames(d )) {
30
+ if (" ACTIONABILITY_TIER" %in% colnames(d )) {
31
+ # ACTIONABILITY_TIER does not have TIER prefix
32
+ d <- d | >
33
+ dplyr :: rename(TIER = " ACTIONABILITY_TIER" ) | >
34
+ dplyr :: mutate(TIER = paste0(" TIER " , .data $ TIER ))
35
+ } else {
36
+ stop(" PCGR output does not contain TIER or ACTIONABILITY_TIER column!" )
37
+ }
38
+ }
39
+ if (! " AF_TUMOR" %in% colnames(d )) {
40
+ if (" VAF_TUMOR" %in% colnames(d )) {
41
+ d <- d | >
42
+ dplyr :: rename(AF_TUMOR = " VAF_TUMOR" )
43
+ } else {
44
+ stop(" PCGR output does not contain AF_TUMOR or VAF_TUMOR column!" )
45
+ }
46
+ }
31
47
32
48
d | >
33
49
dplyr :: mutate(
You can’t perform that action at this time.
0 commit comments