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

Force Calling Errors #465

Open
ACEnglish opened this issue Apr 2, 2024 · 2 comments
Open

Force Calling Errors #465

ACEnglish opened this issue Apr 2, 2024 · 2 comments
Assignees
Labels

Comments

@ACEnglish
Copy link

Hello,

I'm attempting to run force calling from sniffles and are running into a few errors. The version I'm running is from develop (1e47c23)
Error 1:
When attempting to force call with command:

sniffles --input $bam --genotype-vcf $in_vcf --vcf output_genotypes.vcf -t 8

I get an error that

2024-04-02 12:14:18,855 ERROR sniffles.main (962219): Unhandled error while running sniffles.
Traceback (most recent call last):
  File "/stornext/snfs4/next-gen/scratch/english/round2/mpy/bin/sniffles", line 514, in <module>
    Sniffles2_Main(processes)
  File "/stornext/snfs4/next-gen/scratch/english/round2/mpy/bin/sniffles", line 444, in Sniffles2_Main
    t.result.emit(vcf_out=vcf_out, snf_out=snf_out)
  File "/stornext/snfs4/next-gen/scratch/english/round2/mpy/lib/python3.10/site-packages/sniffles/result.py", line 50, in emit
    vcf_out.write_call(call)
  File "/stornext/snfs4/next-gen/scratch/english/round2/mpy/lib/python3.10/site-packages/sniffles/vcf.py", line 159, in write_call
    for internal_id, sample_id in self.config.sample_ids_vcf:
AttributeError: 'SnifflesConfig' object has no attribute 'sample_ids_vcf'

A couple of more minor errors are:
Error 2- sniffles -h seems to throw an error. This is not a huge deal, just a small usability inconvience.

log.txt !!!TRUNCATED FOR READABILITY BY ME!!! Usage example C - Determine genotypes for a set of known SVs (force calling): sniffles --input sample.bam --genotype-vcf input_known_svs.vcf --vcf output_genotypes.vcf

2024-04-02 12:06:09,811 ERROR sniffles.main (962157): Unhandled error while running sniffles.
Traceback (most recent call last):
File "/stornext/snfs4/next-gen/scratch/english/round2/mpy/bin/sniffles", line 514, in
Sniffles2_Main(processes)
File "/stornext/snfs4/next-gen/scratch/english/round2/mpy/bin/sniffles", line 70, in Sniffles2_Main
config = SnifflesConfig()
File "/stornext/snfs4/next-gen/scratch/english/round2/mpy/lib/python3.10/site-packages/sniffles/config.py", line 270, in init
parser.parse_args(args=args or None, namespace=self)
File "/hgsc_software/python/python-3.10.4/lib/python3.10/argparse.py", line 1825, in parse_args
args, argv = self.parse_known_args(args, namespace)
File "/hgsc_software/python/python-3.10.4/lib/python3.10/argparse.py", line 1858, in parse_known_args
namespace, args = self._parse_known_args(args, namespace)
File "/hgsc_software/python/python-3.10.4/lib/python3.10/argparse.py", line 2067, in _parse_known_args
start_index = consume_optional(start_index)
File "/hgsc_software/python/python-3.10.4/lib/python3.10/argparse.py", line 2007, in consume_optional
take_action(action, args, option_string)
File "/hgsc_software/python/python-3.10.4/lib/python3.10/argparse.py", line 1935, in take_action
action(self, namespace, argument_values, option_string)
File "/hgsc_software/python/python-3.10.4/lib/python3.10/argparse.py", line 1099, in call
parser.exit()
File "/hgsc_software/python/python-3.10.4/lib/python3.10/argparse.py", line 2569, in exit
_sys.exit(status)
SystemExit: 0

Error 3 - Another minor inconvenience is that if the --genotype-vcf does not exist, an uniformative error is thrown.

log.txt 2024-04-02 12:06:17,170 INFO sniffles.main (962160): Running Sniffles2, build 2.3.0-rc2 2024-04-02 12:06:17,170 INFO sniffles.main (962160): Run Mode: genotype_vcf 2024-04-02 12:06:17,170 INFO sniffles.main (962160): Start on: 2024/04/02 12:06:17 2024-04-02 12:06:17,170 INFO sniffles.main (962160): Working dir: /stornext/snfs4/next-gen/scratch/english/round2/aou_sv_merge/genotyping/sniffles/giab_HG002 2024-04-02 12:06:17,170 INFO sniffles.main (962160): Used command: /stornext/snfs4/next-gen/scratch/english/round2/mpy/bin/sniffles --input /stornext/snfs4/next-gen/scratch/medhat/projects/HGSC_SUmmit_2023/PacBio_Movie_24_vs_30_2024-01-11/movie_24/analysis_38/result/HG002_24h.minimap.hap.bam --genotype-vcf /users/u233287/scratch/aou_sv_merge/genotyping/kanpig/giab_HG002/custom_giabv1.0/GIABv1.0.vcf.gz --vcf output_genotypes.vcf -t 8 2024-04-02 12:06:17,170 INFO sniffles.main (962160): ============================== 2024-04-02 12:06:17,170 INFO sniffles.resources (962160): Logging memory usage to None 2024-04-02 12:06:17,170 INFO sniffles.main (962160): Opening for reading: /stornext/snfs4/next-gen/scratch/medhat/projects/HGSC_SUmmit_2023/PacBio_Movie_24_vs_30_2024-01-11/movie_24/analysis_38/result/HG002_24h.minimap.hap.bam cmd.sh: line 13: 962160 Segmentation fault (core dumped) sniffles --input $bam --genotype-vcf $in_vcf --vcf output_genotypes.vcf -t 8

real 0m0.837s
user 0m0.253s
sys 0m0.091s

@hermannromanek hermannromanek self-assigned this Apr 2, 2024
@hermannromanek
Copy link
Collaborator

Hi Adam,

Thanks for testing & reporting, I'll fix them as soon as possible.

Hermann

@hermannromanek
Copy link
Collaborator

Hi Adam,

I just pushed fixes for the first two issues. The third one seems to be the result of using an internal class of pysam. I think the best way to fix that is to change the usage to documented classes which (in my brief test) handle a missing file gracefully by raising an exception instead of killing the process by segfault. I'll add that to the To-Do-List for v2.4.

Thanks,
Hermann

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants