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

Jason Stajich jason at cgt.mc.duke.edu
Thu Feb 20 20:43:30 EST 2003


You just need to set the
$seq->display_id($gene_name);
and
$seq->description($acc);
to the accession.

No need write a custom writer -
so it would work like
while( my $seq = $parser->next_parser ) {
 my ($gene,$accession) =~ /mycustomregexhere/;

 $seq->display_id($gene);
 $seq->description($accession);
}

On Thu, 20 Feb 2003, Charles Hauser wrote:

> 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
>

--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu


More information about the Bioperl-l mailing list