Extract a fasta sequence from multifasta file: samtools faidx multitest.fa and then samtools faidx multitest.fa fasta_id > out.fa #Samtools#Fasta#Extract#Multifasta
Extract sequence by using Ids file (assuming one ids in a line): perl -ne 'if(/^>(\S+)/){$c=$i{$1}}$c?print:chomp;$i{$_}=1 if @ARGV' ids.file fasta.file #PerlTricks#PerlOneliner#Perl#Extract#Ids #