[Bioperl-l] SeqIO; writing to custom out format?

Cook, Malcolm MEC at Stowers-Institute.org
Thu Feb 20 15:53:24 EST 2003


The 'clean way' to write seqs in format xxxx is to write a new Bio::SeqIO::xxxxx for your format.  FOr instance, I once did this to write a Bio::SeqIO::LaserGene to translate files coming from DNA*STAR into genbank format.

If you model your module on, say, what you find in, say, /usr/local/lib/perl5/site_perl/5.6.1/Bio/SeqIO/fasta.pm, and put it in, say, /home/me/Bio/SeqIO/xxxxx.pm you can then set PERL5LIB while developing so perl will find it; like this (if your shell is tcsh):

setenv PERL5LIB "/home/me/"

However, extending seqiuo may not be appropriate to your task - I could not say...



> -----Original Message-----
> From: Charles Hauser [mailto:chauser at duke.edu]
> Sent: Thursday, February 20, 2003 3:22 PM
> To: BioPerl-List
> Subject: [Bioperl-l] SeqIO; writing to custom out format?
> 
> 
> All,
> 
> I think there is a clean way using SeqIO to write to a custom format,
> but am missing it.
> 
> Parsing genbank files, I would like to write a modified fasta outfile
> which includes/or uses the gene name as the top line in lie of the
> default
> 	$name = format_name($feat->_tag_value('gene'));
>  to generate :
> 
> >'gene name'	'accession'
> seq	
> 
> 
> Or am I better off outputting a GFF file?
> 
> I am going to be using these to load a database(postgres).
> 
> regards,
> 
> Chuck
> 
> 
> my %outfile = ('Cr' => {
>                         'Fasta' => Bio::SeqIO->new('-file' => 
> '>Cr.fa',
>                                                    '-format' 
> => 'fasta')
>                        }
>                );
> 
> 
> FEATURES             Location/Qualifiers
>      source          1..5131
>                      /organism="Chlamydomonas reinhardtii"
>                      /strain="2137"
>                      /db_xref="taxon:3055"
>                      /dev_stage="vegetative"
>      gene            
> join(21..117,199..264,618..685,1031..1123,2513..2578,
>                      2892..3023,3355..3505,3906..4109,4383..4498)
>                      /gene="Pgp1"
>      CDS             
> join(21..117,199..264,618..685,1031..1123,2513..2578,
>                      2892..3023,3355..3505,3906..4109,4383..4498)
>                      /gene="Pgp1"
>                      /codon_start=1
>                      /product="phosphoglycolate phosphatase precursor"
>                      /protein_id="BAC56941.1"
> 
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
> 



More information about the Bioperl-l mailing list