Entering edit mode
3.5 years ago
Kumar
▴
170
Hi,
I have a file of fasta sequence and an another file list of its IDs. I am trying to extract sequences from the list of IDs. I tried the following commands but not getting any output. I would appreciate if I get any solutions.
Tried these commands:
$seqtk subseq test.fa test.txt
$grep -A 1 -wFf list.txt sequences.fas > newfile2.fas
$for i in $(cut -d" " -f1- file2); do grep -o "$i" file1 | tee -a result.txt; done
Example: File 1:
>SEGI_09259
>SEGI_10011
>SEGI_06629
File 2:
>SEGI_07257
MKICGWLYHFKFSKNMQGKVVLIIGL
>SEGI_10011
MNNCCFMVMRLGGSRSTGRGLKSSEAGE
>SEGI_06629
MGVGIVKSLAGFMLLLNFCMYMTVAGIAG
MAVGIVK
Output:
>SEGI_10011
MNNCCFMVMRLGGSRSTGRGLKSSEAGE
>SEGI_06629
MGVGIVKSLAGFMLLLNFCMYMTVAGIAG
MAVGIVK
Thank you very much for the information. It works for me.