Skip to content

Instantly share code, notes, and snippets.

@epaule
epaule / gist:822186
Created February 11, 2011 10:31
flip EST orientation
my $cDNA_span = shift;
my $chrom = shift;
my %est_orient;
$wormbase->FetchData("estorientation",\%est_orient) unless (5 < scalar keys %est_orient);
foreach my $EST ( keys %est_orient ) {
if ( exists $$cDNA_span{$EST} && defined $$cDNA_span{$EST}->[2]) {
my $GFF_strand = $$cDNA_span{$EST}->[2];
my $read_dir = $est_orient{$EST};
CASE:{
($GFF_strand eq "+" and $read_dir eq "5") && do {
@epaule
epaule / remove_strains.pl
Created March 4, 2011 11:27
File to remove strains from acefiles based on a blacklist keyset
#!/usr/bin/env perl
# removes strain objects from an ACE file based on a keyset of strains
# usage:
# remove_strains.pl -remove KEYSET_FILE -acefile STRAIN_ACE_FILE
use IO::File;
use Getopt::Long;
@epaule
epaule / ftp_comp.txt
Created March 4, 2011 15:56
one liner to compare two wormbase FTP releases
perl -e 'use File::Find;$to=shift();$from=$to-1;find(\&wa,shift());sub wa{$f=$File::Find::name;$f=~s/$from/$to/g;print "cannot find $f\n" unless -e $f}' 224 ~ftp/pub2/wormbase/WS223/
@epaule
epaule / s_child_shift
Created March 30, 2011 10:55
S_child shifter
perl -ane 'if ($F[3] eq "S_child"){$change=744;$F[12]-=$change;$F[15]-=$change};print join(" ",@F),"\n"'
@epaule
epaule / Sequence_collection.ace
Created April 8, 2011 15:49
prototype Sequence_collection
////////////////////////////////////////////////////////////////////
// Sequence_collection class
// describes an assembly
// holds information describing the sequences in this collection
////////////////////////////////////////////////////////////////////
?Sequence_collection Title ?Text
Origin Name Text // name that the author gave it
Other_name ?Text //If we like this over the DB_info option?
Species UNIQUE ?Species
@epaule
epaule / gist:927952
Created April 19, 2011 14:09
Ensembl module for Bio::EnsEMBL::Analysis::Runnable::RepeatMasker
# Ensembl module for Bio::EnsEMBL::Analysis::Runnable::RepeatMasker
#
# Copyright (c) 2004 Ensembl
#
=head1 NAME
Bio::EnsEMBL::Analysis::Runnable::RepeatMasker
=head1 SYNOPSIS
@epaule
epaule / cufflinks2hints.pl
Last active September 27, 2015 05:08
Cufflinks FTP to Agustus hints GFF conversion (exon|intron|ep)
#!/usr/bin/env perl
#
# convert cufflinks GTF into a Augustus hintfile
#
# seq source ep|exon|intron start stop score +/- phase grp=ID; src=E
my %transcripts;
while(<>){
next unless /Cufflinks\s+exon.*transcript_id/;
@epaule
epaule / add_tags.pl
Created June 22, 2012 15:00
strip out untouched CDS isoforms
#!/usr/bin/env perl
#
# add missing tags to curation databases
use Ace;
use strict;
my $db= Ace->connect(-path => shift()) ||die (Ace->error);
@epaule
epaule / acediff.pl
Created June 25, 2012 13:23
Ace format diff
#!/software/bin/perl -w
#
# acediff.pl : an improved acediff
#
# gw3
#
# Usage : acediff.pl [-options]
#
# Last edited by: $Author: gw3 $
# Last edited on: $Date: 2011-04-26 15:49:01 $
@epaule
epaule / acediff.pl
Created June 25, 2012 13:24
wrapper to automatically merge additional acedb databases into a reference one
#!/software/bin/perl -w
#
# acediff.pl : an improved acediff
#
# gw3
#
# Usage : acediff.pl [-options]
#
# Last edited by: $Author: gw3 $
# Last edited on: $Date: 2011-04-26 15:49:01 $