RagTAg correct: "no attribute 'get_reference_length'"
pna059 opened this issue · 1 comments
pna059 commented
Hi,
after I stumbled on the samtools stats (and got around by running the stats in a separate step), I got stuck on this error. I thought, that It may be an old pysam I have pysam v0.9.1, but the attribute reference_name was introduced in version 0.8.4.
......
Fri May 26 08:08:59 2023 --- INFO: The max and min coverage thresholds are 180X and 5X, respectively
Traceback (most recent call last):
File "/home/pavlan/tools/RagTag/ragtag_correct.py", line 666, in <module>
main()
File "/home/pavlan/tools/RagTag/ragtag_correct.py", line 631, in main
ctg_breaks = validate_breaks(ctg_breaks, output_path, num_threads, overwrite_files, val_min_break_end_dist, max_cov, min_cov, window_size=val_window_size, clean_dist=min_break_dist, debug=debug_mode)
File "/home/pavlan/tools/RagTag/ragtag_correct.py", line 191, in validate_breaks
max_range = min((bam.get_reference_length(ctg) - min_break_end_dist), b + (window_size // 2))
AttributeError: 'pysam.calignmentfile.AlignmentFile' object has no attribute 'get_reference_length'
How can I overcome this one?
Thanks
Pavla
pna059 commented
Hi, the solution was simply creating a devoted conda environment and installing RagTag there.
conda create -n ragtag
conda activate ragtag
conda install -c bioconda ragtag