Skip to content

Instantly share code, notes, and snippets.

@sestaton
sestaton / testdefined.pl
Last active August 29, 2015 14:05
show the difference between defined and exists
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
my %hash = (
id => undef,
id2 => 2,
);
@sestaton
sestaton / transposome_install.sh
Last active October 31, 2015 00:31
install perlbrew, perl, cpanminus, and transposome on a system with a broken wget
#!/bin/bash
##NB: Follow these instructions for installing Transposome: http://sestaton.github.io/Transposome
## What follows is to help users on really old Linux systems with a broken wget and no admin privileges.
export PERLBREW_ROOT=$HOME/perl5/perlbrew
export PERLBREW_HOME=$HOME/.perlbrew
# install perlbrew and patchperl
echo "Downloading perlbrew..."
@sestaton
sestaton / biostars95834.pl
Last active November 13, 2015 17:37
biostars95834.pl - parse blasttable
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
while (<DATA>) {
chomp;
my ($query, $subject, $percent_identity, $alignment_length, $mistmatches,
$gap_openings, $q_start, $q_end, $s_start, $s_end, $e_value, $bit_score) = split /\t/;
@sestaton
sestaton / build_ecolopy.sh
Last active August 29, 2015 13:57
build deps for GMPY2 and install Ecolopy
#!/bin/bash
## Location for local build of gmpy2 and deps
cd apps
mkdir gmpy2 && cd gmpy2
## Download and compile gmp
wget https://ftp.gnu.org/gnu/gmp/gmp-5.1.3.tar.bz2 && tar xjf gmp-5.1.3.tar.bz2
cd gmp-5.1.3
./configure --prefix=/home/jmblab/statonse/apps/gmpy2
@sestaton
sestaton / biostars85929.pl
Last active December 27, 2015 19:18
biostars85929.pl - convert fastq to fasta
#!/usr/bin/env perl
use strict;
use warnings;
use Bio::Factory::EMBOSS;
my $usage = "perl $0 in.fq out.fa";
my $infile = shift or die $usage;
my $outfile = shift or die $usage;
@sestaton
sestaton / biostars84811.pl
Last active December 26, 2015 19:18
biostars84811.pl - get pubmed abstract
#!/usr/bin/env perl
use 5.010;
use utf8;
use strict;
use warnings;
use Bio::DB::EUtilities;
use XML::LibXML;
my @ids = (23298400);