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 when model isn't specified #148

Open
erinyoung opened this issue Dec 18, 2024 · 2 comments
Open

Error when model isn't specified #148

erinyoung opened this issue Dec 18, 2024 · 2 comments

Comments

@erinyoung
Copy link

Thank you for your continued efforts to maintain this software! I've found it very useful.

I'm currently switching to using version 1.5.8.

I get a weird error when I don't specify a model for artic minion:

$ artic minion --normalise 200  --threads 4 --read-file SRR22452250_1_filtered.fastq.gz --bed new.primer.bed --ref reference.fasta finalish
Traceback (most recent call last):
  File "/home/eriny/miniconda3/envs/artic/lib/python3.9/site-packages/Bio/File.py", line 72, in as_handle
    with open(handleish, mode, **kwargs) as fp:
TypeError: expected str, bytes or os.PathLike object, not TextIOWrapper

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/eriny/miniconda3/envs/artic/bin/artic", line 10, in <module>
    sys.exit(main())
  File "/home/eriny/miniconda3/envs/artic/lib/python3.9/site-packages/artic/pipeline.py", line 300, in main
    args.func(parser, args)
  File "/home/eriny/miniconda3/envs/artic/lib/python3.9/site-packages/artic/pipeline.py", line 28, in run_subtool
    submodule.run(parser, args)
  File "/home/eriny/miniconda3/envs/artic/lib/python3.9/site-packages/artic/minion.py", line 61, in run
    model = choose_model(args.read_file)
  File "/home/eriny/miniconda3/envs/artic/lib/python3.9/site-packages/artic/utils.py", line 870, in choose_model
    read = next(reads)
  File "/home/eriny/miniconda3/envs/artic/lib/python3.9/site-packages/Bio/SeqIO/Interfaces.py", line 91, in __next__
    return next(self.records)
  File "/home/eriny/miniconda3/envs/artic/lib/python3.9/site-packages/Bio/SeqIO/QualityIO.py", line 1099, in iterate
    for title_line, seq_string, quality_string in FastqGeneralIterator(handle):
  File "/home/eriny/miniconda3/envs/artic/lib/python3.9/site-packages/Bio/SeqIO/QualityIO.py", line 929, in FastqGeneralIterator
    line = next(handle)
  File "/home/eriny/miniconda3/envs/artic/lib/python3.9/gzip.py", line 313, in read1
    return self._buffer.read1(size)
  File "/home/eriny/miniconda3/envs/artic/lib/python3.9/_compression.py", line 68, in readinto
    data = self.read(len(byte_view))
  File "/home/eriny/miniconda3/envs/artic/lib/python3.9/gzip.py", line 487, in read
    if not self._read_gzip_header():
  File "/home/eriny/miniconda3/envs/artic/lib/python3.9/gzip.py", line 435, in _read_gzip_header
    raise BadGzipFile('Not a gzipped file (%r)' % magic)
gzip.BadGzipFile: Not a gzipped file (b'@S')

Everything works fine when I specify the model.

@BioWilko
Copy link
Collaborator

BioWilko commented Dec 19, 2024

I think the issue is that your fastq file isn't actually gzipped, if you do head SRR22452250_1_filtered.fastq.gz do you see the read data?
If so, try renaming the file to SRR22452250_1_filtered.fastq and it should work fine.

I can look at adding some handling to check that the file is actually compressed but I'm not sure that it would be a good idea to silently handle this since the error is fairly descriptive...

Copy link

This issue is stale because it has been open for 30 days with no activity.

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

2 participants