1 / 6

while(<FILE>){ if($_ =~ /^A/){ print $_; } if($_ =~ /t..e/){ print $_; }

while(&lt;FILE&gt;){ if($_ =~ /^A/){ print $_; } if($_ =~ /t..e/){ print $_; } if($_ =~ /[st].....[a-z][a-z]/){ print $_; } if($_ =~ /[acgt]/){ print $_; } }. #!/usr/bin/perl $seq = “aaaatttt”; $seq =~ s/a/T/g; print “$seq<br>”; $seq =~ s/t/A/g; print “$seq<br>”;. 配列変数.

alva
Download Presentation

while(&lt;FILE&gt;){ if($_ =~ /^A/){ print $_; } if($_ =~ /t..e/){ print $_; }

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. while(<FILE>){ if($_ =~ /^A/){ print $_; } if($_ =~ /t..e/){ print $_; } if($_ =~ /[st].....[a-z][a-z]/){ print $_; } if($_ =~ /[acgt]/){ print $_; } }

  2. #!/usr/bin/perl $seq = “aaaatttt”; $seq =~ s/a/T/g; print “$seq\n”; $seq =~ s/t/A/g; print “$seq\n”;

  3. 配列変数 $name1 = “Thomas”; $name2 = “John”; $name3 = “Angela”; $name4 = “Joanna”; @name = ( “Thomas”, “John”, “Angela”, “Joanna”); print $name[1]; for($i = 0;$i <= 3;$i ++){ print “$name[$i] “; } foreach $person (@name){ print “$person “; }

  4. ハッシュ キー → 値 $english{ “Ringo” } = “Apple”; $english{ “Budo” } = “Grape”; $english{ “Ichigo” } = “Strawberry”; print $english{ “Budo” }; $ハッシュ名{ “キー” } = 値; %english = (“Ringo” => “Apple”, “Budo” => “Grape”, “Ichigo” => “Strawberry”);

  5. 関数 sub print_author { print “*****************************************\n”; print “ This work was done by Yukichi Fukuzawa\n”; print “*****************************************\n”; print “ Last update: 2003/10/5\n”; } &print_author; &print_author; 関数の定義 sub 関数名{ 処理 } &関数名

  6. 関数 sub print_author { my $author_name = $_[0]; print “*****************************************\n”; print “ This work was done by “, $author_name, “\n”; print “*****************************************\n”; print “ Last update: 2003/10/5\n”; } &print_author(“Yukichi Fukuzawa”); # 関数中で$_[0]に入る &print_author(“Shigenobu Okuma”); # 関数中で$_[0]に入る 関数の定義 sub 関数名{ 処理 } &関数名

More Related