使用PERL将.gtf中的信息提取到新的文本文件
我有下面的.gtf文件,我只需要提取4个变量(染色体、起始/终止密码子和转录ID)使用PERL将.gtf中的信息提取到新的文本文件,perl,file-io,extract,bioinformatics,bioperl,Perl,File Io,Extract,Bioinformatics,Bioperl,我有下面的.gtf文件,我只需要提取4个变量(染色体、起始/终止密码子和转录ID) 1 Cufflinks transcript 11869 14412 1000 + . gene_id "CUFF.1"; transcript_id "CUFF.1.2"; FPKM "0.3750000000"; frac "0.000000"; conf_lo "0.375000"; conf_hi "0.375000"; cov "1.
1 Cufflinks transcript 11869 14412 1000 + . gene_id "CUFF.1"; transcript_id "CUFF.1.2"; FPKM "0.3750000000"; frac "0.000000"; conf_lo "0.375000"; conf_hi "0.375000"; cov "1.470346"; full_read_support "yes";
1 Cufflinks transcript 11869 14412 444 + . gene_id "CUFF.1"; transcript_id "CUFF.1.3"; FPKM "0.1666666667"; frac "0.000000"; conf_lo "0.166667"; conf_hi "0.166667"; cov "0.653487"; full_read_support "yes";
2 Cufflinks transcript 11869 14412 333 + . gene_id "CUFF.1"; transcript_id "CUFF.1.4"; FPKM "0.1250000000"; frac "0.000000"; conf_lo "0.125000"; conf_hi "0.125000"; cov "0.490115"; full_read_support "yes";**
我的问题是脚本如何知道如何处理选定的文件
您是否使用:
(1) my$file='transcripts\u selected.gtf'
(2) 此脚本还可用于提取分区数据:
say $data->{"chromosome_number"}->{"start_codon"}->{"stop_codon"}->{"transcript_id"};
或者应该:
BioSeq->new(-chromosome\u number,-start\u codon…)
使用什么方法
(3) 最后,本脚本取自BioPerHowto:
my $seq_in = Bio::SeqIO->new( -file => "<$infile", -format => $infileformat,);
my $seq_out = Bio::SeqIO->new( -file => ">$outfile", -format => $outfileformat,);
while (my $inseq = $seq_in->next_seq) {$seq_out->write_seq($inseq);
my$seq_in=Bio::SeqIO->new(-file=>“$outfile”,-format=>$outfileformat,);
而(my$inseq=$seq_-in->next_-seq){$seq_-out->write_-seq($inseq);
- 其中表示变量$infle/$outfile。是否应将.gtf文件的名称放在此处,并将带有选定数据的新文件的名称替换为$outfile
- 指定文件名的最简单方法是编写以下内容:
my $infile = shift;
my $outfile = shift;
在HOWTO的代码块上方,然后键入:
perl ScriptName transcripts_selected.gtf OutFileName
在命令行为什么不看一些perl初学者教程,以便在开始尝试了解BioPerl之前掌握编程的基本原则?@ialarmedalien也许她用perl编写任何东西的唯一原因是因为BioPerl。