Get the App
SLTechnology News&Howtos  ›  Development  › 

How does linux deal with fasta and fastq sequences

Shulou Source: shulou.com Published: 2022-06-02 01:06:08 11月15日 Update

This article mainly introduces the relevant knowledge of "how linux deals with fasta and fastq sequences". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "how linux deals with fasta and fastq sequences" can help you solve the problem.

(1) extract the 10th to 20th sequences from one file an and save them to another file b:

Awk-v RS=' >''NR > 1 {iTunes +} I > = 10&&i/ {print > f} 'input.fasta

(3) convert fastq to fasta sequence.

Zcat input_file.fastq.gz | awk 'NR%4==1 {printf ">% s\ n", substr ($0Pol 2)} NR%4==2 {print}' > output_file.fa

(4) number of fastq statistics

Zcat reads.fq.gz | echo $((`wc-l` / 4))

(5) the number of fasta sequences

Grep-c "^ >" reads.fa

(6) the number of occurrences of a short sequence

> zgrep-c 'ATGATGATG' reads.fq.gz 398065 > zcat reads.fq.gz | awk' / ATGATGATG/ {nlines = nlines + 1} END {print nlines} '398065 that's all about how linux handles fasta and fastq sequences. Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

Tags: Sequence document processing knowledge industry different practical content practical actual quantity articles methods more cases times knowledge points articles information channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Huawei Shulou Technology Xiaomi MySQL