- 论坛徽章:
- 7
|
回复 10# RE_HASH
nide code, very youyisi. ( nage gee wo kan le 1 tian ~ )
3Q ~ youyisi ~
perltidy ~- #!/usr/bin/perl
- my ( $T, $R, $C );
- open C, "c.fasta";
- map { $T .= ( $_ > 5 ) ? "Y" : "N"; } <C>;
- close C;
- $T =~ s/(N+)/{ sprintf "(?:.{%d})", length $1 }/ge;
- $T =~ s/(Y+)/{ $C++; $R .= "\$C"; sprintf "(.{%d})", length $1 }/ge;
- sub CutFile {
- my ( $F, $T, $R ) = @_;
- open A, $F;
- local $_ = do { $/ = undef; <A> };
- close A;
- s/(?<=\S{40})\n//g;
- s/$T/qq(qq($R))/gee;
- s/(\S{50})/$1\n/g;
- return $_;
- }
- printf "d.fasta\n%s", CutFile( "a.fasta", $T, $R );
- print "\n\n";
- $T =~ s/(\d+)/{$1 * 3}/eg;
- printf "e.fasta\n%s", CutFile( "b.fasta", $T, $R );
复制代码 |
|