vcf2maf icon indicating copy to clipboard operation
vcf2maf copied to clipboard

error: Couldn't open VCF: path_to.split.vcf!

Open Deanho opened this issue 5 years ago • 7 comments

Hi, I tried to run vcf2maf on a .vcf file produced using GATK Mutect2. The sample was a tumour whole genome run against a Panel Of Normals. I get the following error: error: Couldn't open VCF: path_to.split.vcf! Does this mean I have to split my .vcf before running vcf2maf, by, for example, chr? Or is it something to do with the Mutect2 output .vcf structure? Regards, Dean

Deanho avatar Sep 16 '19 10:09 Deanho

Hi, @Deanho I am getting the same error. Any update on that?

D0g4 avatar Dec 23 '19 14:12 D0g4

No. I never got a response. Sorry.


From: D0g4 [email protected] Sent: 23 December 2019 14:02:10 To: mskcc/vcf2maf Cc: Hammond, Dean; Mention Subject: Re: [mskcc/vcf2maf] error: Couldn't open VCF: path_to.split.vcf! (#232)

Hi, @Deanhohttps://github.com/Deanho I am getting the same error. Any update on that?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/mskcc/vcf2maf/issues/232?email_source=notifications&email_token=ACK5WGEV2T4LUXM6VIMS2GTQ2DAGFA5CNFSM4IXASRCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHRF5GQ#issuecomment-568483482, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACK5WGCICYNBGJ45QMLDRETQ2DAGFANCNFSM4IXASRCA.

Deanho avatar Dec 23 '19 16:12 Deanho

I got this error too.

It seems that, when we run vcf2maf.pl on a VCF file from two or more VCFs' intersection using this command:

bcftools isec A.vcf.gz B.vcf.gz >   foo.vcf

Then run:

vcf2maf.pl \
--input-vcf foo.vcf \
 --output-maf foo.maf \
...

It will lead to the error:

ERROR: Couldn't open VCF: foo.split.vcf

It's very strange where the "split.vcf" come out from.

b-niu avatar Jan 22 '20 05:01 b-niu

Perhaps this is induced by potential SVs in the VCF. I think this section may be helpful:

# If the VCF contains SVs, split the breakpoints into separate lines before passing to VEP
my ( $split_svs, $var_count ) = ( 0, 0 );
my $orig_vcf_fh = IO::File->new( $input_vcf ) or die "ERROR: Couldn't open --input-vcf: $input_vcf!\n";
my $split_vcf_fh = IO::File->new( "$tmp_dir/$input_name.split.vcf", "w" ) or die "ERROR: Couldn't open VCF: $tmp_dir/$input_name.split.vcf!\n";
while( my $line = $orig_vcf_fh->getline ) {
    # If the file uses Mac OS 9 newlines, quit with an error
    ( $line !~ m/\r$/ ) or die "ERROR: Your VCF uses CR line breaks, which we can't support. Please use LF or CRLF.\n";

    if( $line =~ m/^#/ ) {
        $split_vcf_fh->print( $line ); # Write header lines unchanged
        next;
    }
...

b-niu avatar Jan 22 '20 05:01 b-niu

I have fix this problem in my own situation. I had built a docker image of VEP and vcf2maf, and run it using arguments -u id -u:id -g. But when it attempt to create the file "$input_name.split.vcf", it has no permission to do this.

A solution is removing the argument -u id -u:id -g, and let the docker image has "root" permission.

There must be better solutions.

b-niu avatar Jan 22 '20 05:01 b-niu

I was getting the same error and I made a tmp directory and added --tmp-dir //tmp in the command line which seems to resolve the issue. Now, I'm getting a new error: Can't locate CGI.pm in @INC (@INC contains: .) at /path/to/vcf2maf/vcf2maf-1.6.16/vep/variant_effect_predictor.pl line 45. BEGIN failed--compilation aborted at /path/to/vcf2maf/vcf2maf-1.6.16/vep/variant_effect_predictor.pl line 45.

FaezeK avatar Apr 07 '20 19:04 FaezeK

To solve the "Can't locate CGI.pm" issue, I had to fix my "PERL5LIB" path and set it to perllibs directory and with the above fix (making a tmp directory), I could run vcf2maf successfully.

FaezeK avatar Apr 07 '20 21:04 FaezeK