marcelm / cutadapt

Cutadapt removes adapter sequences from sequencing reads
https://cutadapt.readthedocs.io
MIT License
513 stars 129 forks source link

Adapter matches in the middle of a read masked with N #787

Open hmutpw opened 4 months ago

hmutpw commented 4 months ago

By default, the cutadapt removes the rest (after the adapter) of the sequences. If my sequences like: ADAPTERmysequenceoneADAPTERmysequencetwoADAPTER I will get mysequenceone in the output file by default. When using -r, I will get mysequencetwo in the output. However, I want to simultaneously keep mysequenceone and mysequencetwo in the output file, so I thought I could use --action mask to task the ADAPTERs with N first, then split this read into two pieces. However, the output looks like the following: NNNNNNNmysequenceoneNNNNNNNNNNNNNNNNNNNNNNNNNNN In the future version of cutadapt. Can it label the adapter sequence alone?

marcelm commented 4 months ago

You would probably have to use the --info-file option and postprocess the generated file.

Ideally, would you want Cutadapt be able to split a read into two?

hmutpw commented 4 months ago

You would probably have to use the --info-file option and postprocess the generated file.

Ideally, would you want Cutadapt be able to split a read into two?

Yes, the --infor-file is helpful to me. If the Cutadapt can mask every base of adaptors in a read, I can split this read into two or three, or more sub-reads. If Cutadapt can split this multi-adaptor read into several pieces, that would be better. For long reads generated from the PacBio Revio platform, one sequenced read may be joined with multiple transcripts even after using separate tools from PacBio. if Cutadapt can split the joined read based on adaptor sequences, we can make full use of transcripts. But there is one thing to be noticed, different transcripts from the joined reads may from different gene loci and different strands.