Exercise 2

A GenomicAlignBlock represents an alignment between two or more regions of genomic DNA. Within these blocks every region of genomic DNA is represented by a GenomicAlign object.

a) Print the LASTZ-NET alignments for pig chromosome 15 with cow (using pig coordinates 105734307 and 105739335).

Hint: use the MethodLinkSpeciesSet adaptor fetch_by_method_link_type_registry_aliases() method (eg. $mlss_adaptor->fetch_by_method_link_type_registry_aliases("LASTZ_NET", ["pig", "cow"])).

you will need a *core* slice for pig chromosome 15.

get a GenomicAlignBlock adaptor and use the fetch_all_by_MethodLinkSpeciesSet_Slice() method to retrieve the genomic_align_block object(s).

use the GenomicAlignBlock restrict_between_reference_positions() method to "restrict" the genomic_align_block between base pairs 105734307 and 105739335.

finally print the alignment using the GenomicAlignBlock get_SimpleAlign() method (use AlignIO to format the output alignment).

b) Change the above example so that it prints the 13-way eutherian mammal (EPO) multiple alignments.

Hint: use the MethodLinkSpeciesSet adaptor fetch_by_method_link_type_species_set_name() method (the method_link_type is "EPO" and the species_set_name is "mammals"). 



Stephen explains the answers to these questions in this 6 min video. You can download his sample scripts and outputs:

a) sample script and output

b) sample script and output