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

KeyError: "tag 'MD' not present" #225

Open
mochew opened this issue Sep 25, 2024 · 5 comments
Open

KeyError: "tag 'MD' not present" #225

mochew opened this issue Sep 25, 2024 · 5 comments

Comments

@mochew
Copy link

mochew commented Sep 25, 2024

Hi there,

I encountered a KeyError exception when running NanoSim. Specifically, the error report KeyError: "tag 'cs' not present". This error occurred during the execution of the script when trying to analyze reads and match error models. Below is the full traceback from the log.
image
Could you please help me resolve this issue? Thank you for your assistance!

@lcoombe
Copy link
Member

lcoombe commented Sep 25, 2024

Hi @mochew,

Could you provide us with a bit more information, including:

  • Version of NanoSim installed
  • How you installed NanoSim and dependencies (ex. conda, source code, etc)
  • Version of minimap2 installed
  • Your full command

Thank you for your interest in NanoSim!
Lauren

@mochew
Copy link
Author

mochew commented Sep 26, 2024

Thank you for your response. The commands I used to install NanoSim are as follows:

(1)git clone https://github.com/bcgsc/NanoSim.git
(2)conda create --name nanosim python=3.7
(3)conda activate nanosim
(4)conda install --file requirements.txt -c conda-forge -c bioconda
(5)conda install regex
The commands I used to run NanoSim are as follows:

nohup python read_analysis.py genome
-i /newhome/Public_data/TRs/DeepTR-source-data/HG001/Nanopore/HG001_Circulomics_Guppy_4.2.2.fastq.gz
-ga /home/wuyingfu/complete_sequence/ref_sequence/GCA_009914755.4_T2T-CHM13v2.0_genomic.fna_exten_TR_intrv_align/HG001/HG001_Nanopore_aln_sorted.bam
-o /home/wuyingfu/complete_sequence/Nanosim/Out_put/
-t 40

/home/wuyingfu/complete_sequence/Nanosim/log/analysis_HG001_reads.log 2>&1 &

The library versions in the NanoSim environment are shown in the figure below:

image

image

If you need any further information, please let me know. I look forward to your response

@mochew
Copy link
Author

mochew commented Sep 26, 2024

In addition, the minimap2 I installed is as follows:
image

@lcoombe
Copy link
Member

lcoombe commented Sep 26, 2024

Hi @mochew,

A couple suggestions:

  • We highly recommend installing NanoSim fully from conda, ideally in a fresh conda environment: conda install -c conda-forge -c bioconda nanosim -> this is just easier and leads to more consistent/reliable installations
  • You have supplied your own BAM file to NanoSim. You need to ensure that in that alignment file, CS tags are present (by specifying --cs option to your minimap2 alignment command). More information can be found here: https://github.com/bcgsc/NanoSim?tab=readme-ov-file#usage. A good option is to let NanoSim do the alignment for you, instead of supplying the BAM file, so that you don't have to consider the alignment arguments.

@mochew
Copy link
Author

mochew commented Sep 28, 2024

Thank you very much for your response. I will try running NanoSim again based on your suggestions.

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