Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A problem occured run smn_caller.py #14

Open
dongdongyaa opened this issue Jan 29, 2024 · 7 comments
Open

A problem occured run smn_caller.py #14

dongdongyaa opened this issue Jan 29, 2024 · 7 comments

Comments

@dongdongyaa
Copy link

dongdongyaa commented Jan 29, 2024

hello!!
When I run "smn_caller.py --manifest depth_calling/tests/test_data/NA12885.bam --genome 19 --prefix NA12885 --outDir ./ --threads 2",the error
" File "/public/home/donglijie/miniconda3/envs/smncnv/lib/python3.7/codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte"happed.
I wonder how to solve it. Thanks a lot!

@bw2
Copy link

bw2 commented Jan 29, 2024

The --manifest arg should be a text file. You should try running

echo depth_calling/tests/test_data/NA12885.bam > manifest.txt
python3 smn_caller.py --manifest manifest.txt --genome 19 --prefix NA12885 --outDir ./ --threads 2

@dongdongyaa
Copy link
Author

thanks for your reply. I have fixed the error,but another error occured.It's about "ValueError: invalid contig chr5" .When I run my data,the error is TypeError: unsupported operand type(s) for /: 'NoneType' and 'int

@bw2
Copy link

bw2 commented Jan 29, 2024

"invalid contig" may indicate a mismatch between the reference genome and read data file.
If you post the full python stack trace along with the error message, it may help with troubleshooting.

@dongdongyaa
Copy link
Author

I run my bam data,the error like this "INFO:root:Processing sample at 2024-01-30 10:34:34.101195 /public/home/dd/miniconda3/envs/smncnv/bin/depth_calling/bin_count.py:85: RuntimeWarning: divide by zero encountered in true_divide
y_counts = y_counts / np.median(y_counts)
/public/home/dd/miniconda3/envs/smncnv/bin/depth_calling/bin_count.py:85: RuntimeWarning: invalid value encountered in true_divide
y_counts = y_counts / np.median(y_counts)
/public/home/dd/miniconda3/envs/smncnv/lib/python3.7/site-packages/numpy/core/fromnumeric.py:3441: RuntimeWarning: Mean of empty slice.
out=out, **kwargs)
/public/home/dd/miniconda3/envs/smncnv/lib/python3.7/site-packages/numpy/core/_methods.py:189: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)
/public/home/dd/miniconda3/envs/smncnv/bin/depth_calling/bin_count.py:77: RuntimeWarning: divide by zero encountered in true_divide
y_counts = y_counts / np.median(y_counts)
/public/home/dd/miniconda3/envs/smncnv/bin/depth_calling/bin_count.py:77: RuntimeWarning: invalid value encountered in true_divide
y_counts = y_counts / np.median(y_counts)
Traceback (most recent call last):
File "/public/home/dd/miniconda3/envs/smncnv/bin/smn_caller.py", line 298, in
main()
File "/public/home/dd/miniconda3/envs/smncnv/bin/smn_caller.py", line 275, in main
reference_fasta,
File "/public/home/dd/miniconda3/envs/smncnv/bin/smn_caller.py", line 118, in smn_cn_caller
gcall_exon16 = gmm_exon16.gmm_call(normalized_depth.normalized["exon16"])
File "/public/home/dd/miniconda3/envs/smncnv/bin/depth_calling/gmm.py", line 95, in gmm_call
val_new = (val / 2) / self.value_shift
TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'"

@bw2
Copy link

bw2 commented Jan 30, 2024

I'm not 100% sure, but this error may be due to zero coverage at SMN positions where the tool is expecting reads.

I would open the input bam file in IGV and manually look at these positions on chr5 to make sure there are reads there:
https://github.com/Illumina/SMNCopyNumberCaller/blob/master/data/SMN_SNP_38.txt#L8-L16

Alternatively, you could edit

/public/home/dd/miniconda3/envs/smncnv/bin/depth_calling/bin_count.py

and add some print statements that could give you a better idea of the underlying issue.

@dongdongyaa
Copy link
Author

Thanks your helpful advise. My data is targeted sequencing for specific genes,including SMN1.Is this related to reporting errors?

@bw2
Copy link

bw2 commented Jan 31, 2024

Yes. SMNCopyNumberCaller only works for WGS data because it looks at reads within both exonic and intronic regions of SMN. For targeted sequencing data, you can use https://github.com/broadinstitute/sma_finder (though it only determines whether an individual has SMA ie. affected/unaffected status, and does not report carrier status or SMN1/SMN2 copy number).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants