Skip to content
Snippets Groups Projects
Commit 05929a88 authored by Beibei Chen's avatar Beibei Chen
Browse files

memechip framework finished

parent 965294b4
Branches
Tags
No related merge requests found
...@@ -51,10 +51,10 @@ def run_signal(files, labels, genome): ...@@ -51,10 +51,10 @@ def run_signal(files, labels, genome):
bw_commands = [] bw_commands = []
for f in files: for f in files:
bw_commands.append("bamCoverage -bs 10 -b "+f+" -o "+f.replace("bam","bw")) bw_commands.append("bamCoverage -bs 10 -b "+f+" -o "+f.replace("bam","bw"))
#work_pool = Pool(min(len(files), 12)) work_pool = Pool(min(len(files), 12))
#work_pool.map(bam2bw_wrapper, bw_commands) work_pool.map(bam2bw_wrapper, bw_commands)
#work_pool.close() work_pool.close()
#work_pool.join() work_pool.join()
cm_command = "computeMatrix scale-regions -R "+gene_bed+" -a 3000 -b 3000 --regionBodyLength 5000 --skipZeros -S *.bw -o samples.deeptools_generegionscalematrix.gz" cm_command = "computeMatrix scale-regions -R "+gene_bed+" -a 3000 -b 3000 --regionBodyLength 5000 --skipZeros -S *.bw -o samples.deeptools_generegionscalematrix.gz"
#p = subprocess.Popen(cm_command, shell=True) #p = subprocess.Popen(cm_command, shell=True)
......
...@@ -39,8 +39,10 @@ def main(): ...@@ -39,8 +39,10 @@ def main():
def run(infile, genome, limit, output) def run(infile, genome, limit, output)
infile = pybedtools.BedTool(infile) infile = pybedtools.BedTool(infile)
#genome = twobitreader.TwoBitFile(genome) #genome = twobitreader.TwoBitFile(genome)
output = open(args.outfile,"w") output = open(output+".fa","w")
rowcount = 1 rowcount = 1
if limit ==-1:
limit = len(infile)
for record in infile: for record in infile:
while rowcount <=limit: while rowcount <=limit:
rowcount += 1 rowcount += 1
...@@ -56,7 +58,7 @@ def run(infile, genome, limit, output) ...@@ -56,7 +58,7 @@ def run(infile, genome, limit, output)
SeqIO.write(newfa,output+".fa","fasta") SeqIO.write(newfa,output+".fa","fasta")
output.close() output.close()
#Call memechip #Call memechip
meme_command = "meme-chip -oc "+output+" -meme-minw 5 -meme-maxw 15 -meme-nmotifs 10" meme_command = "meme-chip -oc "+output+"_memechip"+" -meme-minw 5 -meme-maxw 15 -meme-nmotifs 10 "+output+".fa"
p = subprocess.Popen(meme_command, shell=True) p = subprocess.Popen(meme_command, shell=True)
p.communicate() p.communicate()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment