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

parallel upstream and downstream marker per chromosome

parent fc95bbb9
No related branches found
No related tags found
No related merge requests found
......@@ -41,12 +41,18 @@ rule downstreamClosest:
bedtools closest -k 5 -iu -D ref -io -a {input.annot} -b {input.markers} 1> {output} 2> {log}
"""
# rule mergeClosest:
# message: " Merge both upstream and downstream results"
# input: up=config['results']+'/2.closestbedUpstream.txt', down=config['results']+'/2.downstreamClosest.txt'
# output: config['results']+'/2.mergedClosestMarkers.txt'
# log: config['results']+'/2.mergedClosestMarkers.log'
# shell:
# """
# join -1 4 -2 4 <(sort -k4,4 {input.up}) <(sort -k4,4 {input.down})|sed "s/ /\t/g"|cut -f -11,17- |sort -k2,2 -k3,3n |awk "{{size=\$14-\$8;print \$0,size}}"|sed "s/ /\t/g" 1> {output} 2> {log}
# """
\ No newline at end of file
rule splitPerChrom:
message: "Split data per chromosome"
input:
upstream=config['results']+'/2.closestbedUpstream.txt',
downstream=config['results']+'/2.downstreamClosest.txt'
output:
splitUp=config['results']+'/2.closestbed_split/{chrom}.upstream.txt',
splitDown=config['results']+'/2.closestbed_split/{chrom}.downstream.txt'
params: chromPref='TraesCS{chrom}'
log: config['results']+'/2.closestbed_split/{chrom}.split.log'
shell:
"""
fgrep -w {params.chromPref} {input.upstream} 1> {output.splitUp} 2> {log}
fgrep -w {params.chromPref} {input.downstream} 1> {output.splitDown} 2>> {log}
"""
\ No newline at end of file
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