fritzsedlazeck / Spectre

Copy number caller for long read data including SNV utilization
MIT License
54 stars 3 forks source link

KeyError: '2' #29

Closed pcr876 closed 3 months ago

pcr876 commented 4 months ago

Hi, I am trying to run spectre for CNV analysis for my targeted cancer data. I am getting the following error. My command line: spectre CNVCaller \ --coverage s101.regions.bed.gz \ --sample-id s101 \ --output-dir spctre_op/ \ --reference GCA_000001405.15_GRCh38_no_alt_analysis_set-002.fasta \ --only-chr chr1,2,5,6,7,9,10,15,17,19,X --cancer --disable-max-coverage --metadata metadata.mdr --blacklist grch38_blacklist_spectre.bed

Error: File "/miniconda3/bin/spectre", line 8, in sys.exit(main()) File "/miniconda3/lib/python3.9/site-packages/spectre/spectre.py", line 642, in main spectre_run.spectre_exe() File "/miniconda3/lib/python3.9/site-packages/spectre/spectre.py", line 356, in spectre_exe spectre_main.cnv_call() File "/miniconda3/lib/python3.9/site-packages/spectre/spectreCNV.py", line 88, in cnv_call self.cnv_analysis.data_normalization() File "/miniconda3/lib/python3.9/site-packages/spectre/analysis/analysis.py", line 187, in data_normalization self.coverage = tmp_genome_wide_coverage_dict[reference_chromosome] KeyError: '2'

Kindly help ! Thank you in advance, Shree

philippesanio commented 4 months ago

Hi @pcr876

This seems to be caused by the --only-chr chr1,2,5,6,7,9,10,15,17,19,X statement. You did it correctly for chromosome 1 with chr1. However, this has to be the same for the other chromosomes to. Assuming the other chromosomes follow the same naming scheme it should look something like this --only-chr chr1,chr2,chr5,chr6,chr7,chr9,chr10,chr15,chr17,chr19,chrX

I hope this helped! Cheers, Philippe