Entering edit mode
4.5 years ago
MG_19
•
0
Hi,
I have a multifasta file from which I want to extract sequence based on id and position of sequence in specific range. Please suggest some tool or program that can be useful. My seq file is:
>seq1
ATGGAGAGCCTTGTCCCTGGTTTCAACGAGAAAACACACGTCC
>seq2
AACTCAGTTTGCCTGTTTTACAGGTTCGCGACGTGCTCGTACGTGGCT
>seq3
TTGGAGACTCCGTGGAGGAGGTCTTATCAGAGGCACGTCAACATCTTAAAGATGGCACTTGTGGCTTAG
My id file is:
seq1 5 15
seq2 2 10
seq3 10 20
Use
seqtk
(LINK).You can use the following code:
To use this code you first need to delete empty lines from your sequence file:
if you don't want to modify the original file, try:
If each of your sequences is one line, you can use this code too:
If you want to add start and stop to the header, you can use this echo instead of
echo ">"$id
:The output:
; done
was missing from two of my commands. I added them.You have tagged
R
, but are asking for any tools. Can you clarify your requirements?