Skip to content

Commit

Permalink
Refactor writeCovTables
Browse files Browse the repository at this point in the history
  • Loading branch information
alephnull7 committed Feb 9, 2024
1 parent e135254 commit f7da408
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions R/verboseInformation.R
Original file line number Diff line number Diff line change
Expand Up @@ -182,23 +182,15 @@ setLowCoverage <- function(covData) {
}

writeCovTables <- function(covData, sample_name, dir) {
writeVerboseTable(covData$ir_genes, sample_name, dir, "coverage.genes")
writeVerboseTable(covData$ir_regions, sample_name, dir, "coverage.regions")
writeVerboseTable(covData$ir_noncoding, sample_name, dir, "coverage.noncoding")
}

writeVerboseTable <- function(df, sample_name, dir, fileName) {
write.table(
covData$ir_genes,
paste(dir, .Platform$file.sep, sample_name["sample_name"], "_coverage.genes.tsv", sep = ""),
row.names = FALSE,
quote = FALSE,
sep = "\t"
)
write.table(
covData$ir_regions,
paste(dir, .Platform$file.sep, sample_name["sample_name"], "_coverage.regions.tsv", sep = ""),
row.names = FALSE,
quote = FALSE,
sep = "\t"
)
write.table(
covData$ir_noncoding,
paste(dir, .Platform$file.sep, sample_name["sample_name"], "_coverage.noncoding.tsv", sep = ""),
df,
paste(dir, .Platform$file.sep, sample_name["sample_name"], "_", fileName, ".tsv", sep = ""),
row.names = FALSE,
quote = FALSE,
sep = "\t"
Expand Down

0 comments on commit f7da408

Please sign in to comment.