- 论坛徽章:
- 5
|
- #!/usr/bin/perl
- open ONE, '>', '1.txt';
- while (<DATA>) {
- print;
- my $atgc = <DATA>;
- my $length_all = length($atgc) - 1;
- my ( $begin, $end ) = $atgc =~ /^([agtc]*).*?([atgc]*)$/;
- my @I = $atgc =~ /(?:[ATGC])([atgc]+)(?:[ATGC])/g;
- @I = '' unless @I;
- $atgc =~ tr/atgc/ATGC/;
- my $i = 1;
- for (@I) {
- tr/atgc/ATGC/;
- printf "I%03i%s\n", $i, $_;
- printf "S%03i%s", $i++, $atgc;
- }
- print ONE join "\t", length $begin, $length_all, length $end;
- print ONE "\n";
- }
- __DATA__
- RpsA
- tagctacgttGTTAACCGTTGCGTGAAAACAGGatcgatctcgtgccg
- RpsA
- acaccgcaACCAAACTATCAAgtaacgttacagCATTCCGTAGgtaggttccattt
- Rps3
- cgggcgcgtcCGGATTGAGCTGTacgtgtaattgcTTTACGCCTTGCCACCCaaagggccatttcgcaGCGGTCCAGGCatcccgcctt
复制代码 回复 1# zhagnqiang829
|
|