centre-for-virus-research / weeSAM

Script for parsing SAM/BAM files for coverage statistics
GNU General Public License v3.0
14 stars 7 forks source link

weeSAM in snakemake #16

Open AroobAlhumaidy opened 1 year ago

AroobAlhumaidy commented 1 year ago

Hello everyone,

I'm building my snakemake including weeSAM, and facing an issue: This is the snakefile rule:

rule weeSAM:
    input:
        "workspace/analysis/{sample}.sorted.bam"
    output:
        temp("workspace/analysis/{sample}.weesam/{sample}.weesam.txt")
    benchmark:
        "workspace/benchmark/{sample}.weeSAM.tsv"
    shell:
        "python codeBase/weeSAM.py --bam {input} --out {output}" 

This is the error I'm getting when I run the pipeline, However, when I re-run the pipeline it works. I don't know the reason for the instability:

Traceback (most recent call last):
  File "/home/data/weeSAM/weeSAM", line 797, in <module>
    process_bam(bam_list)
  File "/home/data/weeSAM/weeSAM", line 273, in process_bam
    with open("tmp_depth.txt", "r") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'tmp_depth.txt'

Can you help?

Thanks,

Best, Aroob

AroobAlhumaidy commented 1 year ago

this is another error:

----    Processing: global_temp_workspace/analysis/sample.sorted.bam      ----
Total # Mapped Reads:   6044117
Total # Unmapped Reads: 4325
Total # Reads:  6048442
Generating a depth file, this may take a while.
Traceback (most recent call last):
  File "/home/data/weeSAM/weeSAM", line 797, in <module>
    process_bam(bam_list)
  File "/home/data/weeSAM/weeSAM", line 289, in process_bam
    avg_dict[i] = statistics.mean(min_dict[i])
KeyError: 'NC_045512.2'