-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from broadinstitute/dpark-dev
new reports and slight pipeline tweaks
- Loading branch information
Showing
11 changed files
with
252 additions
and
61 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
""" | ||
Just the assembly reports and nothing else | ||
""" | ||
|
||
__author__ = 'Daniel Park <dpark@broadinstitute.org>' | ||
|
||
import os | ||
|
||
configfile: "config.json" | ||
|
||
def read_file(fname): | ||
with open(fname, 'rt') as inf: | ||
for line in inf: | ||
yield line.strip() | ||
|
||
def cat_files_with_header(inFiles, outFile): | ||
with open(outFile, 'wt') as outf: | ||
header = None | ||
for f in inFiles: | ||
with open(f, 'rt') as inf: | ||
h = None | ||
for line in inf: | ||
if h == None: | ||
# this is the header line | ||
h = line | ||
if header == None: | ||
# this is the first file | ||
outf.write(line) | ||
header = h | ||
else: | ||
# this is not the first file | ||
if h != header: | ||
raise Exception("headers do not match") | ||
else: | ||
outf.write(line) | ||
|
||
|
||
rule all_assembly_reports: | ||
input: | ||
expand("{reportsDir}/assembly/{sample}.txt", | ||
reportsDir=config["reportsDir"], | ||
sample=read_file(config["samples_depletion"])) | ||
output: | ||
config["reportsDir"]+"/summary.assembly.txt" | ||
params: LSF="-N" | ||
run: | ||
cat_files_with_header(input, output[0]) | ||
|
||
|
||
rule assembly_report: | ||
output: config["reportsDir"]+'/assembly/{sample}.txt' | ||
resources: mem=2 | ||
params: LSF=config.get('LSF_queues', {}).get('short', '-W 4:00'), | ||
logid="{sample}" | ||
shell: "{config[binDir]}/reports.py assembly_stats {wildcards.sample} {output} --assembly_dir {config[dataDir]}/{config[subdirs][assembly]} --assembly_tmp {config[tmpDir]}/{config[subdirs][assembly]} --align_dir {config[dataDir]}/{config[subdirs][align_self]}" | ||
|
Oops, something went wrong.