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

main works

parent eff4984e
Branches
Tags
No related merge requests found
......@@ -34,21 +34,21 @@ process processdesign {
"""
}
//process run_deeptools {
// publishDir "$baseDir/output", mode: 'copy'
// input:
// file deeptools_design_file from deeptools_design
// file annotation Tdx
// output:
// stdout result
// script:
// """
// module load python/2.7.x-anaconda
// source activate /project/shared/bicf_workflow_ref/chipseq_bchen4/
// module load deeptools/2.3.5
// python $baseDir/scripts/runDeepTools.py -i $deeptools_design_file -g ${params.genomepath}}
//"""
//}
process run_deeptools {
publishDir "$baseDir/output", mode: 'copy'
input:
file deeptools_design_file from deeptools_design
file annotation Tdx
output:
stdout result
script:
"""
module load python/2.7.x-anaconda
source activate /project/shared/bicf_workflow_ref/chipseq_bchen4/
module load deeptools/2.3.5
python $baseDir/scripts/runDeepTools.py -i $deeptools_design_file -g ${params.genomepath}}
"""
}
process run_diffbind {
......@@ -67,35 +67,35 @@ process run_diffbind {
Rscript $baseDir/scripts/runDiffBind.R $diffbind_design_file
"""
}
//
//process run_chipseeker_diffpeak {
process run_chipseeker_diffpeak {
publishDir "$baseDir/output", mode: 'copy'
input:
file diffpeak_design_file from diffpeaksdesign_chipseeker
file diffpeaks from diffpeaks_chipseeker
output:
stdout result
script:
"""
module load python/2.7.x-anaconda
source activate /project/shared/bicf_workflow_ref/chipseq_bchen4/
Rscript $baseDir/scripts/runChipseeker.R $diffpeak_design_file hg19
"""
}
process run_chipseeker_originalpeak {
// publishDir "$baseDir/output", mode: 'copy'
// input:
// file diffpeak_design_file from diffpeaksdesign_chipseeker
// file diffpeaks from diffpeaks_chipseeker
// output:
// stdout result
// script:
// """
// module load python/2.7.x-anaconda
// source activate /project/shared/bicf_workflow_ref/chipseq_bchen4/
// Rscript $baseDir/scripts/runChipseeker.R $diffpeak_design_file hg19
//"""
//}
//
//process run_chipseeker_originalpeak {
//// publishDir "$baseDir/output", mode: 'copy'
// input:
// file design_file from chipseeker_design
// output:
// stdout result1
// script:
// """
// module load python/2.7.x-anaconda
// source activate /project/shared/bicf_workflow_ref/chipseq_bchen4/
// Rscript $baseDir/scripts/runChipseeker.R $design_file ${species}
//"""
//}
input:
file design_file from chipseeker_design
output:
stdout result1
script:
"""
module load python/2.7.x-anaconda
source activate /project/shared/bicf_workflow_ref/chipseq_bchen4/
Rscript $baseDir/scripts/runChipseeker.R $design_file ${species}
"""
}
process run_meme_original {
publishDir "$baseDir/output", mode: 'copy'
......
......@@ -38,7 +38,7 @@ for (i in c(1:length(data$contrasts)))
colnames(report)[1:5]<-c("chrom","peak_start","peak_stop","peak_width","peak_strand")
#print(head(report))
write.table(report,contrast_name,sep="\t",quote=F,row.names=F)
write.table(report,contrast_bed_name,sep="\t",quote=F,row.names=F, col.names=F)
write.table(report[,c(1:3)],contrast_bed_name,sep="\t",quote=F,row.names=F, col.names=F)
}
#Write new design file
newdesign = data.frame(SampleID=new_SampleID, Peaks=new_Peaks)
......
......@@ -53,25 +53,33 @@ def run_wrapper(args):
def run(infile, genome, limit, output):
infile = pybedtools.BedTool(infile)
logging.debug(len(infile))
genome = twobitreader.TwoBitFile(genome)
outfile = open(output+".fa","w")
rowcount = 0
limit = int(limit)
logging.debug(limit)
if limit ==-1:
limit = len(infile)
for record in infile:
rowcount += 1
rowcount += 1
#logging.debug(record)
if rowcount <=limit:
# logging.debug(rowcount)
#logging.debug(rowcount)
try:
#logging.debug(record.chrom)
seq = genome[record.chrom][record.start:record.stop]
except:
pass
else:
if record.strand == "-":
seq = rc(seq)
newfa_name = record.name#"_".join(record.fields)
if len(record.fields)>=4:
newfa_name = record.name
else:
newfa_name = "_".join(record.fields)
newfa = SeqRecord(Seq(seq),newfa_name,description="")
#logging.debug(seq)
SeqIO.write(newfa,outfile,"fasta")
outfile.close()
#Call memechip
......
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