text: user146: I'm beginning with the reference genome in FASTA format, hg19. I am reading the sequence into a Python dictionary with BioPython:
  genome_dictionary = {} 
  for seq_record.id in SeqIO.parse(input_fasta_file, "fasta"):
      genome_dictionary[seq_record.id] = seq_record
  
  This creates a Python dictionary with keys as chromosome names and values as strings from the FASTA. 
  My goal is to take the FASTA, and simulate artificial SNPs and InDels along the FASTA to benchmark various algorithms. If I was only creating SNPs in the FASTA, this would be a trivial problem. The reference FASTA has the original coordinates, and the SNPs would also be in a coordinate system which is the same. 
  However, when I randomly insert an insertion (e.g. an insertion of 12 bp), I move all events into a new coordinate system such that 
  new coordinate system = old coordinate system + 15
  
  This becomes very difficult to keep track off throughout the entire genome after several interations. I therefore cannot keep track of the new and old coordinate system without running an algorithm and creating a VCF, which may have errors. This defeats the purpose of the simulation.
  The output would be either a BED file or VCF which has keep track of the changes.
  What method/data structure is used to solve this problem? Would LiftOver work? Maybe CrossMap? 
  http://genome.sph.umich.edu/wiki/LiftOver
  http://crossmap.sourceforge.net/
  
  user425: If you look for a program which would randomly introduce SNPs + short indels and then would save everything into a VCF file, DWGsim or Mason Variator could be a good choice. Then you can create a corresponding Chain file using bcftools consensus -c and transform various formats between these two coordinate systems using CrossMap.
  
  user96: I've written a handful of programs from scratch to simulate mutations and variations in real or simulated sequences.
  The trick has always been to sort the variants by genomic coordinate, apply the variant with the largest coordinate first, then apply the variant with the second largest coordinate, all the way down to the variant with the smallest coordinate.
  Indels and other variants that affect sequence structure only affect subsequent coordinates. So going in reverse order ensures variants at the beginning of the sequence don't throw off variants at the end of the sequence.
  
original_text: 146: <p>I'm beginning with the reference genome in FASTA format, hg19. I am reading the sequence into a Python dictionary with <code>BioPython</code>:</p>
  
  <pre><code>genome_dictionary = {} 
  for seq_record.id in SeqIO.parse(input_fasta_file, "fasta"):
      genome_dictionary[seq_record.id] = seq_record
  </code></pre>
  
  <p>This creates a Python dictionary with keys as chromosome names and values as strings from the FASTA. </p>
  
  <p>My goal is to take the FASTA, and simulate artificial SNPs and InDels along the FASTA to benchmark various algorithms. If I was only creating SNPs in the FASTA, this would be a trivial problem. The reference FASTA has the original coordinates, and the SNPs would also be in a coordinate system which is the same. </p>
  
  <p>However, when I randomly insert an insertion (e.g. an insertion of 12 bp), I move all events into a new coordinate system such that </p>
  
  <pre><code>new coordinate system = old coordinate system + 15
  </code></pre>
  
  <p>This becomes very difficult to keep track off throughout the entire genome after several interations. I therefore cannot keep track of the new and old coordinate system without running an algorithm and creating a VCF, which may have errors. This defeats the purpose of the simulation.</p>
  
  <p>The output would be either a BED file or VCF which has keep track of the changes.</p>
  
  <p>What method/data structure is used to solve this problem? Would LiftOver work? Maybe CrossMap? </p>
  
  <p><a href="http://genome.sph.umich.edu/wiki/LiftOver" rel="nofollow noreferrer">http://genome.sph.umich.edu/wiki/LiftOver</a>
  <a href="http://crossmap.sourceforge.net/" rel="nofollow noreferrer">http://crossmap.sourceforge.net/</a></p>
   425: <p>If you look for a program which would randomly introduce SNPs + short indels and then would save everything into a VCF file, <a href="https://github.com/nh13/DWGSIM" rel="nofollow noreferrer">DWGsim</a> or <a href="https://github.com/seqan/seqan/blob/master/apps/mason2/README.mason_variator" rel="nofollow noreferrer">Mason Variator</a> could be a good choice. Then you can create a corresponding Chain file using <code>bcftools consensus -c</code> and transform various formats between these two coordinate systems using <a href="http://crossmap.sourceforge.net/" rel="nofollow noreferrer">CrossMap</a>.</p>
   96: <p>I've written a handful of programs from scratch to simulate mutations and variations in real or simulated sequences.</p>
  
  <p>The trick has always been to sort the variants by genomic coordinate, <strong>apply the variant with the largest coordinate first</strong>, then apply the variant with the second largest coordinate, all the way down to the variant with the smallest coordinate.</p>
  
  <p>Indels and other variants that affect sequence structure only affect <em>subsequent</em> coordinates. So going in reverse order ensures variants at the beginning of the sequence don't throw off variants at the end of the sequence.</p>
  