Find motif and cut adjacent bases
1
0
Entering edit mode
2.0 years ago
PolDE • 0

Dear All,

how can I find a motif in a sequence and cut X number of adjacent bases ahead and X number after the motif.

As example (motif AAATTT; 10 adjacent bases ahead and after):

> cgtcgtcgtcgtagctgtaaatttacgatcgtagctagctagtcgat

to get the fasta:

tcgtagctgtaaatttacgatcgtag

Much appreciated, thank you.

motif adjacent regions • 854 views
ADD COMMENT
2
Entering edit mode
2.0 years ago
 echo "cgtcgtcgtcgtagctgtaaatttacgatcgtagctagctagtcgat" | grep -iEo '[atgc]{1,10}AAATTT[atgc]{1,10}' 
tcgtagctgtaaatttacgatcgtag
ADD COMMENT
0
Entering edit mode

thanks! and if I have a fasta file with multiple sequences as input?

ADD REPLY
1
Entering edit mode

linearize https://gist.github.com/lindenb/2c0d4e11fd8a96d4c345 and loop over each NAME/SEQ

ADD REPLY
0
Entering edit mode

loop over? how can I run the command on a file input with 10000 fasta sequences?

ADD REPLY

Login before adding your answer.

Traffic: 1571 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6