Read with sequencing errors taken from a reference sequence
Usage
use Bio::Seq::SimulatedRead; use Bio::PrimarySeq; # Create a reference sequence my $genome = Bio::PrimarySeq->new( -id => 'human_chr2', -seq => 'TAAAAAAACCCCTG', -desc => 'The human genome' ); # A 10-bp error-free read taken from a genome my $read = Bio::Seq::SimulatedRead->new( -reference => $genome , # sequence to generate the read from -id => 'read001', # read ID -start => 3 , # start of the read on the genome forward strand -end => 12 , # end of the read on the genome forward strand -strand => 1 , # genome strand that the read is on ); # Display the sequence of the read print $read->seq."\n"; # Add a tag or MID to the beginning of the read $read->mid('ACGT'); # Add sequencing errors (error positions are 1-based and relative to the # error-free MID-containing read) my $errors = {}; $errors->{'8'}->{'+'} = 'AAA'; # insertion of AAA after residue 8 $errors->{'1'}->{'%'} = 'G'; # substitution of residue 1 by a G $errors->{'4'}->{'-'} = undef; # deletion of residue 4 $read->errors($errors); # Display the sequence of the read with errors print $read->seq."\n"; # String representation of where the read came from and its errors print $read->desc."\n";
Overview
This object is a simulated read with sequencing errors. The user can provide a reference sequence to take a read from, the position and orientation of the read on the reference sequence, and the sequencing errors to generate.
The sequence of the read is automatically calculated based on this information. By default, the description of the reads contain tracking information and will look like this (Bioperl-style):
reference=human_chr2 start=3 end=12 strand=-1 mid=ACGT errors=1%G,4-,8+AAA description="The human genome"
or Genbank-style:
reference=human_chr2 position=complement(3..12) mid=ACGT errors=1%G,4-,8+AAA description="The human genome"
Creating a simulated read follows these steps: 1/ Define the read start(), end(), strand() and qual_levels() if you want quality scores to be generated. Do not change these values once set because the read will not be updated. 2/ Specify the reference sequence that the read should be taken from. Once this is done, you have a fully functional read. Do not use the reference() method again after you have gone to the next step. 3/ Use mid() to input a MID (or tag or barcode) to add to the beginning of the read. You can change the MID until you go to next step. 4/ Give sequencing error specifications using errors() as the last step. You can do that as many times as you like, and the read will be updated.
Releases
7 releases since Debian 7 (Wheezy); the text changed 5 times.