Skip to content

Instantly share code, notes, and snippets.

Created September 22, 2011 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/661d14a4e61076542317 to your computer and use it in GitHub Desktop.
Save anonymous/661d14a4e61076542317 to your computer and use it in GitHub Desktop.
Arrows in both directions
#!/usr/bin/perl
use Bio::Graphics;
$panel = Bio::Graphics::Panel->new(
-length => $length,
-width => $width,
-pad_left => 10,
-pad_right => 10,
-key_style => 'between',
-start => $min,
-end => $max,
-spacing => 10,
);
my $track = $panel->add_track(
-glyph => 'transcript2',
-key => 'key',
-fgcolor => 'black',
-bgcolor => 'purple',
-connector => 'dashed',
-connector_color => '#666666',
-font2color => 'red',
-strand_arrow => 1,
-label => 1,
-bump => +1,
);
my @features = ();
$sth_edges = $dbh->prepare($sql_edges);
$sth_edges->execute();
my $this_strand = 0;
while (my($name,$strand,$start,$end) = $sth_edges->fetchrow_array()) {
my $feature = Bio::SeqFeature::Generic->new(
-display_name => $name,
-strand => $strand,
-start => $start,
-end => $end
);
push(@features,$feature);
}
my $feature2 = Bio::Graphics::Feature->new(
-segments=>[@features],
-display_name => 'ID: '.$pattern_id,
-type=>'gene');
$track->add_feature($feature2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment