<p>I ultimately addressed this issue using the <a href="https://github.com/DerrickWood/kraken2" rel="nofollow noreferrer">kraken2 software</a>. I found this approach to rely on a good deal of my server's memory, but it was sufficient for doing a viral/bacterial classification of sequences.</p>

CC BY-SA 4.0
2024-01-18T19:52:32.593Z
2024-01-18T19:52:32.593Z
akoontz11
<p>I'm working with RADseq data (288 compressed FASTQ files, <code>*.fq.gz</code>) from 3 plates of plant tissue. I've done demultiplexing and preliminary QC (using the <a href="https://catchenlab.life.illinois.edu/stacks/comp/process_radtags.php" rel="nofollow noreferrer">Stacks <code>process_radtags</code> command</a>), and before performing a reference alignment, I want make sure the sequences in each sample (roughly) correspond to the organism I expect them to be derived from, rather than potential contaminants (bacteria and/or fungi).</p>
<p>Does anyone have a straightforward, &quot;canned&quot; approach for doing this, either in R or a different environment? I believe the <code>blastn</code> algorithm can be used to query the sequences in these files against a database (like NCBI), and is usable on the command line. However, I've not used it before, and I'm not sure if it makes sense to query <em>all</em> the sequences in each file. Additionally, I don't know if the command can process this many files of this size (~600 MB per FASTQ file).</p>
<p><a href="https://bioinformatics.stackexchange.com/questions/7473/testing-for-viral-bacterial-infection-fastq-files">This post</a> from ~4 years ago asks a similar question for a pair of human blood samples, but is concerned with bacterial/viral DNA. The answer linking <code>kmerfinder</code> might have promise, but I'd appreciate any input from folks familiar with this issue.</p>
<p>(<em>Background</em>: I've gotten my Master's degree in Biology and have worked with NGS data for ~4 years now. I'm performing analyses on a 32-core Linux server. I'm less skilled in Python, but am willing to use it if there are no other options.)</p>

CC BY-SA 4.0
2024-01-10T08:59:50.137Z
Do you have a high quality reference genome of the plant you are working with?
Pallie
CC BY-SA 4.0
2024-01-11T14:14:49.733Z
Yes, I do. I've used the same reference genome in other projects, with similarly related taxa.
akoontz11
CC BY-SA 4.0
2024-01-12T16:56:06.117Z
Thanks for the question, I'm familiar with working on RAD format and particularly don't know whether you've generated mixed genome RAD data. If know this information and I've time I'll put an answer down using either Bash or Python. I don't use R unless I've no other option. Please post a note below the question if you do edit it to notify me.
M__
<ngs><filtering><bacteria><blastn><radseq>
Approaches for filtering bacterial/fungal contaminant sequences from RADseq results
# Approaches for filtering bacterial/fungal contaminant sequences from RADseq results

(Asked by: username_0 on 2024-01-09)

I'm working with RADseq data (288 compressed FASTQ files, `*.fq.gz`) from 3 plates of plant tissue. I've done demultiplexing and preliminary QC (using the [Stacks `process_radtags` command](https://catchenlab.life.illinois.edu/stacks/comp/process_radtags.php)), and before performing a reference alignment, I want make sure the sequences in each sample (roughly) correspond to the organism I expect them to be derived from, rather than potential contaminants (bacteria and/or fungi).

Does anyone have a straightforward, "canned" approach for doing this, either in R or a different environment? I believe the `blastn` algorithm can be used to query the sequences in these files against a database (like NCBI), and is usable on the command line. However, I've not used it before, and I'm not sure if it makes sense to query *all* the sequences in each file. Additionally, I don't know if the command can process this many files of this size (~600 MB per FASTQ file).

[This post](https://bioinformatics.stackexchange.com/questions/7473/testing-for-viral-bacterial-infection-fastq-files) from ~4 years ago asks a similar question for a pair of human blood samples, but is concerned with bacterial/viral DNA. The answer linking `kmerfinder` might have promise, but I'd appreciate any input from folks familiar with this issue.

(*Background*: I've gotten my Master's degree in Biology and have worked with NGS data for ~4 years now. I'm performing analyses on a 32-core Linux server. I'm less skilled in Python, but am willing to use it if there are no other options.)

**Tags:** ngs, filtering, bacteria, blastn, radseq
> **Comments:**
> **username_1**: Do you have a high quality reference genome of the plant you are working with?  
> **username_0**: Yes, I do. I've used the same reference genome in other projects, with similarly related taxa.  
> **username_2**: Thanks for the question, I'm familiar with working on RAD format and particularly don't know whether you've generated mixed genome RAD data. If know this information and I've time I'll put an answer down using either Bash or Python. I don't use R unless I've no other option. Please post a note below the question if you do edit it to notify me.  

---

## 1 answers

### Answer by username_0 on 2024-01-18. Score: 1

I ultimately addressed this issue using the [kraken2 software](https://github.com/DerrickWood/kraken2). I found this approach to rely on a good deal of my server's memory, but it was sufficient for doing a viral/bacterial classification of sequences.


---

