This file contains hidden or 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 xml.etree import ElementTree as ET | |
| import re | |
| def strip_whitespace(my_string): | |
| """Removes spaces, tabs, and newline characters from a string. | |
| \s matches any whitespace character, this is equivalent to the class [\t\n\r\f\v].""" | |
| return re.sub("\s", "", my_string) | |
| my_xml = """ | |
| <root> |
This file contains hidden or 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 python | |
| # Run with no args for usage instructions | |
| # | |
| # Notes: | |
| # - will probably insert duplicate records if you load the same file twice | |
| # - assumes that the number of fields in the header row is the same | |
| # as the number of columns in the rest of the file and in the database | |
| # - assumes the column order is the same in the file and in the database | |
| # |
This file contains hidden or 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
| if (!function_exists('mysql_search')) { | |
| function mysql_search($table, $columns, $query = '', $options = Array()) { | |
| if (empty($query)) { return Array(); } | |
| $sql_query = Array(); | |
| $options['columns'] = isset($options['columns'])?$options['columns']:'*'; | |
| $options['method'] = isset($options['method'])?$options['method']:'OR'; |
This file contains hidden or 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
| if (!function_exists('mysql_search')) { | |
| function mysql_search($table, $columns, $query = '', $options = Array()) { | |
| if (empty($query)) { return Array(); } | |
| $sql_query = Array(); | |
| $options['columns'] = isset($options['columns'])?$options['columns']:'*'; | |
| $options['method'] = isset($options['method'])?$options['method']:'OR'; |
This file contains hidden or 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
| if (!function_exists('mysql_dump')) { | |
| function mysql_dump($database) { | |
| $query = ''; | |
| $tables = @mysql_list_tables($database); | |
| while ($row = @mysql_fetch_row($tables)) { $table_list[] = $row[0]; } | |
| for ($i = 0; $i < @count($table_list); $i++) { |
This file contains hidden or 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 Bio.SeqRecord import SeqRecord | |
| from Bio.Seq import Seq | |
| from Bio import Entrez | |
| from Bio import SeqIO | |
| import time | |
| # Obtain your gene IDs from somewhere (file, past text directly, etc.) | |
| ids = [] | |
| ids = ",".join( lines ) |
This file contains hidden or 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/ruby | |
| # Read in a fast file and spit it out as tipdate | |
| ### IMPORTS | |
| require 'test/unit/assertions' | |
| require 'pp' | |
| require 'csv' | |
| require 'bio' | |
| include Test::Unit::Assertions |
This file contains hidden or 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 ruby | |
| # Draw a sequence logo in SVG. | |
| ### IMPORTS | |
| require 'test/unit/assertions' | |
| require 'optparse' | |
| require 'pp' | |
| require 'csv' | |
| require 'ostruct' |
This file contains hidden or 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
| public static void main(String[] args) { | |
| if (args.length != 1) { | |
| System.out.println("The program expects one parameter: \n" | |
| + "1. Protein accesion\n"); | |
| } else { | |
| String inputSt = args[0]; | |
| Bio4jManager manager = null; |
This file contains hidden or 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/perl | |
| use warnings; | |
| use strict; | |
| my $gwas_file=$ARGV[0]; | |
| my $hugenet_file=$ARGV[1]; | |
| my $num_args = $#ARGV + 1; |