This is indeed very helpful. Thanks.
• 0 views
•
link
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
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'
Log in to answer this question.