Question: How to slice or trim DNA sequence when it encounters NNNN or letters that represent ambiguity in the sequence?
0
gravatar for allyson1115ar
2.4 years ago by
allyson1115ar20 wrote:

How can I slice DNA sequence whenever NNN occurs and also letters that represent ambiguity? is there any available software tools I can use to do so?

For example:

'>chr1:0-45

ATCGCTAGCTAGCTRCGAGCGTAGCNNNNNNCGATCGATCGATCAG

into

'>chr1:0-13

ATCGCTAGCTAGCT

'>chr1:15-24

CGAGCGTAGC

'>chr1:31-45

CGATCGATCGATCAG

ADD COMMENTlink modified 19 months ago by Biostar ♦♦ 20 • written 2.4 years ago by allyson1115ar20
3
gravatar for Eric Lim
2.4 years ago by
Eric Lim1.3k
Boston
Eric Lim1.3k wrote:

I don't know if there's any tool, I would write a very simple script to accomplish it. In Python, one can do

[(m.start(0), m.end(0)-1) for m in re.finditer('[ACTG]+', seq)]

where seq = 'ATCGCTAGCTAGCTRCGAGCGTAGCNNNNNNCGATCGATCGATCAG'

ADD COMMENTlink written 2.4 years ago by Eric Lim1.3k

This is indeed very helpful. Thanks.

ADD REPLYlink written 2.4 years ago by allyson1115ar20

You're welcome. I hope it puts you in the right direction. Feel back to ask if you need additional help.

ADD REPLYlink written 2.4 years ago by Eric Lim1.3k
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: 889 users visited in the last hour