我是 Perl 的新手。我正在尝试从一个与另一个文件中的行匹配的文件中提取 fasta 序列。两个示例文件如下:
文件1.fasta:
>gene_44|105_nt|+|47540|47644 GTGCGCCGGCGCGTCGCGATCGCGAACCGGCCCGTGCGAATCCTGCCGCATGCGCGCCGCATCTCGCCACGCCGCGCATTTCATTTCGACATCCATAACGTCTGA
>gene_69|111_nt|+|75846|75956 ATGCCGTTGCCGTCGCGCATCGCGGCGGCCGTGCGCGGCGCGCATGCATACGCCGGCACGGCCGATGCGCGCGCGACGCGCAAACTGCACGCGGCGCGGGATTTGTGTTGA
>gene_88|177_nt|-|97993|98169
ATGCGCCAGCCGACGCACGCCCATTCCGGGCGAAACGTTCCCCTTATCCATTCGATCATCCGTGCCGCACTGCGCGAAGCGGCCACCGCCGACACGTACCAAACCGCGCTCGATGCGACCGGCGCGGCACTCGTCGCCATCGCGGCGCTCGTGCGCGCGGAGGTGCGGCATGGCTGA>gene_90|141_nt|-|99016|99156
TTGGAAGGGCGCTTTCCGCGTGCGAGTCGTCTGACGCAGCGTTGCACGGTCTGGTCGAATCGCGAGCTTCATCGCTGGATGGCCGATCCGTTGAACTATCGCGCTGTCGACGCGGCGAACCAGACGACGGAGGGCGCGTAA
文件2.列表:
somewordsinfront, >gene_44|somewordsattheback
blablabla,>gene_88|blablablablabla
我期望的输出如下:
>gene_44|105_nt|+|47540|47644 GTGCGCCGGCGCGTCGCGATCGCGAACCGGCCCGTGCGAATCCTGCCGCATGCGCGCCGCATCTCGCCACGCCGCGCATTTCATTTCGACATCCATAACGTCTGA
>gene_88|177_nt|-|97993|98169
ATGCGCCAGCCGACGCACGCCCATTCCGGGCGAAACGTTCCCCTTATCCATTCGATCATCCGTGCCGCACTGCGCGAAGCGGCCACCGCCGACACGTACCAAACCGCGCTCGATGCGACCGGCGCGGCACTCGTCGCCATCGCGGCGCTCGTGCGCGCGGAGGTGCGGCATGGCTGA
我怎样才能做到这一点?提前致谢!:)