This is a test version of Biostars. For the public version, visit https://www.biostars.org.
error while running vcf2maf

Hi I have snps from rnaseq data. I split multisample file into single sample files. Now each sample vcf, I want to convert vcf to maf in vcf2maf . I am getting following error

perl /usr/local/bin/vcf2maf.pl --input-vcf  F545_altref_vep.vcf   --output-maf F545_altref_vep.maf  --tumor-id WD1309  --ref-fasta Homo_sapiens.GRCh38.dna.toplevel.fa.gz 

>ERROR: Your VCF uses CR line breaks, which we can't support. Please use LF or CRLF.

I will appreciate all the suggestions

Thank you Archana

vcf2maf snp rnaseq

Did you edit the file somewhere? Where? It is complaining about the file having lines delimited by carriage return, which was used on old Macs. This is the comment on the code:

# If the file uses Mac OS 9 newlines, quit with an error

With what software did you split the multi-sample file into single files? It looks like that software introduced something the perl script doesn't like.

2 answers

This should fix the error, but you should first discover why the file got broken in the first place:

perl -lne 's/\r//; print "$_";' F545_altref_vep.vcf > F545_altref_vep_fixed.vcf

Why not just using sed? :)

sed 's/\r/\n/' F545_altref_vep.vcf > F545_altref_vep_fixed.vcf

I subset my vcf with VariantAnnotation in R and then got the same error. That works for me!

I was running vcf2maf on Linux and came across the same problem. So, my question is: are you running it on Linux as well?

If so, it seems that this is a matter of line break system in different OS. Fortunately, that can be easily fixed by dos2unix command.

In my case, I ran: dos2unix -n -ascii Old.vcf New.vcf

Where, -n will generate a new file whilst keeping the original; and -ascii will convert only the break lines.

I hope it helps.

Log in to answer this question.