Question: Custom trimming of "staggered" adapter sequences
0
gravatar for joycewang83
3.9 years ago by
Canada
joycewang830 wrote:

Hello!

I have a question pertaining to the trimming of custom/staggered adapter sequence in a FASTQ file.

I have a library with 4 different adapter lengths on the 5' side; this was done to increase library diversity during sequencing. However now I want to trim off the adapter and I can't do it by length!

Here's the 4 potential adapter sequence:

AATGATACGGCGACCACCGAGATCTACACTCTTTCCCTACACGACGCTCTTCCGATCTCGGGGACTTATCAGCCAACC

AATGATACGGCGACCACCGAGATCTACACTCTTTCCCTACACGACGCTCTTCCGATCTNCGGGGACTTATCAGCCAACC

AATGATACGGCGACCACCGAGATCTACACTCTTTCCCTACACGACGCTCTTCCGATCTNNCGGGGACTTATCAGCCAACC

AATGATACGGCGACCACCGAGATCTACACTCTTTCCCTACACGACGCTCTTCCGATCTNNNCGGGGACTTATCAGCCAACC

And now I would like to trim off all “CGGGGACTTATCAGCCAACC” (and everything upstream!) from my reads - does anyone know how I can do it? 

Thanks a lot for any help! Please let me know if further information is needed.

Joyce

trimming • 1.6k views
ADD COMMENTlink modified 3.8 years ago by Biostar ♦♦ 20 • written 3.9 years ago by joycewang830

Looks like a job for perl regex. 

ADD REPLYlink written 3.9 years ago by karl.stamm3.5k

Thanks Karl. I have close to zero knowledge in programming, maybe a little bit in Python. Was hoping to be able to use some established programs such as Trimmomatic. I will keep looking around. Thanks! -joyce

ADD REPLYlink written 3.9 years ago by joycewang830

I dont know enough perl to give you the answer. I suppose someone else will. But sometimes you have to do some programming to solve problems!  Perl has a really easy string-search routine in the "regex" that can find your index and cut at the appropriate place. You could do it in Python if you'd like, or any kind of programming language. 

ADD REPLYlink written 3.9 years ago by karl.stamm3.5k

Thanks Karl! I am in the process of learning Python - programming is absolutely crucial indeed!

ADD REPLYlink written 3.9 years ago by joycewang830
1
gravatar for Phil S.
3.9 years ago by
Phil S.660
Stuttgart, Germany
Phil S.660 wrote:

As it appears to me your adapters always build the last 21 bases in your reads. Therefore tools like cutadapt or bbduk from the BBMap package should do the job without a problem. I don't know about trimmomatic since i haven't used it that regularly...

ADD COMMENTlink written 3.9 years ago by Phil S.660

OK thanks Phil. I have heard about cutadatpt - will check it out! 

ADD REPLYlink written 3.9 years ago by joycewang830

it worked - thanks!!!

ADD REPLYlink modified 3.9 years ago • written 3.9 years ago by joycewang830

np mate, you are welcome. You maybe want to accept my previous comment as an answer since it solved your problem.

Best,

 

Phil

ADD REPLYlink written 3.9 years ago by Phil S.660
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: 564 users visited in the last hour