fasta与fastq格式转换常用方式

fasta与fastq之间格式转换

一、awk命令

#1
awk '{if(NR%4 == 1){print ">" substr($0, 2)}}{if(NR%4 == 2){print}}' XXX.fastq > XXX.fasta
#2
awk 'NR%4==1||NR%4==2' selfSampleData/pacbio_filtered.fastq | sed 's/^@/>/g' > reads.fa

二、seqtk包

conda install seqtk
seqtk seq -A xxx.fastq > xxx.fasta

三、fasta_to_fastq.pl

wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/fasta-to-fastq/fasta_to_fastq.pl
perl fasta_to_fastq.pl xxx.fasta > xxx.fastq

 

posted @ 2022-08-31 09:19  pd_liu  阅读(1990)  评论(0编辑  收藏  举报