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/
SeqIO.to_dict
function that seems to do your data reading in one step $\endgroup$