This is a test version of Biostars. For the public version, visit https://www.biostars.org.
chop Nanopore (long) reads

Do you know if there are tools to chop reads from Nanopore sequencing at given positions?

sequencing alignment nanopore

If your question fits in one sentence then you probably didn't explain it sufficiently, please elaborate.

The question is fine, my response will be: "Yes"

Sorry for that, I want to chop Nanopore reads at given positions and each read was chopped at different positions.

I want to chop Nanopore reads at given positions and each read was chopped at different positions

It is not clear what you mean by this. You want to chop individual reads at certain positions (different for each read?) OR are the reads chopped at different length and you want to make them all the same length by chppoing?

Thank you for your reply. I want to chop individual read at certain positions (coordinates from alignments). For instance, read A 3-500, 800-901; read B 2-50; read C......

Before this goes back and forth now, please give a reprodubibly and illustrative example. Post an example input and a representative example output. It is still clear what exactly you aim to do.

Now, I try to convert fq to fa, then use bedtools to mask.

a representative example

I do not want to appear rude but you have now four experienced people in this thread involved who all could provide you with an answer or even a working script but you lack to provide a suitable example of how the input data look, how exactly you want to trim and what the expected output is. I for my part will therefore withdraw from this thread. For the future you should avoid annoying people with this attitude. A simple example of what you have, what you want (show data, not just words) and what you've tried will motivate people to give you good answers. Brief Reminder On How To Ask A Good Question

If you have specific intervals you want to chop from individual reads then you would likely need to write some custom code to do that.

Now, I try to convert fq to fa, then use bedtools to mask.

1 answer

Without further context I assume you want to trim (this is the correct term here) your reads to a fixed length. Also assuming you have them in fastq format do something like:

seqtk trimfq -L your_length in.fastq.gz > trimmed.fastq.gz

https://github.com/lh3/seqtk

Is there a specific reason you want to trim your data?

In Nanopore community, people also are using "chop". I don't trim reads to a fixed length but variable lengths and patterns.

Because my reads are chimeric, partially from host and partially from transposal elements.

Log in to answer this question.