Skip to content

Instantly share code, notes, and snippets.

View cybersiddhu's full-sized avatar

Siddhartha Basu cybersiddhu

View GitHub Profile
## --- install plack
cpanm Plack
# -- save this file as jbrowse.plack
use Plack::App::Directory;
my $app = Plack::App::Directory->new({ root => '.'})->to_app;
$app;
## -- drop it at the top level of jbrowse folder
@cybersiddhu
cybersiddhu / myboardgame.pl
Created April 26, 2011 03:08 — forked from awwaiid/myboardgame.pl
Linux Format Perl Redone
#!/usr/bin/perl
use strict;
use Image::Magick;
# auxiliary variables
my $img_id = 0; #loop index
my @ordered_squares;
my $rotation = 180;
#Width and Height of each box, squares per side
@cybersiddhu
cybersiddhu / git_fix_author
Created July 2, 2011 18:02 — forked from leif81/git_fix_author
Written to change the unix name used for a cvs commit to a pretty git name for the user. Implementation borrowed from http://lists.freedesktop.org/archives/portland/2010-October.txt author-conv-file format (same format as git-cvsimport requires):
#!/bin/bash
export $authors_file=author-conv-file
git filter-branch -f --env-filter '
get_name () {
grep "^$1=" "$authors_file" |
sed "s/^.*=\(.*\) <.*>$/\1/"
}
@cybersiddhu
cybersiddhu / .locallibrc
Created July 26, 2011 17:48 — forked from plu/.locallibrc
let local::lib + .llrc and rvm + .rvmrc live together happily next to eachother (if you load this -after- the rvm stuff!)
if [ "$(type -t cd)" == "builtin" ]; then
local func="_perl_locallib_orig_cd() { builtin cd \"\$@\"; }"
else
local func="$(declare -f cd)"
local func="_perl_locallib_orig_cd${func#cd}"
fi
eval $func
_perl_locallib_custom_cd() {
local cwd=$(pwd)
@cybersiddhu
cybersiddhu / mapgeneid2prod.pl
Created March 12, 2012 18:16
generate a tab delimited file mapping dictyBase Gene ID to its gene product name
#!/usr/bin/perl -w
use strict;
use Pod::Usage;
use IO::File;
use Getopt::Long;
use Bio::Chado::Schema;
use YAML qw/LoadFile/;
use Log::Log4perl qw/:easy/;
use Log::Log4perl::Appender;
@cybersiddhu
cybersiddhu / rewrite_dicty_fasta_header.pl
Created March 12, 2012 18:16
Fasta header of dictyBase proteins in NCBI format
#!/usr/bin/perl -w
use strict;
use Pod::Usage;
use Getopt::Long;
use Bio::SeqIO;
use Bio::PrimarySeq;
use IO::File;
my $mapfile;
@cybersiddhu
cybersiddhu / pseudogene_issue.py
Created April 27, 2012 23:54 — forked from ypandit/pseudogene_issue.py
Solution for pseudogene issue in GFF3 for Artemis
import sys, os, string
if len(sys.argv) != 2:
print 'You seem to have forgotten to provide the input GFF3 file.'
exit()
if __name__ == "__main__":
found = False
with open(sys.argv[1], 'r') as file:
outfile = open(os.path.basename(sys.argv[1]).replace(".gff", "_corrected.gff"), 'w')
for line in file:
@cybersiddhu
cybersiddhu / jb-refseq-part1.pl
Created August 21, 2012 12:58
Prepare reference sequences for JBrowse part1
#!/usr/bin/env perl
use v5.10.1;
use strict;
use POSIX qw/floor/;
use autodie qw(:file);
use OptArgs;
use FindBin qw/$Bin/;
use Bio::DB::SeqFeature::Store;
use JSON;
@cybersiddhu
cybersiddhu / jb-refseq-part2.pl
Created August 21, 2012 15:33
Prepare reference sequences for JBrowse part2
# $seq_rel is the path relative to $outDir
my $seq_rel = "seq";
my $compress;
my $chunk_size = 20000;
my $opt = optargs;
if ( !-e $opt->{conf} ) {
die usage "JBrowse config file $opt->{conf} do not exist";
}
@cybersiddhu
cybersiddhu / GAFLoader.pm
Created October 27, 2012 16:35
A basic command line application for modware loader
package GAFLoader;
# Other modules:
use namespace::autoclean; #removes all sugar
use Moose; #uses Moose
with 'Modware::Role::Command::WithBCS'; #imports attributes to get an instance of Bio::Chado::Schema object
extends qw/MooseX::App::Cmd::Command/; #makes this being recognized as runnable command
#code that gets executed when you run the comamnd