Skip to content

Commit

Permalink
check all mutation clones are in tree data
Browse files Browse the repository at this point in the history
Instead of checking for mutation clone ids in clonal prevalence data, check for them in the tree data
  • Loading branch information
mas29 committed Apr 28, 2016
1 parent ea31ab6 commit 19c669d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: timesweep
Title: Patient Clonal Timesweeps
Version: 0.0.3.9051
Version: 0.0.3.9052
Authors@R: person("Maia", "Smith", email = "[email protected]", role = c("aut", "cre"))
Description: What the package does (one paragraph).
Depends:
Expand Down
12 changes: 6 additions & 6 deletions R/timesweep.R
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,14 @@ timesweep <- function(clonal_prev,
mutations$impact <- as.character(mutations$impact)
}

# check that all CLONE IDS in the mutations data are present in the clonal prev data
# check that all CLONE IDS in the mutations data are present in the tree data
mutations_clone_ids <- unique(mutations$clone_id)
clonal_prev_clone_ids <- unique(clonal_prev$clone_id)
clone_ids_missing_from_clonal_prev_data <- setdiff(mutations_clone_ids, clonal_prev_clone_ids)
if (length(clone_ids_missing_from_clonal_prev_data) > 0) {
tree_edges_clone_ids <- c(unique(tree_edges$source), unique(tree_edges$target))
clone_ids_missing_from_tree_edges_data <- setdiff(mutations_clone_ids, tree_edges_clone_ids)
if (length(clone_ids_missing_from_tree_edges_data) > 0) {
stop(paste("The following clone ID(s) are present in the mutations data but ",
"are missing from the clonal prevalence data: ",
paste(clone_ids_missing_from_clonal_prev_data, collapse=", "), ".", sep=""))
"are missing from the tree edges data: ",
paste(clone_ids_missing_from_tree_edges_data, collapse=", "), ".", sep=""))
}

# check that all TIMEPOINTS in the mutations data are present in the clonal prev data
Expand Down

0 comments on commit 19c669d

Please sign in to comment.