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

reads.py errors #135

Open
sheaster opened this issue Nov 19, 2024 · 1 comment
Open

reads.py errors #135

sheaster opened this issue Nov 19, 2024 · 1 comment

Comments

@sheaster
Copy link

Hi There,
I had some issues getting RAT to run (CAT and BAT both worked) using a megahit assembly.
In order to fix it (I think), I used the latest release of CAT v6.0.1 and had to change a few lines assigning dictionary keys.

specifically:
reads_v2.txt

  • in get_contig_lengths i had to change the c_id key set in the contig_length_dict from "c.split('\n')[0].strip()" to "c.rstrip().split(' ')[0].lstrip('>')" as it was faulting in make_tax_table
  • in make_unclassified_seq_fasta I changed the last line in the part writing unclassified_seq_fasta I changed "outf.write('>{0}{1}\n{2}\n'.format(seq_id, suffix,
    fasta_dict[seq]))" to "outf.write('>{0}{1}\n{2}\n'.format(seq_id, suffix,
    fasta_dict[seq_id]))"

The program now runs without errors on my local install with my files - do those changes have any secondary effects in the program I might not be expecting?

I attached my reads.py file that I'm running now as a txt file
Thanks,
Shea

@yuqing-feng
Copy link

Dear Shea,
Thank you for sharing your scirpt. This script does not seem to work for me.

  1. In lines 395-396, irrevelant codes exist.
  2. After deleting these lines, I rerun the software: CAT_pack reads -1 R_1.fastq -2 R_2.fastq -m cr -d 20231120_CAT_gtdb/db/ -t 20231120_CAT_gtdb/tax/ -o new -n 16 -c tests/final_assembly.fasta (assembled using Megahit).
    reads.py", line 953, in make_tax_table
    taxon_dict[taxon]['n_nucleotides']+=contig_length_dict[contig]
    KeyError: 'k141_3004_length_4231_cov_30.2848'

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