ensembl-hive  2.7.0
Bio::EnsEMBL::Utils::SeqDumper Class Reference

Public Member Functions

public Bio::EnsEMBL::Utils::SeqDumper new ()
 
public void enable_feature_type ()
 
public void attach_database ()
 
public Bio::EnsEMBL::DBSQL::DBAdaptor get_database ()
 
public Bio::EnsEMBL::DBSQL::DBAdaptor remove_database ()
 
public void disable_feature_type ()
 
public void is_enabled ()
 
public void dump ()
 
public void dump_embl ()
 
public void dump_genbank ()
 
protected void _dump_feature_table ()
 
public transcript_to_codon_start ()
 
protected Int _get_codon_table_id ()
 
public void dump_fasta ()
 
public String features2location ()
 
public String annotation_source ()
 
protected _date_string ()
 
public write ()
 
public write_genbank_seq ()
 
public write_genbank_seq ()
 
public write_embl_seq ()
 
public print ()
 

Detailed Description

Synopsis

# don't dump snps or repeats
$seq_dumper->disable_feature_type('repeat');
$seq_dumper->disable_feature_type('variation');
# dump EMBL format to STDOUT
$seq_dumper->dump( $slice, 'EMBL' );
# dump GENBANK format to a file
$seq_dumper->dump( $slice, 'GENBANK', 'out.genbank' );
# dump FASTA format to a file
$seq_dumper->dump( $slice, 'FASTA', 'out.fasta' );

Description

A relatively simple and lite-weight flat file dumper for Ensembl slices.
The memory efficiency could be improved and this is currently not very
good for dumping very large sequences such as whole chromosomes.

Definition at line 33 of file SeqDumper.pm.

Member Function Documentation

◆ _date_string()

protected Bio::EnsEMBL::Utils::SeqDumper::_date_string ( )

Undocumented method

Code:
click to view

◆ _dump_feature_table()

protected void Bio::EnsEMBL::Utils::SeqDumper::_dump_feature_table ( )
  Arg [1]    : Bio::EnsEMBL::Slice slice
  Example    :
none
  Description: Helper method used to dump feature tables used in EMBL, FASTA,
               GENBANK.  Assumes formating of file handle has been setup
               already to use $FEAT and $VALUE values.
  Returntype : none
  Exceptions : none
  Caller     : internal
 
Code:
click to view

◆ _get_codon_table_id()

protected Int Bio::EnsEMBL::Utils::SeqDumper::_get_codon_table_id ( )
  Arg [1]    : Bio::EnsEMBL::Slice slice
  Example    :
none
  Description: Helper method to get codon_table seq region attribute
               codon_table defines the genetic code table used if other than the universal genetic code table (1)
               By default it is 1 and is not shown in flat files.
               If it is not equal to 1, then it is shown as a transl_table qualifier on the CDS feature.
  Returntype : int
  Caller     : internal
 
Code:
click to view

◆ annotation_source()

public String Bio::EnsEMBL::Utils::SeqDumper::annotation_source ( )
  Arg [1]    : Bio::EnsEMBL::DBSQL::MetaContainer
  Example    :
$seq_dumper->annotation_source($meta_container);
  Description: Constructs a string with gene annotation sources
  Returntype : string
  Exceptions : none
  Caller     : dump_embl, dump_genbank
 
Code:
click to view

◆ attach_database()

public void Bio::EnsEMBL::Utils::SeqDumper::attach_database ( )
  Arg [1]    : string name
  Arg [2]    : Bio::EnsEMBL::DBSQL::DBAdaptor
  Example    :
$seq_dumper->attach_database('estgene', $estgene_db);
  Description: Attaches a database to the seqdumper that can be used to 
               dump data which is external to the ensembl core database.
               Currently this is necessary to dump est genes and vega genes
  Returntype : none
  Exceptions : thrown if incorrect argument is supplied
  Caller     : general
 
Code:
click to view

◆ disable_feature_type()

public void Bio::EnsEMBL::Utils::SeqDumper::disable_feature_type ( )
  Arg [1]    : string $type
  Example    :
$seq_dumper->disable_feature_type('genes');
  Description: Disables the dumping of a specific type of feature
  Returntype : none
  Exceptions : warn if an invalid feature type is passed,
               thrown if no feature type is passed
  Caller     : general
 
Code:
click to view

◆ dump()

public void Bio::EnsEMBL::Utils::SeqDumper::dump ( )
  Arg [1]    : Bio::EnsEMBL::Slice slice
               The slice to dump
  Arg [2]    : string $format
               The name of the format to dump
  Arg [3]    : (optional) $outfile
               The name of the file to dump to. If no file is specified STDOUT
               is used
  Arg [4]    : (optional) $seq
               Sequence to dump
  Arg [4]    : (optional) $no_append
               Default action is to open the file in append mode. This will
               turn that mode off
  Example    :
$seq_dumper->dump($slice, 'EMBL');
  Description: Dumps a region of a genome specified by the slice argument into
               an outfile of the format $format
  Returntype : none
  Exceptions : thrown if slice or format args are not supplied
  Caller     : general
 
Code:
click to view

◆ dump_embl()

public void Bio::EnsEMBL::Utils::SeqDumper::dump_embl ( )
  Arg [1]    : Bio::EnsEMBL::Slice
  Arg [2]    : IO::File $FH
  Arg [3]    : optional sequence string
  Example    :
$seq_dumper->dump_embl($slice, $FH);
  Description: Dumps an EMBL flat file to an open file handle
  Returntype : none
  Exceptions : if calls to get/set the filehandle position fail
  Caller     : dump
 
Code:
click to view

◆ dump_fasta()

public void Bio::EnsEMBL::Utils::SeqDumper::dump_fasta ( )
  Arg [1]    : Bio::EnsEMBL::Slice
  Arg [2]    : IO::File $FH
  Example    :
$seq_dumper->dump_fasta($slice, $FH);
  Description: Dumps an FASTA flat file to an open file handle
  Returntype : none
  Exceptions : none
  Caller     : dump
 
Code:
click to view

◆ dump_genbank()

public void Bio::EnsEMBL::Utils::SeqDumper::dump_genbank ( )
  Arg [1]    : Bio::EnsEMBL::Slice
  Arg [2]    : IO::File $FH
  Example    :
$seq_dumper->dump_genbank($slice, $FH);
  Description: Dumps a GENBANK flat file to an open file handle
  Returntype : none
  Exceptions : none
  Caller     : dump
 
Code:
click to view

◆ enable_feature_type()

public void Bio::EnsEMBL::Utils::SeqDumper::enable_feature_type ( )
  Arg [1]    : string $type
  Example    :
$seq_dumper->enable_feature_type('similarity');
  Description: Enables the dumping of a specific type of feature
  Returntype : none
  Exceptions : warn if invalid feature type is passed,
               thrown if no feature type is passed
  Caller     : general
 
Code:
click to view

◆ features2location()

public String Bio::EnsEMBL::Utils::SeqDumper::features2location ( )
  Arg [1]    : listref of Bio::EnsEMBL::SeqFeatures
  Example    :
$location = $self->features2location(\@features);
  Description: Constructs an EMBL location string from a list of features
  Returntype : string
  Exceptions : none
  Caller     : internal
 
Code:
click to view

◆ get_database()

public Bio::EnsEMBL::DBSQL::DBAdaptor Bio::EnsEMBL::Utils::SeqDumper::get_database ( )
  Arg [1]    : string $name
  Example    :
$db = $seq_dumper->get_database('vega');
  Description: Retrieves a database that has been attached to the 
               seqdumper via the attach database call.
  Returntype : Bio::EnsEMBL::DBSQL::DBAdaptor
  Exceptions : thrown if incorrect argument is supplied
  Caller     : dump_feature_table
 
Code:
click to view

◆ is_enabled()

public void Bio::EnsEMBL::Utils::SeqDumper::is_enabled ( )
  Arg [1]    : string $type 
  Example    :
do_something() if($seq_dumper->is_enabled('gene'));
  Description: checks if a specific feature type is enabled
  Returntype : none
  Exceptions : warning if invalid type is passed, 
               thrown if no type is passed 
  Caller     : general
 
Code:
click to view

◆ new()

public Bio::EnsEMBL::Utils::SeqDumper Bio::EnsEMBL::Utils::SeqDumper::new ( )
  Arg [1]    : none
  Example    :
  Description: Creates a new SeqDumper 
  Returntype : Bio::EnsEMBL::Utils::SeqDumper
  Exceptions : none
  Caller     : general
 
Code:
click to view

◆ print()

public Bio::EnsEMBL::Utils::SeqDumper::print ( )

Undocumented method

Code:
click to view

◆ remove_database()

public Bio::EnsEMBL::DBSQL::DBAdaptor Bio::EnsEMBL::Utils::SeqDumper::remove_database ( )
  Arg [1]    : string $name 
  Example    :
$db = $seq_dumper->remove_database('estgene');
  Description: Removes a database that has been attached to the seqdumper
               via the attach database call.  The database that is removed
               is returned (or undef if it did not exist).
  Returntype : Bio::EnsEMBL::DBSQL::DBAdaptor
  Exceptions : thrown if incorrect argument is supplied
  Caller     : general
 
Code:
click to view

◆ transcript_to_codon_start()

public Bio::EnsEMBL::Utils::SeqDumper::transcript_to_codon_start ( )

Undocumented method

Code:
click to view

◆ write()

public Bio::EnsEMBL::Utils::SeqDumper::write ( )

Undocumented method

Code:
click to view

◆ write_embl_seq()

public Bio::EnsEMBL::Utils::SeqDumper::write_embl_seq ( )

Undocumented method

Code:
click to view

◆ write_genbank_seq() [1/2]

public Bio::EnsEMBL::Utils::SeqDumper::write_genbank_seq ( )

Undocumented method

Code:
click to view

Undocumented method

Code:
click to view

◆ write_genbank_seq() [2/2]

public Bio::EnsEMBL::Utils::SeqDumper::write_genbank_seq ( )

The documentation for this class was generated from the following file:
Bio::EnsEMBL::Utils::SeqDumper::disable_feature_type
public void disable_feature_type()
Bio::EnsEMBL::Utils::SeqDumper::dump_embl
public void dump_embl()
Bio::EnsEMBL::Utils::SeqDumper::dump_genbank
public void dump_genbank()
Bio::EnsEMBL::Utils::SeqDumper
Definition: SeqDumper.pm:33
Bio::EnsEMBL::Utils::SeqDumper::dump
public void dump()
Bio::EnsEMBL::Utils::SeqDumper::_dump_feature_table
protected void _dump_feature_table()
Bio::EnsEMBL::Utils::SeqDumper::annotation_source
public String annotation_source()
Bio::EnsEMBL::Utils::SeqDumper::attach_database
public void attach_database()
Bio::EnsEMBL::Utils::SeqDumper::write_embl_seq
public write_embl_seq()
Bio::EnsEMBL::Utils::SeqDumper::get_database
public Bio::EnsEMBL::DBSQL::DBAdaptor get_database()
Bio::EnsEMBL::Utils::SeqDumper::write_genbank_seq
public write_genbank_seq()
Bio::EnsEMBL::Utils::SeqDumper::write
public write()
Bio::EnsEMBL::Utils::SeqDumper::_date_string
protected _date_string()
Bio::EnsEMBL::Utils::SeqDumper::is_enabled
public void is_enabled()
Bio::EnsEMBL::Utils::SeqDumper::features2location
public String features2location()
Bio::EnsEMBL::Utils::SeqDumper::dump_fasta
public void dump_fasta()
Bio::EnsEMBL::Utils::SeqDumper::enable_feature_type
public void enable_feature_type()
Bio::EnsEMBL::Utils::SeqDumper::transcript_to_codon_start
public transcript_to_codon_start()
Bio::EnsEMBL::Utils::SeqDumper::remove_database
public Bio::EnsEMBL::DBSQL::DBAdaptor remove_database()
Bio::EnsEMBL::Utils::SeqDumper::new
public Bio::EnsEMBL::Utils::SeqDumper new()
Bio::EnsEMBL::Utils::SeqDumper::print
public print()
Bio::EnsEMBL::Utils::SeqDumper::_get_codon_table_id
protected Int _get_codon_table_id()