一意のIDのリストを生成したい。一部の ID は重複しているため、末尾に番号を追加して一意にする必要があります。次のようにします。
ID=exon00001
ID=exon00002
ID=exon00003
ID=exon00004
これが私がこれまでに持っているものです。
while (loop through the IDs) {
# if $id is an exon, then increment the counter by one and add it
# to the end of the ID
if ($id =~ m/exon/) {
my $exon_count = 0;
my @exon = $exon_count++; #3
$number = pop @exon; # removes the first element of the list
$id = $id.$number;
print $id."/n"
}
}
基本的には、カウンターで配列を動的に生成したいと考えています。エクソンの総数の配列 (1、2、3、4、...) を作成し、要素を削除して文字列に追加することになっています。このコードは正しく動作しません。3行目に何か問題があると思います。知ってる?何か案は?ありがとうございました