Is there a way to introduce specific SNPs on the fasta sequence of a gene? I am working on a Pharmacogenetics project and I want to simulate reads for specific haplotypes of PGX genes. Therefore, I want to introduce in the FASTA of a specific gene (e.g., CYP3A4), the specific variants that would define a specific haplotype (e.g., rs 27371759 that defines haplotype CYP3A4*18).
If you have a VCF file with all the ALT alleles that you need to insert and a reference genome in FASTA, you can use bcftools consensus to insert all ALT alleles into the reference. Note that the reference and VCF need to have the same coordinate system. That means, if the VCF is in genomic coordinates, then you also have to use whole chromosomes in the reference fasta.
If you want to introduce only few specific mutations into a gene sequence you could use seqkit mutate. You could also use a sequence editor like Jalview or Snapgene. I wouldn't use a text editor because you need to do all the counting by hand.
If you have specific changes you want to make then you can edit the fasta file accordingly.
Thank you very much. Is there a script or program that does it automatically?