This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to convert vcf to MAF ?

I'm interested in converting vcf to MAF, I found 2 scripts

1) perl vcf to maf

Its ask for a EXAC vcf for filtering,

2) Python vcf to maf (https://github.com/cbare/vcf2maf)

python vcf2maf.py --vcf  /data/genome/RG.vcf --maf testmaf -o permaf
**"Traceback (most recent call last):
  File "vcf2maf.py", line 556, in <module>
    main()
  File "vcf2maf.py", line 543, in main
    n += vcf2maf(vcf_file, maf_file, decrement_end_coordinate=args.decrement_end_coordinate, verbose=args.verbose)
  File "vcf2maf.py", line 184, in vcf2maf
    centers = vcf_reader.metadata['center']
KeyError: 'center**'

I'm facing error

or is their any alternatives to convert vcf to MAF?

Thanks!

alignment snp

Hi

I setup the paths in .bashrc, still not able run ?

# VEP #
export PATH="/usr/local/softw/ensembl-vep:$PATH"
export PATH="/mnt/NAS/projects/VEP/loxodonta_africana:$PATH"

I edited the path in VCF2MAF.pl

my ( $vep_path, $vep_data, $vep_forks, $buffer_size, $any_allele ) = ( "/usr/local/softw/ensembl-vep", "/mnt/NAS/projects/VEP/loxodonta_africana", 4, 5000, 0 )

Were it went wrong ?

thanks!

post the error message you're getting if it's still not working

HI

./vcf2maf.pl --input-vcf /mnt/NAS/projects/2018/M.perminguis/PERMINGIUS_G-2005_915_merged_rmdup_RG.bam_GATK.vcf --output-maf /mnt/NAS/projects/2018/M.perminguis/PERMINGIUS_G-2005.maf --species loxodonta_africana --filter-vcf 0  --ref-fasta /mnt/NAS/projects/2018/ref/LoxArf4.fasta --vep-path /usr/local/softw/ensembl-vep --vep-data /mnt/NAS/projects/2018/VEP/loxodonta_africana/ 
STATUS: Running VEP and writing to: /mnt/NAS/projects/2018/M.perminguis/PERMINGIUS_G-2005_915_merged_rmdup_RG.bam_GATK.vep.vcf

-------------------- EXCEPTION --------------------
MSG: ERROR: Cache directory /mnt/NAS/projects/2018/VEP/loxodonta_africana//loxodonta_africana not found

STACK Bio::EnsEMBL::VEP::CacheDir::dir /usr/local/softw/ensembl-vep/modules/Bio/EnsEMBL/VEP/CacheDir.pm:311
STACK Bio::EnsEMBL::VEP::CacheDir::init /usr/local/softw/ensembl-vep/modules/Bio/EnsEMBL/VEP/CacheDir.pm:227
STACK Bio::EnsEMBL::VEP::CacheDir::new /usr/local/softw/ensembl-vep/modules/Bio/EnsEMBL/VEP/CacheDir.pm:111
STACK Bio::EnsEMBL::VEP::AnnotationSourceAdaptor::get_all_from_cache /usr/local/softw/ensembl-vep/modules/Bio/EnsEMBL/VEP/AnnotationSourceAdaptor.pm:115
STACK Bio::EnsEMBL::VEP::AnnotationSourceAdaptor::get_all /usr/local/softw/ensembl-vep/modules/Bio/EnsEMBL/VEP/AnnotationSourceAdaptor.pm:91
STACK Bio::EnsEMBL::VEP::BaseRunner::get_all_AnnotationSources /usr/local/softw/ensembl-vep/modules/Bio/EnsEMBL/VEP/BaseRunner.pm:175
STACK Bio::EnsEMBL::VEP::Runner::init /usr/local/softw/ensembl-vep/modules/Bio/EnsEMBL/VEP/Runner.pm:123
STACK Bio::EnsEMBL::VEP::Runner::run /usr/local/softw/ensembl-vep/modules/Bio/EnsEMBL/VEP/Runner.pm:194
STACK toplevel /usr/local/softw/ensembl-vep/vep:224
Date (localtime)    = Mon Dec 24 20:54:22 2018
Ensembl API version = 94
---------------------------------------------------

ERROR: Failed to run the VEP annotator! Command: /usr/bin/perl /usr/local/softw/ensembl-vep/vep --species loxodonta_africana --assembly GRCh37 --offline --no_progress --no_stats --buffer_size 5000 --sift b --ccds --uniprot --hgvs --symbol --numbers --domains --gene_phenotype --canonical --protein --biotype --uniprot --tsl --pubmed --variant_class --shift_hgvs 1 --check_existing --total_length --allele_number --no_escape --xref_refseq --failed 1 --vcf --flag_pick_allele --pick_order canonical,tsl,biotype,rank,ccds,length --dir /mnt/NAS/projects/2018/VEP/loxodonta_africana/ --fasta /mnt/NAS/projects/2018/ref/LoxArf4.fasta --format vcf --input_file /mnt/NAS/projects/2018/M.perminguis/PERMINGIUS_G-2005_915_merged_rmdup_RG.bam_GATK.vcf --output_file /mnt/NAS/projects/2018/M.perminguis/PERMINGIUS_G-2005_915_merged_rmdup_RG.bam_GATK.vep.vcf --fork 4 --regulatory

sunnykevin97 : Please use ADD REPLY when responding to existing comments to keep threads logically organized.

2 answers

Perl method works well and is the most recommend :)

https://github.com/mskcc/vcf2maf

You don't necessarily need an EXaC vcf to annotate, but you will need VEP.

I tried facing an error ..

Is their 2 formats - 1) multiple alignment format 2) mutation annotation format I'm interested in converting vcf to multiple alignment format is their any tool ?

I'm currently working with elephants datasets

It is not possible to convert VCF format to multiple alignment format because one represents variants and the other represents sequence alignments. VCFs can be converted to mutation annotation format because both represent variants.

When using vcf2maf.pl you have to edit the paths of files in the script. Following up with what Raony Guimarães said, you will need VEP, and you will also need to specify its path:

nano vcf2maf.pl :

# Set any default paths and constants
...
my ( $vep_path, $vep_data, $vep_forks, $buffer_size, $any_allele ) = ( "$ENV{HOME}/vep", "$ENV{HOME}/.vep", 4, 5000, 0 );

Set "$ENV{HOME}/vep" to your path containing "node00/example/VEP/ensembl-vep"

Set "$ENV{HOME}/.vep" to your path containing your genome builds, snp sites etc. "node00/example/VEP"

my ( $ref_fasta, $filter_vcf ) = ( "$ENV{HOME}/.vep/homo_sapiens/91_GRCh37/Homo_sapiens.GRCh37.75.dna.primary_assembly.fa.gz", "$ENV{HOME}/.vep/ExAC_nonTCGA.r0.3.1.sites.vep.vcf.gz" );

Again change instances of '$ENV{HOME}/.vep" to path containing genome builds etc

HI, this was the error I'm facing ?

./vcf2maf.pl --input-vcf /mnt/NAS/projects/2018/M.perminguis/PERMINGIUS_G-2005_915_merged_rmdup_RG.bam_GATK.vcf --output-maf /mnt/NAS/projects/2018/M.perminguis/PERMINGIUS_G-2005.maf --species loxodonta_africana --filter-vcf 0  --ref-fasta /mnt/NAS/projects/2018/ref/LoxArf4.fasta --vep-path /usr/local/softw/ensembl-vep --vep-data /mnt/NAS/projects/2018/VEP/loxodonta_africana/ 
STATUS: Running VEP and writing to: /mnt/NAS/projects/2018/M.perminguis/PERMINGIUS_G-2005_915_merged_rmdup_RG.bam_GATK.vep.vcf

-------------------- EXCEPTION --------------------
MSG: ERROR: Cache directory /mnt/NAS/projects/2018/VEP/loxodonta_africana//loxodonta_africana not found

STACK Bio::EnsEMBL::VEP::CacheDir::dir /usr/local/softw/ensembl-vep/modules/Bio/EnsEMBL/VEP/CacheDir.pm:311
STACK Bio::EnsEMBL::VEP::CacheDir::init /usr/local/softw/ensembl-vep/modules/Bio/EnsEMBL/VEP/CacheDir.pm:227
STACK Bio::EnsEMBL::VEP::CacheDir::new /usr/local/softw/ensembl-vep/modules/Bio/EnsEMBL/VEP/CacheDir.pm:111
STACK Bio::EnsEMBL::VEP::AnnotationSourceAdaptor::get_all_from_cache /usr/local/softw/ensembl-vep/modules/Bio/EnsEMBL/VEP/AnnotationSourceAdaptor.pm:115
STACK Bio::EnsEMBL::VEP::AnnotationSourceAdaptor::get_all /usr/local/softw/ensembl-vep/modules/Bio/EnsEMBL/VEP/AnnotationSourceAdaptor.pm:91
STACK Bio::EnsEMBL::VEP::BaseRunner::get_all_AnnotationSources /usr/local/softw/ensembl-vep/modules/Bio/EnsEMBL/VEP/BaseRunner.pm:175
STACK Bio::EnsEMBL::VEP::Runner::init /usr/local/softw/ensembl-vep/modules/Bio/EnsEMBL/VEP/Runner.pm:123
STACK Bio::EnsEMBL::VEP::Runner::run /usr/local/softw/ensembl-vep/modules/Bio/EnsEMBL/VEP/Runner.pm:194
STACK toplevel /usr/local/softw/ensembl-vep/vep:224
Date (localtime)    = Mon Dec 24 20:54:22 2018
Ensembl API version = 94
---------------------------------------------------

ERROR: Failed to run the VEP annotator! Command: /usr/bin/perl /usr/local/softw/ensembl-vep/vep --species loxodonta_africana --assembly GRCh37 --offline --no_progress --no_stats --buffer_size 5000 --sift b --ccds --uniprot --hgvs --symbol --numbers --domains --gene_phenotype --canonical --protein --biotype --uniprot --tsl --pubmed --variant_class --shift_hgvs 1 --check_existing --total_length --allele_number --no_escape --xref_refseq --failed 1 --vcf --flag_pick_allele --pick_order canonical,tsl,biotype,rank,ccds,length --dir /mnt/NAS/projects/2018/VEP/loxodonta_africana/ --fasta /mnt/NAS/projects/2018/ref/LoxArf4.fasta --format vcf --input_file /mnt/NAS/projects/2018/M.perminguis/PERMINGIUS_G-2005_915_merged_rmdup_RG.bam_GATK.vcf --output_file /mnt/NAS/projects/2018/M.perminguis/PERMINGIUS_G-2005_915_merged_rmdup_RG.bam_GATK.vep.vcf --fork 4 --regulatory

Do not edit code to change the values of $vep_path and $vep_data. Use command-line arguments --vep-path and --vep-data instead. Please see more in documentation printed when using argument --help.

Log in to answer this question.