dohlee / metheor

:comet: Ultrafast DNA methylation heterogeneity calculation from bisulfite alignments (Lee et al., PLOS Computational Biology. 2023)
GNU General Public License v3.0
43 stars 8 forks source link

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/pdr.rs:102:44 #11

Closed hannahkimincompbio closed 1 year ago

hannahkimincompbio commented 1 year ago

Dear developers,

I have an issue with running metheor for pdr calculation. Below is the error I get.

I think the program has encountered an exception that it did not expect and exited in the middle. Nevertheless, I get the output written as though no error has occurred. I think this can end up being very confusing...

[hannahkimincompbio@n6 ~]$ metheor pdr --input methylation-data/T2-C6_merged.bam --output metheor-output/T2-C6_merged_pdf.tsv
Computing PDR with parameters input=methylation-data/T2-C6_merged.bam, output=metheor-output/T2-C6_merged_pdf.tsv, min_depth=10
  00:01:32 Processed 98725735 reads, found 1315569 valid reads and 105098 CpGs were covered. Done in 92.825218948s.
⠖ 00:00:01>00:00:00 ███████████████████████████░░░  (97604/105098)
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/pdr.rs:102:44
[hannahkimincompbio@n6 ~]$ ls metheor-output -lt
total 939944
-rw-rw-r-- 1 hannahkimincompbio hannahkimincompbio  1071839 Mar 23 09:45 T2-C6_merged_pdf.tsv

Best,

Hannah Kim

dohlee commented 1 year ago

Hi, thanks for your bug report.

Based on the prompt that metheor generates, I speculate that you're using older version of metheor which writes the result on the fly while iterating the alignments. Could you let me know the version of metheor you are using? (metheor -V) In the case it's not 0.1.6, please update it to 0.1.6 then please see whether the output file is generated even when the error occurred in the middle.

We can then address the error afterwards. Maybe related to https://github.com/dohlee/metheor/blob/014f0c403ceb3c1462ddc7e192e4880b004cc3a6/src/pdr.rs#L102 in v0.0.5 of metheor, but let's first see the error still occurs with the latest version of the tool :)

Best, Dohoon Lee

hannahkimincompbio commented 1 year ago

Dear Dohoon,

Thank you for your quick reply.

Indeed, I was using metheor 0.0.3, so I have been trying to update the package to metheor 0.1.6. However, I have been stuck for hours at the same step of the 0.1.6 installation in the two separate Linux systems that I have access to (See below for outputs). The default installation of metheor also gets me 0.1.0, not 0.1.6 (See Linux 2 output).

Is there another way that I can install metheor 0.1.6?

(1) Linux 1

[hannahkimincompbio@new-silverback ~]$ metheor -V 
metheor 0.0.3
[hannahkimincompbio@new-silverback ~]$ conda install -c dohlee metheor=0.1.6
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done  
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: |

(2) Linux 2

[hannahkimincompbio@compute]~% anaconda3/bin/conda install -c dohlee metheor=0.1.6
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: / failed

CondaError: KeyboardInterrupt

^C
[hannahkimincompbio@compute]~% anaconda3/bin/conda install -c dohlee metheor      
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/hannahkimincompbio/anaconda3

  added / updated specs:
    - metheor

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    metheor-0.1.0              |       h3fd9d12_0         1.9 MB  dohlee
    rust-1.64.0                |       h06a4308_0       188.3 MB
    ------------------------------------------------------------
                                           Total:       190.2 MB

The following NEW packages will be INSTALLED:

  metheor            dohlee/linux-64::metheor-0.1.0-h3fd9d12_0 
  rust               pkgs/main/linux-64::rust-1.64.0-h06a4308_0 

Proceed ([y]/n)?

Best,

Hannah Kim

dohlee commented 1 year ago

It seems like an issue with conda. You can try with the latest version of conda, or install metheor in new and clean environment, or use mamba.

Best, Dohoon

hannahkimincompbio commented 1 year ago

Dear Dohoon,

I think I have found two solutions!

1) Less Ideal Creating a new conda environment still did not let me download version 0.1.6. However, when I ran version 0.1.0 on my file, it did not provide an error.

2) Better I ended up looking at https://anaconda.org/dohlee/metheor/files. Version 0.1.0 was already one years old, so I realized that it was not good enough. So I downloaded version 0.1.6 from the link and unzipped it on the linux machine... and it worked!

Outcome

(mymetheor) [hannahkimincompbio@compute ~]$ metheor -V
metheor 0.1.0
(mymetheor) [hannahkimincompbio@compute ~]$ metheor pdr --input T2-C6_merged.bam --output T2-C6_merged_pdr.tsv
(mymetheor) [hannahkimincompbio@compute ~]$ tar -xvf metheor-0.1.6-h3fd9d12_0.tar.bz2 
(mymetheor) [hannahkimincompbio@compute ~]$ bin/metheor -V
metheor 0.1.6
(mymetheor) [hannahkimincompbio@compute ~]$ bin/metheor pdr --input T2-C6_merged.bam --output T2-C6_merged_pdr_016.tsv
(mymetheor) [hannahkimincompbio@compute ~]$ ls -lt
-rw-r--r--  1 hannahkimincompbio cis   51726167 Mar 23 21:39 T2-C6_merged_pdr_016.tsv
-rw-r--r--  1 hannahkimincompbio cis   51726167 Mar 23 21:33 T2-C6_merged_pdr.tsv

Now that I am not getting any errors, I look forward to running other methylation heterogeneity measures as well!

Best,

Hannah Kim

dohlee commented 1 year ago

Good to hear that. Hope you have interesting findings about methylation heterogeneity from your data :)

If you have some errors with 0.1.6, please open another issue. Closing!