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
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 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 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 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 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 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 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 != "": |
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
def _peaks_parse(input): | |
total = 0 | |
fc20n = 0 | |
fc10n = 0 | |
peaks_info = {} | |
with open(input) as peaks_xls: | |
for line in peaks_xls: | |
if line.startswith('# tags after filtering in treatment'): | |
# tags after filtering in treatment: 13438948 | |
peaks_info["uniloc"] = int(line.strip().split(":")[1]) |
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
def create_workflow(args, conf): | |
""" | |
:type conf:ChiLinConfig | |
""" | |
root_workflow = Workflow("Main") | |
ShellCommand("prepare","mkdir -p {output}",output = conf.target_dir).attach_to(root_workflow) | |
groom_workflow = attach(root_workflow, Workflow("Groom")) | |
rawQC_workflow = attach(root_workflow, Workflow("RawQC")) | |
map_workflow = attach(root_workflow, Workflow("ReadsMapping")) |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#define SHIFT 4 | |
#define MSK 0x0F | |
#define UNT 1 | |
#define N 300000000 | |
#define print(X) for (i=1;i<1+N;i++) {printf("%d\t%d\n",i,(X)[i]);} | |
unsigned char aln[1+N]; |