Question: trimming nano pore reads based on quality score.
0
gravatar for KVC_bioinfo
21 months ago by
KVC_bioinfo400
Boston
KVC_bioinfo400 wrote:

Hello all,

I am trying to trim the nanopore sequences based on the quality of the reads. The Oxford nanopore technology mentions read below a quality score of 9 are considered to be the bad ones.

I have found This tool to do it. Has someone used it before? or is there any other way to do it?

trim nanopore • 2.2k views
ADD COMMENTlink modified 21 months ago by WouterDeCoster40k • written 21 months ago by KVC_bioinfo400

I have started using the tool I mentioned above:

python /path/to/NanoFilt.py /path/to/fastq/trim.fastq -q 9 > trim_qu.fastq

I constantly get:

usage: NanoFilt.py [-h] [-v] [-l LENGTH] [-q QUALITY] [--minGC MINGC]
                   [--maxGC MAXGC] [--headcrop HEADCROP] [--tailcrop TAILCROP]
                   [-s SUMMARY] [--readtype {1D,2D,1D2}]
ADD REPLYlink modified 21 months ago by genomax70k • written 21 months ago by KVC_bioinfo400
1

Try moving -q 9 before file name. Some programs are sensitive to order of input options.

ADD REPLYlink written 21 months ago by genomax70k

yes tried. gives same error

ADD REPLYlink written 21 months ago by KVC_bioinfo400
2

Can you try?

cat /path/to/fastq/trim.fastq | python /path/to/NanoFilt.py  -q 9 > trim_qu.fastq
ADD REPLYlink modified 21 months ago • written 21 months ago by genomax70k
4
gravatar for WouterDeCoster
21 months ago by
Belgium
WouterDeCoster40k wrote:

Hm I'm not sure if you mean trimming or filtering. What you are doing is filtering: removing reads below the quality cutoff. Trimming nucleotides from the read ends is also possible using NanoFilt.

Regarding the command you are trying to use I would suggest to have a look at the documentation on GitHub, Pypi, the blog post or use NanoFilt --help

I added examples on how to use NanoFilt to all of these. If you have suggestions on how to improve the documentation I would like to hear those, but right now it looks like you haven't read it.

Anyway, genomax is right, NanoFilt reads from stdin and writes to stdout. This makes it compatible with any compression type and allows you to sandwich it between for example decompression and an aligner. If installed correctly there is no need to add ".py" or the full path to the script.

I would suggest, if possible, to use a complimentary albacore summary file for filtering. That will speed up things significantly. Right now, calculating the average read quality is pretty slow, but I will look into this...

I don't think I agree that all reads with score below 9 are garbage. This definitely depends on your application.

ADD COMMENTlink modified 21 months ago • written 21 months ago by WouterDeCoster40k

Nanofilt works great for me. Thanks for the suggestion.

About the quality score of 9: I read that in the review paper of Nanopore sequencing.

ADD REPLYlink written 21 months ago by KVC_bioinfo400

@WouterDeCoster

when is the situation/application that reads with score < 9 should be kept? how to determine the threshold of quality filtering?

Thanks.

ADD REPLYlink written 13 months ago by elzedleeu20

@Wouter is on vacation. If you have a reliable reference you can align to then you can decide if you want to keep reads with average score below 9. If you don't have a reference you are better off leaving those reads where they belong .. in "failed" category.

ADD REPLYlink written 13 months ago by genomax70k

There are definitely different scenario's, for example:

  • de novo assembly: you don't want terrible reads
  • SNP identification: you don't want too many low quality bases
  • Structural variant detection: a low quality read spanning a breakpoint is fine
  • quantitative transcriptomics: if it maps it is fine
  • metagenomics identification: if it is sufficiently identical to a hit in the database it is probably fine
  • ...

Determining the threshold is harder - I don't think I can provide an answer.

ADD REPLYlink written 12 months ago by WouterDeCoster40k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 690 users visited in the last hour