Skip to content

Commit

Permalink
Make read data less verbose and add more informative messages
Browse files Browse the repository at this point in the history
  • Loading branch information
tavareshugo committed Aug 16, 2018
1 parent cd99d60 commit 425149d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions snape-pooled_parser.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,17 @@ if(is.null(opt$snp_list)){
#
# Read SNP file ----
#
message("Reading snape-pooled file...")
message("Reading snape-pooled file: ", opt$snape)

snape <- fread(opt$snape,
col.names = c("chrom", "pos", "ref_allele", "ref_count", "alt_count",
"ref_qual", "alt_qual", "alleles", "prob_polymorphic",
"prob_fixed", "alt_freq"),
colClasses = c("character", "integer", "character", "integer", "integer",
"integer", "integer", "character", "numeric", "numeric", "numeric"),
na.strings = "*")
na.strings = "*",
showProgress = FALSE,
integer64 = "numeric")



Expand All @@ -106,7 +108,7 @@ message("Subsetting SNPs...")
# Subset SNPs
if(!is.null(opt$snp_list)){ # If SNP list is provided
# Read SNP list
snp_list <- fread(opt$snp_list)
snp_list <- fread(opt$snp_list, showProgress = FALSE)

# Get SNP ID
snp_subset <- paste(snp_list[[1]], snp_list[[2]], sep = "_")
Expand All @@ -133,5 +135,5 @@ if(!is.null(opt$snp_list)){ # If SNP list is provided
}

# Write output
message("Writting output file...")
message("Writting output file: ", opt$out)
write.csv(snape, file = opt$out, row.names = FALSE)

0 comments on commit 425149d

Please sign in to comment.