[BioRuby] how to convert sequence to fasta format with header information?

Naohisa GOTO ngoto at gen-info.osaka-u.ac.jp
Tue Aug 4 12:03:31 UTC 2009


Hi,

It seems the document is wrong.

Bio::Sequence#to_fasta is deprecated, but Bio::Sequence::NA#to_fasta,
Bio::Sequence::AA#to_fasta, and Bio::Sequence::Generic#to_fasta
are NOT deprecated.

Currently, Bio::Sequence#output is defined, but no
Bio::Sequence::NA#output (and AA#output, Generic#output).

Naohisa Goto
ngoto at gen-info.osaka-u.ac.jp / ng at bioruby.org

On Thu, 30 Jul 2009 18:04:59 -0400
Diana Jaunzeikare <rozziite at gmail.com> wrote:

> Hi all,
> 
> I want to retrieve sequence from a pdb file and save it in fasta format
> where* header holds the pdb entry id*. This is how I did it:
> 
> file = File.new('1OOP.pdb').gets(nil)
> structure = Bio::PDB.new(file)
> seq = structure.seqres['A']
> puts seq.to_fasta("1OOP", 70)
> 
> it works and produces result i want:
> 
> #>1OOP
> #GPPGEVMGRAIARVADTIGSGPVNSESIPALTAAETGHTSQVVPSDTMQTRHVKNYHSRSESTVENFLCR
> #SACVFYTTYENHDSDGDNFAYWVINTRQVAQLRRKLEMFTYARFDLELTFVITSTQEQPTVRGQDAPVLT
> #HQIMYVPPGGPVPTKVNSYSWQTSTNPSVFWTEGSAPPRMSVPFIGIGNAYSMFYDGWARFDKQGTYGIS
> #TLNNMGTLYMRHVNDGGPGPIVSTVRIYFKPKHVKTWVPRPPRLCQYQKAGNVNFEPTGVTEGRTDITTM
> #KTT
> 
> However, according to documation Bio::Sequence::Common#to_fasta is a
> deprecated method and it suggests to use Bio::Sequence#output, but when I
> modify code to
> 
> puts seq.output(:fasta)
> 
> it gives error that method is not defined. Also I don't see a way how to
> define the header.
> 
> What should i use in place of the deprecated to_fasta method?
> 
> Thanks,
> 
> Diana
> _______________________________________________
> BioRuby mailing list
> BioRuby at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioruby





More information about the BioRuby mailing list