Skip to content

Commit

Permalink
fasterq-dump gzip, fix #2
Browse files Browse the repository at this point in the history
  • Loading branch information
showteeth committed May 14, 2024
1 parent 95fc1f8 commit 74a91d5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions R/fastq.R
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,18 @@ RunSplit <- function(sra.path, fastq.type, split.cmd.path, sratools.path, split.
split.cmd.path, split.cmd.paras, sp, "-O", out.folder,
"--threads", split.cmd.threads, sra.path
)
pigz.path <- Sys.which("pigz")
gzip.path <- Sys.which("gzip")
if (pigz.path == "" && gzip.path == "") {
split.cmd <- split.cmd
message("There is no pigz and gzip detected, return fastq files!")
} else if (pigz.path != "") {
message("Detected pigz, return fastq.gz files!")
split.cmd <- paste(split.cmd, "&& pigz -p 4", file.path(out.folder, "*fastq"))
} else if (gzip.path != "") {
message("Detected gzip, return fastq.gz files!")
split.cmd <- paste(split.cmd, "&& gzip", file.path(out.folder, "*fastq"))
}
} else {
split.cmd <- paste(split.cmd.path, split.cmd.paras, sp, "--gzip", "-O", out.folder, sra.path)
}
Expand Down

0 comments on commit 74a91d5

Please sign in to comment.