This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use 5.020; | |
use strict; | |
use warnings; | |
use Benchmark qw(:all); | |
my $seq = "ATCG" x 25e6; # 100Mb string | |
my $count = 10; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test::role; | |
use Moose::Role; | |
use Moose::Util::TypeConstraints; | |
subtype 'ModNum' | |
=> as 'Num' | |
=> where { /\_/ || /\d+/ }; | |
coerce 'ModNum', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
my ($def, $seq); | |
while (<>) { | |
if (/^DEFINITION\s+(\S+.*)$/) { | |
$def = $1; | |
} | |
if (/^ORIGIN/) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use File::Basename; | |
my $usage = "perl ".basename($0)." seqsi.fas seqsj.fas > seqs_out.fas"; | |
my $infilei = shift or die $usage; | |
my $infilej = shift or die $usage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fmtDetailValue_Dbxref : function(dbxref) { | |
if (typeof dbxref != 'string') { | |
return dbxref; | |
} | |
var dbid = dbxref.split(':'); | |
var prefix = ''; | |
switch (dbid[0]) { | |
case 'InterPro': | |
prefix = 'http://www.ebi.ac.uk/interpro/entry/'; | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fmtDetailValue_Ontology_term : function(goterm) { | |
if (typeof goterm != 'string') { | |
return goterm; | |
} | |
var dbid = goterm.split(':'); | |
var prefix = ''; | |
switch (dbid[0]) { | |
case 'GO': | |
prefix = 'http://amigo.geneontology.org/amigo/medial_search?q=GO:'; | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
module SequenceServer | |
# Module to contain methods for generating sequence retrieval links. | |
module Links | |
require 'erb' | |
include ERB::Util | |
alias_method :encode, :url_encode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ftplib import FTP | |
host = "ftp.ncbi.nlm.nih.gov" | |
wdir = "/genomes/refseq/" | |
ftp = FTP(host, 'anonymous', 'anonymous') | |
ftp.set_pasv(1) | |
list = ftp.nlst(wdir) | |
print len(list) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Net::FTP; | |
my $host = "ftp.ncbi.nlm.nih.gov"; | |
my $wdir = "/genomes/refseq/"; | |
my $ftp = Net::FTP->new($host, Passive => 1, Debug => 0) | |
or die "Cannot connect to $host: $@"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# always include these lines! (implicit in recent Perl versions) | |
use strict; # follow the rules | |
use warnings; # warning when we make a mistake | |
# import method to perform the request | |
use LWP::UserAgent; | |
# make the format an option perhaps | |
my $format = 'fasta'; | |
my $urlbase = 'http://www.uniprot.org/uniprot/'; |