Skip to content
Snippets Groups Projects
Commit 00907053 authored by Sander Bollen's avatar Sander Bollen
Browse files

fix collectstats

parent 6d8f168c
No related branches found
No related tags found
No related merge requests found
......@@ -465,7 +465,7 @@ rule collectstats:
shell: "python {input.colpy} --sample-name {params.sample_name} " \
"--pre-qc-fastq {input.preqc} --post-qc-fastq {input.postq} " \
"--mapped-num {input.mnum} --mapped-basenum {input.mbnum} " \
"--unique-num {input.unum} --unique-basenum {input.mbnum} " \
"--unique-num {input.unum} --usable-basenum {input.mbnum} " \
"--female-threshold {params.fthresh} {input.cov} > {output}"
rule merge_stats:
......
......@@ -19,12 +19,12 @@ def parse_num_file(path):
def determine_gender(covstat, fthresh):
"""Determine gender from a covstat json """
cv = covstat['stats']['coverage']
all = cv['_all']
all = cv['_all']['median']
if 'chrX' in cv:
x = cv['chrX']
x = cv['chrX']['median']
elif 'X' in cv:
x = cv['X']
x = cv['X']['median']
else:
return "NA"
......@@ -68,7 +68,7 @@ def determine_gender(covstat, fthresh):
required=True,
help="Usable basenum")
@click.option("--female-threshold",
type=click.INT,
type=click.FLOAT,
default=0.6,
help="Female threshold of X/all cov")
@click.argument("covstats",
......@@ -107,7 +107,7 @@ def main(sample_name, pre_qc_fastq, post_qc_fastq, mapped_num, mapped_basenum,
"covstats": covl
}
json.dumps(covl)
print(json.dumps(d))
if __name__ == "__main__":
......
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