thanks! and if I have a fasta file with multiple sequences as input?
• 0 views
•
link
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.
echo "cgtcgtcgtcgtagctgtaaatttacgatcgtagctagctagtcgat" | grep -iEo '[atgc]{1,10}AAATTT[atgc]{1,10}'
tcgtagctgtaaatttacgatcgtag
thanks! and if I have a fasta file with multiple sequences as input?
linearize https://gist.github.com/lindenb/2c0d4e11fd8a96d4c345 and loop over each NAME/SEQ
loop over? how can I run the command on a file input with 10000 fasta sequences?
Log in to answer this question.