#!/usr/local/bin/perl
# Test output behaviour of PreSeq.pm
#

## Should be invoked as "perl examples/seq_layout.pl"

BEGIN {
        print "1..1\n";
        use vars qw($INSTALL_PATH);


        #### NOTE: These variables need to be set to something
        ###         specific to your system. They need to point
        ###         to the directory right above Bio/ in order
        ###         for perl to be able to locate the .pm files. 

	$INSTALL_PATH = "/usr2/users/dag/bioperl/development";
        use lib qw(/usr2/users/dag/bioperl/development);

        ###
        ####

    }


use Bio::PreSeq;
use diagnostics; 
use strict;      
use Carp;        

print "BioPerl Sequence Object -- test code...\n";
print "\n Testing Seq.pm output formats\n ----------------------- \n\n";
print "Creating new object from sample.tfa...\n";

## Dummy name hash
my %names = (
'CloneID','DB1',
'Isolate','5',
'Tissue','Xenopus',
'Location','/usr2/users/dag/bioperl/sample.tfa'
);

my $name_ref = \%names;

### Note: Make sure that the file path specified below is correct for the
### .tfa sequence file.

my $myseq = new Bio::PreSeq(-file=>"$INSTALL_PATH/Bio/PreSeq/examples/sample.tfa",
                       -names=>$name_ref,
                       -type=>'Dna',
                       -numbering=>'1',
                       -desc=>'Sample Bio::Seq sequence',
                       -ffmt=>'Fasta');

my $saveseq = $myseq->getseq;

print "Dumping contents of object..\n";
print $myseq->dump();

print "\nTesting default GCG layout...\n\n";
print $myseq->layout("GCG");

print "\nAbout to call out_GCG() directly with named parameters...\n\n";
print $myseq->out_GCG(-id=>'New ID (doublespaced)',
                     -spacing=>'double',
                     -caps=>'up',
                     -date=>'DATE GOES HERE',
                     -header=>'This is a user submitted header',
                     -type=>'n');


print "\n\nTesting default Primer format:\n\n";
print $myseq->out_primer;

print "\n\nTesting GenBank format with named parameters:\n\n";
print $myseq->out_genbank(-def=>'This is a new definition',
                          -acc=>'xxx0000',
                          -caps=>'up'
                         );

print "\n\nTesting GenBank default layout format:\n\n";
print $myseq->layout("GenBank");

print "\n\nTesting PIR default layout format:\n\n";
print $myseq->layout("PIR");


print "\n\nTesting PIR format w/ named parameters:\n\n";
print $myseq->out_pir(-date=>'April 1 2020',
                      -reference=>'reference goes here',
                      -acc=>'some number goes here',
                      -entry=>'This is MY ENTRY',
                      -title=>'MY CLONE');



print "\n\nok 1\n";


