Question: Insert mutations in a reference genome from a vcf
1
gravatar for IP
8 months ago by
IP590
Denmark/University of Copenagen
IP590 wrote:

Hi Biostars,

I am looking for a tool to introduce variants in a reference genome.

The ideal tool I am looking for:

Takes as input:

  • genome fasta

  • a vcf file

What it does:

  • Insert some of the variants (randomly) present in the vcf into the reference genome

What is the output

  • The ideal output would be a mutated new reference fasta, and a vcf file (The vcf file is not that important).

The reason I am looking for this is because I am working on simulation tool, but I would be happy to rely on a third party software to introduce the mutations.

cheers,

sequencing snp simulation • 358 views
ADD COMMENTlink modified 8 months ago by WouterDeCoster41k • written 8 months ago by IP590

use consensus from bcftools. https://samtools.github.io/bcftools/bcftools.html#consensus IP

copy/pasted from manual:

# Apply variants present in sample "NA001", output IUPAC codes for hets
bcftools consensus -i -s NA001 -f in.fa in.vcf.gz > out.fa
ADD REPLYlink modified 8 months ago • written 8 months ago by cpad011212k
6
gravatar for genomax
8 months ago by
genomax73k
United States
genomax73k wrote:

Not exactly what you are asking but if you are not wedded to specific vcf files then you could go the other way by using mutate.sh from BBMap suite. Lots of processing parameters you can control.

$ mutate.sh

Written by Brian Bushnell
Last modified December 13, 2018

Description:  Creates a mutant version of a genome.

Usage:  mutate.sh in=<input file> out=<output file> id=<identity>
I/O parameters:
in=<file>       Input genome.
out=<file>      Output mutant genome.
vcf=<file>      VCF file showing variants added.
ADD COMMENTlink modified 8 months ago • written 8 months ago by genomax73k

I have test this tool, and it is doing (ultrafastly!) what I was looking for. Thanks!

ADD REPLYlink written 8 months ago by IP590
4
gravatar for WouterDeCoster
8 months ago by
Belgium
WouterDeCoster41k wrote:

GATK FastaAlternateReferenceMaker does almost what you want, selecting randomly some variants is something you'll have to handle.

ADD COMMENTlink written 8 months ago by WouterDeCoster41k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2366 users visited in the last hour