Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error writing long reads with writeQualityScaledXStringSet #117

Open
ahl27 opened this issue Oct 15, 2024 · 1 comment
Open

Error writing long reads with writeQualityScaledXStringSet #117

ahl27 opened this issue Oct 15, 2024 · 1 comment

Comments

@ahl27
Copy link
Collaborator

ahl27 commented Oct 15, 2024

This is an error originally posted on the Bioconductor support site: https://support.bioconductor.org/p/9160158/#9160159

Reproducible example:

library(Biostrings)

# Manually create a simple FASTQ file
nrep <- 20001
seqs <- paste0(rep("AGCTGATCGG", nrep), collapse="")
quals <- paste0(rep("ABCDEFGHIJ", nrep), collapse="")
descs <- sprintf("@S%01d_%07d", seq_along(seqs), nchar(seqs))
fastq.txt <- c(descs, seqs, "+", quals)
fname <- "example.fastq"
writeLines(fastq.txt, fname)

# Read and write the simple FASTQ file
qs.seqs <- readQualityScaledDNAStringSet(fname)
writeQualityScaledXStringSet(qs.seqs, fname)

# Error in .Call2("write_XStringSet_to_fastq", x, filexp_list, qualities,  : 
#   XStringSet object (or derivative) to write 'x' cannot contain strings
#   longer than 200000 ('x[[1]]' has 200010 characters)

Also reportedly fails to remove the intermediate file on failure (unconfirmed).

# Warning messages:
# 1: In file.remove(expath) :
#   cannot remove file 'example.fastq', reason 'Permission denied'
# 2: In writeXStringSet(x, filepath, append, compress, compression_level,  :
#   cannot remove file 'example.fastq'

Should be addressed following latest release.

@ahl27
Copy link
Collaborator Author

ahl27 commented Jan 2, 2025

Fixed in PR #122

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant