tprodanov / parascopy

Copy number estimation and variant calling for duplicated genes using WGS.
MIT License
22 stars 3 forks source link

ERROR: Cannot fetch region #8

Open zshu-alt opened 11 months ago

zshu-alt commented 11 months ago

Hello, I have a problem now, my software can run normally, but I can't get any result file I want. I used the fa of GRCh37 as the reference genome and successfully ran the first step. In the second step, I deleted the chr in my bed file and successfully ran it. But the result file does not have any results except the header, the error message is not added chr number when possible, but if I run the first step with the fa of hg19, the error message again says that I should not add "chr", I seem to be in a dilemma, how do I solve this problem and get the result I want? I would be very grateful if you could help me, I am sure that my input whole genome bam file uses hg19 as the reference genome. The header of the bam file looks like this: @HD VN:1.5 SO:coordinate @SQ SN:chrM LN:16571 @SQ SN:chr1 LN:249250621 @SQ SN:chr2 LN:243199373 @SQ SN:chr3 LN:198022430 @SQ SN:chr4 LN:191154276 @SQ SN:chr5 LN:180915260 @SQ SN:chr6 LN:171115067 @SQ SN:chr7 LN:159138663 @SQ SN:chr8 LN:146364022 @SQ SN:chr9 LN:141213431 @SQ SN:chr10 LN:135534747 @SQ SN:chr11 LN:135006516 @SQ SN:chr12 LN:133851895 @SQ SN:chr13 LN:115169878 @SQ SN:chr14 LN:107349540 @SQ SN:chr15 LN:102531392 @SQ SN:chr16 LN:90354753 @SQ SN:chr17 LN:81195210 @SQ SN:chr18 LN:78077248 @SQ SN:chr19 LN:59128983 @SQ SN:chr20 LN:63025520 @SQ SN:chr21 LN:48129895 @SQ SN:chr22 LN:51304566 @SQ SN:chrX LN:155270560 @SQ SN:chrY LN:59373566 My bam file seems to have 'chr' on it. If using the hg19 reference genome shows an error like this: parascopy depth -I input.list -g hg19 -f 0:00:00.5 Loading predefined windows for hg19 Traceback (most recent call last): File "/home/dell/miniconda3/envs/wgs/bin/parascopy", line 10, in sys.exit(main()) The File "/ home/dell/miniconda3 / envs/WGS/lib/python3.10 / site - packages/parascopy/entry_point py", line 114, in the main return _process_exceptions(depth.main, inner_prog, inner_argv) File "/ home/dell/miniconda3 envs WGS/lib/python3.10 / site - packages/parascopy/entry_point. Py", line 70, in _process_exceptions fn(*args, **kwargs) The File "/ home/dell/miniconda3 / envs/WGS/lib/python3.10 / site - packages/parascopy/the depth. Py", line 827, in the main windows = _load_windows(bed_lines, genome, out) The File "/ home/dell/miniconda3 / envs/WGS/lib/python3.10 / site - packages/parascopy/the depth. Py", line 62, in _load_windows chrom_id = genome.chrom_id(chrom_name) The File "/ home/dell/miniconda3 / envs/WGS/lib/python3.10 / site - packages/parascopy/inner/genome. Py", 48, the line in chrom_id return self._ids[chrom_name] KeyError: '1'

I can run the first step successfully if I use the GRCh37 reference genome, but I can't seem to find my target region when running the second step 0:00:00.8 ERROR: Cannot fetch 5:70234667-70234737 from /home/dell/ZSY/project/muscle/WGS/rawdata/21C354141_WGS001_NGS.rmdup.sorted.bam (possibly missing chromosome). 0:00:00.8 ERROR: Cannot fetch 5:70238186-70238385 from /home/dell/ZSY/project/muscle/WGS/rawdata/21C354141_WGS001_NGS.rmdup.sorted.bam (possibly missing chromosome). 0:00:00.8 ERROR: Cannot fetch 5:70237217-70237335 from /home/dell/ZSY/project/muscle/WGS/rawdata/21C354141_WGS001_NGS.rmdup.sorted.bam (possibly missing chromosome).

The software you developed is very important to my research and I would appreciate it if you could answer my questions!!以上翻译结果来自有道神经网络翻译(YNMT)· 通用场景

逐句对照

tprodanov commented 11 months ago

Hi,

Sorry for the late reply! Yes, looking at your BAM header it looks like you are using hg19 reference. Can you look at the reference fai file? Perhaps, there, the chromosome names do not start with chr? If so, you can either remove chr from BAM file using samtools reheader, or add chr to the reference file.