更改fasta序列每一行显示的碱基数目

Chentao Yang Lv4
一个Perl小程序
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/perl -w
use strict;
die "perl $0 <*.fa> <number of one line>" unless (@ARGV == 2) ;
my $genome=shift;
my $num = shift;
open (IN,$genome) or die $!;
$/=">";<IN>;$/="\n";
while (<IN>) {
chomp;
my $id = $_;
print ">$id\n";
$/=">";
my $seq=<IN>;
chomp $seq;
$seq =~ s/\n//g;
1 while $seq =~ s/(\w{$num})(\w+)$/$1\n$2/;
print "$seq\n";
$/="\n";
}
close IN;
  • Title: 更改fasta序列每一行显示的碱基数目
  • Author: Chentao Yang
  • Created at : 2017-04-14 16:44:23
  • Updated at : 2023-10-25 11:56:14
  • Link: https://comery.github.io/2017/04/15/Wapper-fasta/
  • License: This work is licensed under CC BY-NC-SA 4.0.
Comments
On this page
更改fasta序列每一行显示的碱基数目