Spectre icon indicating copy to clipboard operation
Spectre copied to clipboard

KeyError: '2'

Open pcr876 opened this issue 1 year ago • 1 comments

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

pcr876 avatar Jul 22 '24 00:07 pcr876

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

philippesanio avatar Jul 22 '24 13:07 philippesanio