Skip to content

Commit

Permalink
label_cluster.R: improved syntax and documentation; fixed typos
Browse files Browse the repository at this point in the history
  • Loading branch information
renewiegandt committed Jan 6, 2019
1 parent f800e77 commit 7ff588b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bin/2.2_motif_estimation/label_cluster.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ option_list <- list(
)

opt_parser <- OptionParser(option_list = option_list,
description = "Adding Cluster ID to Query_ID Column")
description = "Adding Cluster ID to Query_ID Column.",
epilogue = "Author: Rene Wiegandt <Rene.Wiegandt@mpi-bn.mpg.de>")

opt <- parse_args(opt_parser)

Expand All @@ -27,7 +28,7 @@ label_cluster <- function(input, output){
cluster_number <- as.numeric(splitted_name[length(splitted_name) - 1]) + 1

#Adding cluster ID to first column
tsv$Query_ID <- paste(tsv$Query_ID, ".", cluster_number,sep = "")
tsv$Query_ID <- paste0(tsv$Query_ID, ".", cluster_number)


data.table::fwrite(tsv, file = output, sep = "\t", col.names = FALSE)
Expand All @@ -36,4 +37,4 @@ label_cluster <- function(input, output){
# run function label_cluster with given parameteres if not in interactive context (e.g. run from shell)
if (!interactive()) {
label_cluster(opt$input, opt$output)
}
}

0 comments on commit 7ff588b

Please sign in to comment.