Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix error when run revolver pipeline #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 1 addition & 2 deletions R/remove_patients.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,9 @@ remove_patients = function(x,

if(length(drv_to_cancel) > 0) {
message(paste(drv_to_cancel, collapse = ', '), ": driver events that now are found in only one patient, will be now removed ...")
x = remove_drivers(x, drv_to_cancel, check = FALSE)
}

x = remove_drivers(x, drv_to_cancel, check = FALSE)

# if has clusters, force to recompute
if(has_clusters(x)) {
message("- The cohort has clusters which will be cancelled, please re-compute the clusters ...")
Expand Down
9 changes: 5 additions & 4 deletions R/revolver_cluster.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,12 @@ revolver_cluster = function(
if (pb.status) pb$tick()$print()

# Both patient have a transfer that we take and augment with E
p1_IT = ITransfer(x, patients[p1], data = 'fits', type = 'drivers') %>%
left_join(E, by = c('from', 'to'))
p1_IT = ITransfer(x, patients[p1], data = 'fits', type = 'drivers')
if (!is.null(p1_IT)) p1_IT <- left_join(p1_IT, E, by = c('from', 'to'))

p2_IT = ITransfer(x, patients[p2], data = 'fits', type = 'drivers') %>%
left_join(E, by = c('from', 'to'))
p2_IT = ITransfer(x, patients[p2], data = 'fits', type = 'drivers')
if (!is.null(p2_IT)) p2_IT <- left_join(p2_IT, E, by = c('from', 'to'))


# The distance is the absolute value of non-shared edges
distances[patients[p1], patients[p2]] = bind_rows(p1_IT, p2_IT) %>%
Expand Down