2006-08-07から1日間の記事一覧

convert psl to gff

Bio::FlatFile.open(Bio::Blat::Report,f).each{|r| r.hits.each{|h| puts [ h.target.name , source , feature , h.target.start , h.target.end , "." , h.strand , ".", "Sequence " + h.query.name ].join("\t") } }

[bioruby] get DNA sequences described in a GFF file via DAS

class Bio::GFF::Record def to_segment start , stop = self.start.to_i , self.end.to_i start , stop = stop , start if start > stop return Bio::DAS::SEGMENT.region(self.seqname, start, stop) end end das = Bio::DAS.new('http://genome.ucsc.edu/…

parse GFF files

Bio::FlatFile.open(Bio::GFF,f).each{|gff| gff.records.each{|r| p r } }

parse BLAT results (psl file)

Bio::FlatFile.open(Bio::Blat::Report,f).each{|r| r.hits.each{|h| p h } }

parse FASTA formatted sequence file

Bio::FlatFile.open(Bio::FastaFormat,f).each{|e| p e }

[bioruby] Bio::FlatFile.open(Bio::EMBL,f).each{|e| p e.id_line p e.ft }