I have a library I would like to split them based on their headers. Some are related to RNA and DNA.
The header contains much information, but the most important the presence of DNA or RNA/LTR.., these partial words could be in between or at the beginning.
The point is the knowledge of how to extract sequences from a partial header occur in between the ID
My question is how to use grep or awk to grep the header that has one of these words along with sequences? Note that The sequences are more than one line.
Or perhaps grep the specific word and ignore what before and after?
>Tigger16a#DNA/TcMar-Tigger DF0000028 TcMar-Tigger **DNA** transposon
>rnd-4_family-38#SINE/MIR ( Recon Family Size = 20, Final Multiple Alignmen
>rnd-6_family-31751#LTR/Gypsy ( Recon Family Size = 26, Final Multiple Alignment Size = 22 )
>RNA2558#LTR/ERVL
>NonDNA1#LINE/I-Jockey
>DNA5#DNA/TcMar-Tc1
I have tried to create a list of the Required IDs using grep creating the list and extracting the sequences but for some reasons, the output has more sequences than those specified in the DNAID.txt list.
grep -A1000 -w -f DNAID.txt.fa MyLibrary > DNA_Sequence.fa