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

add support for cram files #21

Open
flokraft85 opened this issue Apr 23, 2024 · 8 comments
Open

add support for cram files #21

flokraft85 opened this issue Apr 23, 2024 · 8 comments

Comments

@flokraft85
Copy link

Hi,
first of all, paraphase is a really good tool!
It would be great if paraphase could accept cram files as input.

Best,
Florian

@xiao-chen-xc
Copy link
Collaborator

Hi @flokraft85 yes we can do that in the next release.

@flokraft85
Copy link
Author

Hi @xiao-chen-xc ,
that is fantastic! Thanka a lot.

@xiao-chen-xc
Copy link
Collaborator

Hi @flokraft85 Version 3.2 is released and it can support cram files as input.

@flokraft85
Copy link
Author

flokraft85 commented Jan 29, 2025

Hi @xiao-chen-xc ,
that is really great! Thanks for adding this feature!

@flokraft85
Copy link
Author

flokraft85 commented Jan 31, 2025

Hi @xiao-chen-xc ,
There may still be an issue with how Paraphase handles CRAM files when the location of the reference file (ref.fa) changes relative to the alignment. We run our analysis using a nextflow workflow, meaning that the path to the ref.fa in the CRAM file header points only to the temporary nextflow directory. (/data/work/f7/211d11635b0faded38905bab69fdc7/GRCh38_no_alt_analysis_set_dup_masked.fa).

[E::fai_build3_core] Failed to open the file /data/work/f7/211d11635b0faded38905bab69fdc7/GRCh38_no_alt_analysis_set_dup_masked.fa
[E::refs_load_fai] Failed to open reference file '/data/work/f7/211d11635b0faded38905bab69fdc7/GRCh38_no_alt_analysis_set_dup_masked.fa'
[W::cram_get_ref] Failed to populate reference for id 22
[E::cram_next_slice] Failure to decode slice
ERROR:root:Error running MAGEH1 for sample sample_1...See error message below
Traceback (most recent call last):
  File "/home/humgen/miniconda3/envs/paraphase/lib/python3.10/site-packages/paraphase/paraphase.py", line 148, in process_gene
    bam_realigner.write_realign_bam()
  File "/home/humgen/miniconda3/envs/paraphase/lib/python3.10/site-packages/paraphase/prepare_bam_and_vcf.py", line 102, in write_realign_bam
    for read in wgs.fetch(
  File "pysam/libcalignmentfile.pyx", line 2109, in pysam.libcalignmentfile.IteratorRowRegion.__next__
OSError: truncated file

Hence, paraphase may not have used the ref.fa provided with the "-r" option.

paraphase -b input.cram -o output/paraphase -r ref.fa} -t 40

Best,
FLorian

@xiao-chen-xc
Copy link
Collaborator

Hi Florian,

I made some updates. Could you try downloading paraphase-3.2.1a0.tar.gz and install it with pip install paraphase-3.2.1a0.tar.gz? Let me know if this version works in your workflow.

Thanks,
Xiao

@flokraft85
Copy link
Author

Hi Xiao,
thanks for the fixing the issue so fast. I tested the 3.2.1 alpha and now everthing works fine!

Best,
Florian

@xiao-chen-xc
Copy link
Collaborator

Great! I'll release v3.2.1 soon.

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