Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to filter fasta files

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to filter fasta files related knowledge, the content is detailed and easy to understand, the operation is simple and fast, with a certain reference value, I believe you will have a harvest after reading this article on how to filter fasta files, let's take a look at it.

Fasta files have a fixed format, and if some sequences are malformed or appear some characters that should not appear (such as garbled codes), you need to filter out these sequences. The filtering method is relatively simple and can be done with a script to avoid repeated manual deletions.

Script run commands:

Perl fasta.filter.pl-in in.fasta-o out.fasta

Where:

Fasta.filter.pl: script name

-in: enter the option, followed by the name of the file

-o: output option followed by the name of the output file.

The script is as follows:

Use Bio::SeqIO;use Bio::Seq;use Getopt::Long;my% opts;GetOptions (\% opts, "in=s", "oaths", "h"); my$in = Bio::SeqIO- > new (- file = > "$opts {in}",-format = > 'Fasta'); my$out = Bio::SeqIO- > new (- file = > "> $opts {o}",-format = >' Fasta') While (my $seq = $in- > next_seq ()) {my ($id,$seqence,$desc) = ($seq- > id,$seq- > seq,$seq- > desc); next if ($seqence eq ""); next if ($seqence = ~ [^ ATCGNatcgn]); $out- > write_seq ($seq); $out- > close ();} $in- > close (); $out- > close (); this is the end of the article on "how to filter fasta files". Thank you for reading! I believe you all have a certain understanding of the knowledge of "how to filter fasta files". If you want to learn more, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report