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

application to non-model organisms #57

Open
dgs108 opened this issue Oct 29, 2024 · 3 comments
Open

application to non-model organisms #57

dgs108 opened this issue Oct 29, 2024 · 3 comments

Comments

@dgs108
Copy link

dgs108 commented Oct 29, 2024

I'm interested in using mity to assess within-individual variation in mitochondrial DNA. I have assembled mitochondrial genomes for ~300 individuals of a non-model fish species using MitoZ and found that 10% of full-sibling pairs have distinct haplotypes (1-8 SNPs). As these individuals share a mother, I believe this variation is due to sequencing artifacts or heteroplasmy.

Can mity be used to examine these issues in non-human samples?

If so, can you please advise on how to prep input files?

I receive the following error after running this code:

fastp -i 360387_R1_001.fastq.gz -I 360387_R2_001.fastq.gz -o 360387_R1_001_trim.fastq.gz -O 360387_R2_001_trim.fastq.gz -q 20 --detect_adapter_for_pe
bwa mem mt_reference.fasta 360387_R1_001_trim.fastq.gz 360387_R2_001_trim.fastq.gz > 360387_align.sam
samtools view -@ 40 -S -b 360387_align.sam > 360387_align.bam
samtools sort -@ 40 360387_align.bam -o 360387_align_sort.bam
samtools index -@ 40 360387_align_sort.bam
mity runall 360387_align_sort.bam --prefix test

Error:

mity 1.1.0
mity runall
Traceback (most recent call last):
  File "/home/dswift/miniconda3/bin/mity", line 33, in <module>
    main()
  File "/home/dswift/miniconda3/bin/mity", line 29, in main
    args.func(args)
  File "/home/dswift/miniconda3/lib/python3.12/site-packages/mitylib/commands.py", line 388, in _cmd_runall
    call.Call(
  File "/home/dswift/miniconda3/lib/python3.12/site-packages/mitylib/call.py", line 69, in __init__
    self.run()
  File "/home/dswift/miniconda3/lib/python3.12/site-packages/mitylib/call.py", line 84, in run
    self.run_checks()
  File "/home/dswift/miniconda3/lib/python3.12/site-packages/mitylib/call.py", line 222, in run_checks
    if not all(map(self.bam_has_rg, self.files)):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dswift/miniconda3/lib/python3.12/site-packages/mitylib/call.py", line 242, in bam_has_rg
    return len(r.header["RG"]) > 0
               ~~~~~~~~^^^^^^
  File "pysam/libcalignmentfile.pyx", line 557, in pysam.libcalignmentfile.AlignmentHeader.__getitem__
KeyError: 'RG'

Thanks!

@trentzz
Copy link
Collaborator

trentzz commented Oct 30, 2024

Hi @dgs108,

I'm not too familiar with your use case and I'll have to get back to you on that. Just to explain the error a bit, mity requires RG headers in the bam file for variant calling purposes, so that's part of the pre-checks that are done. This is just saying it couldn't find any RG headers present.

Would you know if your bam files have RG headers?

Thanks!

@dgs108
Copy link
Author

dgs108 commented Oct 31, 2024

Thanks for the quick response!

I can add RG headers to the bam file. Can I use a reference for my study species, or should I use one of the references provided? It would be great if you could share some code to produce bam files comparable to the test files.

@trentzz
Copy link
Collaborator

trentzz commented Nov 1, 2024

Hi @dgs108,

Unfortunately mity does not currently support adding custom references, but it's something we're planning on adding in future releases! We only have references for human and mice at the moment, and it probably won't work that well for your use case.

Thanks!
Trent

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