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
| """Library to interface with the GEO (GDS- GEO DataSets) repository""" | |
| import os | |
| import re | |
| import sys | |
| import urllib | |
| import traceback | |
| from datetime import datetime | |
| import time | |
| import enchant |
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
| /* | |
| * A white-list based PAC without regexp, by @janlay | |
| * It's just simple and fast. | |
| * Last update: Dec 9, 2013 | |
| * Special thanks to @Paveo | |
| */ | |
| function FindProxyForURL(url, host) { | |
| var PROXY = "PROXY 127.0.0.1:8800;SOCKS 127.0.0.1:8801"; | |
| var DEFAULT = "DIRECT"; |
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
| first_denom = {1:1,2:5,3:10,4:25,5:50} | |
| def cc_rec(amount, kinds_of_coins = 5): | |
| if amount == 0: | |
| return 1 | |
| elif amount < 0 or kinds_of_coins == 0: | |
| return 0 | |
| else: | |
| return cc_rec(amount, kinds_of_coins - 1) + \ | |
| cc_rec(amount - first_denom[kinds_of_coins], kinds_of_coins) |
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
| def _macs2(workflow, conf): | |
| # merge all treatments into one | |
| merge_bams_treat = ShellCommand( | |
| "{tool} merge {output[merged]} {param[bams]}", | |
| tool="samtools", | |
| input=[target + ".bam" for target in conf.treatment_targets], | |
| output={"merged": conf.prefix + "_treatment.bam"}) | |
| merge_bams_treat.param = {"bams": " ".join(merge_bams_treat.input)} | |
| if len(conf.treatment_targets) > 1: |
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
| def _macs2(workflow, conf): | |
| # merge all treatments into one | |
| merge_bams_treat = ShellCommand( | |
| "{tool} merge {output[merged]} {param[bams]}", | |
| tool="samtools", | |
| input=[target + ".bam" for target in conf.treatment_targets], | |
| output={"merged": conf.prefix + "_treatment.bam"}) | |
| merge_bams_treat.param = {"bams": " ".join(merge_bams_treat.input)} | |
| if len(conf.treatment_targets) > 1: |
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
| def _bowtie(workflow, conf): | |
| for target in conf.sample_targets: | |
| bowtie = attach_back(workflow, | |
| ShellCommand( | |
| "{tool} -p {param[threads]} -S -m {param[max_align]} \ | |
| {param[genome_index]} {input[fastq]} {output[sam]} 2> {output[bowtie_summary]}", | |
| input={"genome_dir": os.path.dirname(conf.get_path("lib", "genome_index")), | |
| "fastq": target + ".fastq"}, | |
| output={"sam": target + ".sam", | |
| "bowtie_summary": target + "_bowtie_summary.txt", }, |
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
| CLASS1 = ["BMAL1-ZT10_rep1", "BMAL1-ZT10_rep2"] | |
| CLASS1_PATHS = ["/mnt/Storage/data/exam_data/BMAL1/BMAL1-ZT10_rep1.bam", "/mnt/Storage/data/exam_data/BMAL1/BMAL1-ZT10_rep2.bam"] | |
| CLASS2 = ["BMAL1-ZT22_rep1"] | |
| CLASS2_PATHS = ["/mnt/Storage/data/exam_data/BMAL1/BMAL1-ZT22_rep1.bam"] | |
| GTF = "/mnt/Storage/data/RefGene/mm9.gtf" | |
| SAMPLES = CLASS1 + CLASS2 |
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
| def update_one_sample(gsmid, parse_fields=['other_ids', 'paper', 'name', 'species', 'description', 'antibody', 'factor', | |
| 'cell type', 'cell line', 'tissue', 'strain']): | |
| """Given a gsmid, tries to create a new sample--auto-filling in the | |
| meta fields | |
| If overwrite is True and there is the sample that has the same gsmid, this function will overwrite that sample | |
| NOTE: will try to save the sample!! |
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
| #!/bin/bash | |
| sudo date 03050001 | |
| # Replace the following line with any application you need to run | |
| open /Applications/Merriam-Webster\ 4.0/Merriam-Webster\ Dictionary.app | |
| # sleep 60 | |
| # Set back to the current time using apple service (network needed) | |
| sudo ntpdate -u time.apple.com |
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
| def parseFactorByAntibody(geoPost): | |
| targetFlds = ["CHIP_ANTIBODY", "ANTIBODY", "CHIP", "ANTIBODY_SOURCE", "ANTIBODY_ANTIBODYDESCRIPTION", | |
| "ANTIBODY_TARGETDESCRIPTION"] | |
| #1. try to get the values | |
| for t in targetFlds: | |
| tmp = getFromPost(geoPost, t).strip() | |
| if not tmp: | |
| continue | |
| tmp = tmp.upper().replace("ANTI-", " ").replace("ANTI", " ").strip() | |
| if len(tmp) < 10 and tmp != "": |