Skip to content
Snippets Groups Projects
Commit 596b1b4c authored by Helene Rimbert's avatar Helene Rimbert
Browse files

merge rules isbpsort and split into on single rule bam2bed

parent 0364771d
No related branches found
No related tags found
No related merge requests found
......@@ -9,21 +9,22 @@ rule filterBam:
rule bam2bed:
message: "Convert Filtered BAM file into BED"
input: config['results']+"/1.filteredISBPs.bam"
output: config['results']+"/1.filteredISBPs.bed"
log: config['results']+"/2.bam2bed.log"
shell: "bamToBed -i {input} |sort -k1,1 -k2,2n 1> {output} 2> {log}"
output: config['results']+"/1.filteredISBPs/{chrom}/sorted.bed"
log: config['results']+"/1.filteredISBPs/{chrom}/sorted.log"
params: 'Chr{chrom}'
shell: "bamToBed -i {input} |fgrep -i {params}|cut -d ':' -f 1|sort -k1,1 -k2,2n 1> {output} 2> {log}"
rule dumpISBPsID:
message: "Dump ISBPs IDs"
input: config['results']+"/1.filteredISBPs.bed"
output: config['results']+"/1.filteredISBPs.ids"
shell: " cut -f 4 {input} > {output}"
#rule dumpISBPsID:
# message: "Dump ISBPs IDs"
# input: config['results']+"/1.filteredISBPs.bed"
# output: config['results']+"/1.filteredISBPs.ids"
# shell: " cut -f 4 {input} > {output}"
rule splitISBP:
message: "Split isbps per chromosome"
input: config['results']+"/1.filteredISBPs.bed"
output: config['results']+"/1.filteredISBPs/{chrom}/sorted.bed"
log: config['results']+"/1.filteredISBPs/{chrom}/sorted.log"
params: 'Chr{chrom}'
shell: "fgrep -i {params} {input} 1> {output} 2> {log}"
#rule splitISBP:
# message: "Split isbps per chromosome"
# input: config['results']+"/1.filteredISBPs.bed"
# output: config['results']+"/1.filteredISBPs/{chrom}/sorted.bed"
# log: config['results']+"/1.filteredISBPs/{chrom}/sorted.log"
# params: 'Chr{chrom}'
# shell: "fgrep -i {params} {input} 1> {output} 2> {log}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment