Skip to content
Snippets Groups Projects
Commit b0d31954 authored by Michele Clamp's avatar Michele Clamp
Browse files

Added test_genes which just fetches genes from the database

Added overlap_test which tests VirtualContig and ContigOverlap
parent ea88f30f
No related branches found
No related tags found
No related merge requests found
......@@ -276,11 +276,8 @@ foreach my $clone_id ( @clones ) {
eval {
my $clone = $db->get_Clone($clone_id);
print(STDERR "ick\n");
my $as = $clone->virtualcontig;
print(STDERR "wor\n");
$as->skip_SeqFeature('similarity',1);
print(STDERR "pog\n");
# choose output mode
# test clone check call
......@@ -292,7 +289,7 @@ foreach my $clone_id ( @clones ) {
}
}
my $debug = 1;
my $debug = 0;
if($debug){
# debug tests
my $id=$clone->id;
......@@ -308,7 +305,7 @@ foreach my $clone_id ( @clones ) {
}
exit 0;
}
print(STDERR "Format is $format\n");
if( $format =~ /gff/ ) {
foreach my $contig ( $clone->get_all_Contigs ) {
my @seqfeatures = $contig->as_seqfeatures();
......
......@@ -5,7 +5,7 @@ use Bio::EnsEMBL::DB::VirtualContig;
my $db = new Bio::EnsEMBL::DBSQL::Obj(-host => 'obi-wan',
-port => 410000,
-dbname => 'ens500',
-dbname => 'ens500a',
-user => 'ensro',
);
......
#!/usr/local/bin/perl
use strict;
use Bio::EnsEMBL::DBLoader;
use Bio::EnsEMBL::DBSQL::Obj;
use Bio::EnsEMBL::AceDB::Obj;
use Getopt::Long;
use Time::Local;
my $dbtype1 = 'rdb';
my $host1 = 'obi-wan';
my $dbname1 = 'ens500';
my $dbuser1 = 'ensro';
my $dbpass1 = undef;
my $port1 = 3306;
my $infile = '';
$| = 1;
&GetOptions( 'dbtype1:s' => \$dbtype1,
'host1:s' => \$host1,
'port1:n' => \$port1,
'dbname1:s' => \$dbname1,
'dbpass1:s' => \$dbpass1,
'infile=s' => \$infile,
);
my ($db1) = get_db_handles();
my ($clone1) = get_cloneids($infile,@ARGV);
my $i = 0;
for ($i = 0; $i <= $#$clone1; $i++) {
print("Processing clone " . $clone1->[$i] . "\n");
eval {
my $cl1 = $db1->get_Clone($clone1->[$i]);
my @genes1 = $cl1->get_all_Genes();
my $count = 1;
foreach my $gene1 (@genes1) {
foreach my $exon ($gene1->each_unique_Exon) {
print("Exon " . $exon->id . "\t" .$exon->start . "\t" . $exon->end . "\t" . $exon->strand . "\n");
}
}
}
sub get_cloneids {
my ($infile,@ARGV) = @_;
my @clone1;
if (defined($infile)) {
open(IN,"<$infile");
while (<IN>) {
chomp;
push(@clone1,$_);
}
close(IN);
}
while ($#ARGV > 0) {
my $clone1 = shift @ARGV;
push(@clone1,$clone1);
}
return (\@clone1);
}
sub get_db_handles {
my ($db1);
if( $dbtype1 =~ 'ace' ) {
$db1 = Bio::EnsEMBL::AceDB::Obj->new( -host => $host1,
-port => $port1);
} elsif ( $dbtype1 =~ 'rdb' ) {
my $locator = "Bio::EnsEMBL::DBSQL::Obj/host=$host1;" .
"port=$port1;" .
"dbname=ensembl;" .
"user=$dbuser1;" .
"pass=$dbpass1";
$db1 = Bio::EnsEMBL::DBLoader->new($locator);
} else {
die("$dbtype1 is not a good type (should be ace or rdb)");
}
return ($db1);
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment