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

Error with "read_vcfs_as_granges" function #79

Open
shaghayeghsoudi opened this issue Oct 26, 2022 · 1 comment
Open

Error with "read_vcfs_as_granges" function #79

shaghayeghsoudi opened this issue Oct 26, 2022 · 1 comment

Comments

@shaghayeghsoudi
Copy link

Dear developers,

I am trying to run MutaionalPattern and my original data are in MAF file format, however as the tool requires vcf file format I converted my maf files into vcf files.

#CHROM	POS	ID	REF	ALT	QUAL	FILTER	INFO	FORMAT	SRC125_postRT
1	168266966	1:168266966_C/T	C	T	.	.	t_alt_count=6;t_ref_count=49	AD:DP	.,6:49
2	196922779	2:196922779_A/T	A	T	.	.	t_alt_count=30;t_ref_count=74	AD:DP	.,30:74
1	114267511	1:114267511_A/C	A	C	.	.	t_alt_count=40;t_ref_count=15	AD:DP	.,40:15

Unfortunately I cannot get the tool running and keep getting this warning message

[E::COMPAT_vcf_hdr_read] No sample line
Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'x' in selecting a method for function 'granges': error in evaluating the argument 'x' in selecting a method for function 'seqinfo': no 'header' line "#CHROM POS ID..."?

I have not idea because the header line is present.
Can you please provide me with some advice how to solve this problem?
Thank you

@rhagelaar
Copy link

Dear Shaghayegh,

When I take your input and try to run the following command :
grl.maf <- read_vcfs_as_granges(vcf_files = "maf_input.vcf", sample_names = "MAF_format", ref_genome)

I get a slightly different error

[E::COMPAT_bcf_hdr_read] Input is not detected as bcf or vcf format
Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'x' in selecting a method for function 'granges': error in evaluating the argument 'x' in selecting a method for function 'seqinfo': no 'header' line "#CHROM POS ID..."?

This suggest that the input is not in VCF format. If I add the following header(s) to your example file it accepts the file and returns a grangeslist

##fileformat=VCFv4.2
##FORMAT=<ID=AD,Number=R,Type=Integer,Description="Allelic depths for the ref and alt alleles in the order listed">
##FORMAT=<ID=DP,Number=1,Type=Integer,Description="Approximate read depth (reads with MQ=255 or with bad mates are filtered)">

Some background information. VCF format requires a header for each type of in your format column. So if you have more, these need to be added as wel.

Hope this helps

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