-
Notifications
You must be signed in to change notification settings - Fork 3
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
UnboundLocalError #18
Comments
Hi, Regarding your case 2, currently CalicoST does not fully support providing normal annotation file. The Regarding case 1, the most probable explanations (1) the BAF threshold to identify an HMM state are too low and does allow any of the states to be Best, |
Thank you very much Dr. Ma for the details. I have a follow-up query. How can I apply CalicoST for non-Visium data such as Slide-seqV2? I am not sure about the construction of bamlist.tsv in that case. Can you please help? |
We haven't tested on Slide-seqV2 dataset on our side. But as the read/UMI counts per spot are very low in Slide-seqV2, I would suggest (1) try running the preprocessing Snakemake pipeline and evaluate whether there are enough het SNPs with relative high counts, and if so (2) creating "pseudo spots" to enlarge the count per "spot" by aggregating nearby spots into non-overlapping windows, and run CalicoST on the pseudo spots. For (1), you can organize the BAM file and barcodes similar to a spaceranger output. For each sample, the directory should contain
With only one Slide-seqV2 sample, update in the
Once the config.yaml file is updated and the paths to reference files are filled in, run the snakemake pipeline by
If the preprocessing is successful,
If the number of het SNPs with reasonable read count is too low (<10000), the data is too sparse to use the B allele frequency signal, and it's unlikely to get meaningful allele-specific CNAs from CalicoST. But if there are enough het SNPs with reasonable read count, it's worth trying aggregating spots into "pseudo spots", with the goal that each "pseudo spot" have more than 200 SNP-covering UMI counts on average (the sum across axis=1 of the above A and B allele counts corresponding to SNP-covering UMI per spot). Then, create spaceranger directories according to the pseudo spots
Update Best, |
These details are extremely helpful. Thank you very much Dr. Ma. |
Hello Dr. Ma,
I want to apply CalicoST on a Visium sample, and I have annotations for the normal spots. I encountered errors in each of the following two cases.
Interestingly, the 'infer CNAs and clones' step finished successfully without estimating tumor proportions and without the annotations.
Here are some details on the errors.
Error message from case 1
Traceback (most recent call last):
File "/net/mulan/home/kalinsba/apps/CalicoST/src/calicost/estimate_tumor_proportion.py", line 120, in
main(args.configfile)
File "/net/mulan/home/kalinsba/apps/CalicoST/src/calicost/estimate_tumor_proportion.py", line 101, in main
loh_states, is_B_lost, rdr_values, clones_hightumor = identify_loh_per_clone(single_X, combined_assignment, combined_pred_cnv, combined_p_binom, normal_candidate, single_total_bb_RD)
File "/net/mulan/home/kalinsba/apps/CalicoST/src/calicost/utils_hmrf.py", line 623, in identify_loh_per_clone
return loh_states, is_B_lost, rdr_values[loh_states], clones_hightumor
UnboundLocalError: local variable 'loh_states' referenced before assignment
Error message from case 2
/net/mulan/home/kalinsba/apps/CalicoST/src/calicost/hmm_NB_BB_phaseswitch.py:650: RuntimeWarning: invalid value encountered in divide
lambd = np.sum(base_nb_mean, axis=1) / np.sum(base_nb_mean)
Traceback (most recent call last):
File "/net/mulan/home/kalinsba/apps/CalicoST/src/calicost/calicost_main.py", line 444, in
main(args.configfile)
File "/net/mulan/home/kalinsba/apps/CalicoST/src/calicost/calicost_main.py", line 138, in main
index_normal = np.where(normal_candidate)[0]
UnboundLocalError: local variable 'normal_candidate' referenced before assignment
Can you please help?
The text was updated successfully, but these errors were encountered: