Skip to content

Instantly share code, notes, and snippets.

View dbolser's full-sized avatar
💭
Reversing the polarity

Dan B dbolser

💭
Reversing the polarity
View GitHub Profile
package Chimera;
use Moose;
use Bio::Location::Simple;
use Bio::Coordinate::Pair;
use Bio::Coordinate::Collection;
has 'chimera' =>
@dbolser
dbolser / gist:907984
Created April 7, 2011 15:18
bp_seq_load.pl
#!/usr/bin/perl -w
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
if 0; # not running under some shell
use strict;
use Getopt::Long;
use Bio::DB::SeqFeature::Store;
#!/usr/bin/perl -w
use strict;
use Bio::DB::SeqFeature::Store;
my $db = Bio::DB::SeqFeature::Store->
new( -adaptor => 'DBI::mysql',
-dsn => 'dbolser_004:mysql.compbio.dundee.ac.uk',
-user => 'dbolser',
@dbolser
dbolser / gist:917298
Created April 13, 2011 10:02
BioPerl was broked
diff --git a/Bio/SeqIO.pm b/Bio/SeqIO.pm
index 5d1722c..d3e6d90 100644
--- a/Bio/SeqIO.pm
+++ b/Bio/SeqIO.pm
@@ -370,7 +370,7 @@ sub new {
$class->throw("fh argument provided, but with an undefined v
if exists $param{'-fh'};
$class->throw("string argument provided, but with an undefin
- if exists($param{'-string'};
+ if exists $param{'-string'};
@dbolser
dbolser / gist:921515
Created April 15, 2011 10:57
a simple BioPerl script
#!/usr/bin/perl -w
use strict;
use Bio::DB::SeqFeature::Store;
my $db = Bio::DB::SeqFeature::Store->
new( -adaptor => 'DBI::mysql',
-dsn => 'my_database:mysql.mysql.host.here.ac.uk',
-user => 'me',
-pass => 'secret',
@dbolser
dbolser / gist:921519
Created April 15, 2011 10:59
my attempt at SeqFeature.t
# -*-Perl-*- Test Harness script for Bioperl
# $Id$
## I'm confused about the tests here, so for the sake of simplicity
## I'm going to start from scratch. Basically I just want to write a
## few tests to show up some specific bugs. Of course the right thing
## to do is to create another test file, but I don't know how to get
## SeqFeature_mysql.t to point at it (that file is automatically
## generated at build time).
# This is the global configuration for gbrowse
# It contains setting common to all data sources as well
# as the various constants formerly scattered amongst scripts and libraries
[GENERAL]
# overridden by environment variable GBROWSE_CONF
config_base = /homes/www-potato/httpd/conf/gbrowse2
htdocs_base = /homes/www-potato/httpd/htdocs/potato/gbrowse2
url_base = /potato/gbrowse2
db_base = /homes/www-potato/httpd/htdocs/potato/gbrowse2/databases
| Biodatabase_netuser_openid |
| Biodatabaseaccount_credentials |
| Biodatabaseaccount_requests |
| Biodatabaseipblocks_old |
| Biodatabaserelated_links |
| Biodatabaseuser_openid |
| Biodatabaseuser_sidebars |
mysql> select page_touched, count(*) from mb_page group by page_touched limit 20;
+----------------+----------+
| page_touched | count(*) |
+----------------+----------+
| 2.01107052046E | 606 |
| 2.01107052047E | 1179 |
| 2.01107052048E | 1116 |
| 2.01107052049E | 1255 |
| 2.01107052092E | 2 |
| 2.01107052094E | 1 |
mysql> show create table mb_page\G
*************************** 1. row ***************************
Table: mb_page
Create Table: CREATE TABLE `mb_page` (
`page_id` int(8) unsigned NOT NULL auto_increment,
`page_namespace` int(11) NOT NULL default '0',
`page_title` varchar(255) character set utf8 collate utf8_bin NOT NULL default '',
`page_restrictions` tinyblob NOT NULL,
`page_counter` bigint(20) unsigned NOT NULL default '0',
`page_is_redirect` tinyint(1) unsigned NOT NULL default '0',