KolmogorovLab / Wakhan

Haplotype-specific somatic copy number aberrations/profiling from long reads sequencing data
MIT License
18 stars 0 forks source link

Error in snps_loh.py #7

Open mhjiang97 opened 5 months ago

mhjiang97 commented 5 months ago

Hi, thank you for developing this tool. But I have come across the following issue.

What I've run:

python ${WAKHAN}/src/main.py \
--threads ${THREADS} \
--reference ${FASTA} \
--target-bam ${BAM} \
--tumor-vcf ${VCF_PHASED} \
--smoothing-enable True \
--copynumbers-enable True \
--unphased-reads-coverage-enable True \
--phaseblock-flipping-enable True \
--phaseblocks-enable True \
--genome-name hg19 \
--cut-threshold 150 \
--out-dir-plots ${DIR_WAKHAN}

The error says:

 File "/home/mjhk/opt/Wakhan/src/main.py", line 305, in <module>
    main()
  File "/home/mjhk/opt/Wakhan/src/main.py", line 300, in main
    plot_snps_frequencies(arguments, csv_df_snps_mean, df_segs_hp1, df_segs_hp2, centers, integer_fractional_means)
  File "/usersdata/mjhk/opt/Wakhan/src/snps_loh.py", line 51, in plot_snps_frequencies
    centromere_region_starts, centromere_region_ends, loh_region_starts, loh_region_ends = plot_snps(chrom, index, df_snps_in_csv, html_graphs, arguments, df_chrom)
  File "/usersdata/mjhk/opt/Wakhan/src/snps_loh.py", line 98, in plot_snps
    plot_snps_counts(chrom, index, ref_start_values, df_snps_in_csv, html_graphs, arguments, df_chrom)
  File "/usersdata/mjhk/opt/Wakhan/src/snps_loh.py", line 150, in plot_snps_counts
    coverage = coverage_bins(df_chrom)
  File "/usersdata/mjhk/opt/Wakhan/src/snps_loh.py", line 136, in coverage_bins
    coverage = df.coverage.values.tolist()
  File "/home/mjhk/.conda/envs/wakhan/lib/python3.8/site-packages/pandas/core/generic.py", line 5989, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'DataFrame' object has no attribute 'coverage'

Could you debug this? Thank you in advance.

tahashmi commented 5 months ago

Hi, Could you just comment the lines 150 and 151 for the time being (this is only in case unphased data, I forgot to put condition if arguments['without_phasing']: there, for these two lines during my internal debug, sorry for that) https://github.com/KolmogorovLab/Wakhan/blob/3f1a5c83edde8846ee6217f25b289cedcaddbdf9/src/snps_loh.py#L150