[Bioperl-l] Write a fasta file with custom title line.

Chris Fields cjfields at uiuc.edu
Thu Aug 31 13:56:18 EDT 2006


I think you can do it by changing the preferred ID type to 'display ID' for
the SeqIO object, then changing the display ID to whatever you want:

use Bio::SeqIO;

my $seqin = Bio::SeqIO->new(-file     => shift,
                            -format => 'genbank',);

my $seqout = Bio::SeqIO->new(-fh => \*STDOUT,
                            -format => 'fasta');


my $ct = 1;

while (my $seq = $seqin->next_seq) {

This version appends the sequence description:

>foo1 5'UTR in Aspergillus niger icdA mRNA for NADP-dependent isocitrate
dehydrogenase precursor, complete cds.
>foo2 5'UTR in Fission yeast mRNA for cytochrome c oxidase subunit IV,
complete cds.

I personally think it would be better to add a 'custom' option so you could
add whatever you wanted without the description added in.  What did you have
in mind here?


> -----Original Message-----
> From: bioperl-l-bounces at lists.open-bio.org [mailto:bioperl-l-
> bounces at lists.open-bio.org] On Behalf Of Staffa, Nick (NIH/NIEHS) [C]
> Sent: Thursday, August 31, 2006 11:57 AM
> To: bioperl-l
> Subject: [Bioperl-l] Write a fasta file with custom title line.
> I would like to construct  title lines for the fasta sequences I want to
> right to a file.
> I don't see in the documentation on-line for SeqIO or write_seq how to
> specify this.
> Please point the way.
> Nick Staffa
> Telephone: 919-316-4569  (NIEHS: 6-4569)
> Scientific Computing Support Group
> NIEHS Information Technology Support Services Contract
> (Science Task Monitor: Jack L. Field( field1 at niehs.nih.gov )
> National Institute of Environmental Health Sciences
> National Institutes of Health
> Research Triangle Park, North Carolina
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l

More information about the Bioperl-l mailing list