<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Exactly !!!!<div><br></div><div>Thank you very much for your help !</div><div><br></div><div>Regards</div><div><br><div><div>On 28 Jan 2013, at 17:03, "Kathryn Beal" <<a href="mailto:kbeal@ebi.ac.uk">kbeal@ebi.ac.uk</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi,</div><div>How about:</div><div><br></div><div><div>    foreach my $aln_slice (@{$align_slice->get_all_Slices()}) {</div><div>        my $slices = $aln_slice->get_all_underlying_Slices;</div><div>        foreach my $this_slice (@$slices) {</div><div>            print $aln_slice->genome_db->name . ":"  . $this_slice->seq_region_name . ":" . $this_slice->start . ":" . $this_slice->end . ":" . $this_slice->strand . "\n";</div><div>        }</div><div>    }</div></div><div><br></div><div>This gives the following output:</div><div><br></div><div><div>mus_musculus:2:28403186:28403879:1</div><div>homo_sapiens:9:100149814:100149843:-1</div><div>homo_sapiens:GL000220.1:11378:11383:-1</div><div>homo_sapiens:9:135978315:135979072:-1</div></div><div><br></div><div>Cheers</div><div>Kathryn</div><br><div apple-content-edited="true">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Kathryn Beal, PhD<br>European Bioinformatics Institute  (EMBL-EBI)<br>Wellcome Trust Genome Campus, Hinxton<br>Cambridge CB10 1SD, UK <br>Tel. +44 (0)1223 494458<br><a href="http://www.ensembl.org/">www.ensembl.org</a><br></div></span></div></div>
</div>
<br><div><div>On 28 Jan 2013, at 15:40, Eduardo Andrés León wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">umm, but I lost the coordinates (which I really need them)<div><br></div><div><br><div><div>On 28 Jan 2013, at 14:35, "Kathryn Beal" <<a href="mailto:kbeal@ebi.ac.uk">kbeal@ebi.ac.uk</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi,</div><div>You can use the AlignSlice to get the alignment, i.e. add the following lines:</div><div><br></div><div><div>my $align_slice_adaptor =</div><div>      Bio::EnsEMBL::Registry->get_adaptor("Multi", "compara", "AlignSlice");</div></div><div><br></div><div><div>my $align_slice = $align_slice_adaptor->fetch_by_Slice_MethodLinkSpeciesSet($source_org_slice, $methodLinkSpeciesSet, 'expanded', 'restrict');</div><div><br></div><div>print $alignIO $align_slice->get_SimpleAlign;</div></div><div><br></div><div>I also used the "clustalw" as the format for AlignIO.</div><div><br></div><div>I hope that helps,</div><div>Cheers</div><div>Kathryn</div><br><div apple-content-edited="true">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Kathryn Beal, PhD<br>European Bioinformatics Institute  (EMBL-EBI)<br>Wellcome Trust Genome Campus, Hinxton<br>Cambridge CB10 1SD, UK <br>Tel. +44 (0)1223 494458<br><a href="http://www.ensembl.org/">www.ensembl.org</a><br></div></div></div>
</div>
<br><div><div>On 28 Jan 2013, at 10:27, Eduardo Andrés León wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Dear all,<div><span class="Apple-tab-span" style="white-space:pre">      </span>I'm trying to match the mouse sequence(2-28403186:28403879)  into the human genome using ensembl 67.</div><div><br></div><div>Using the web, I've got the following :</div><div><br></div><div><a href="http://may2012.archive.ensembl.org/Mus_musculus/Location/Compara_Alignments?align=410&db=core&r=2%3A28403186-28403879">http://may2012.archive.ensembl.org/Mus_musculus/Location/Compara_Alignments?align=410&db=core&r=2%3A28403186-28403879</a></div><div><br></div><div><table style="color: rgb(85, 85, 85); font-family: 'Luxi Sans', Helvetica, Arial, Geneva, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); position: static; z-index: auto; "><tbody><tr style="vertical-align: top; "><th style="font-size: 1em; text-align: left; border: 0px; color: rgb(51, 51, 51); ">mus_musculus:2 > </th><td style="font-size: 1em; text-align: left; border: 0px; color: rgb(51, 51, 51); "><a href="http://may2012.archive.ensembl.org/Mus_musculus/Location/View?db=core;r=2:28403186-28403879" style="color: rgb(0, 0, 102); ">chromosome:NCBIM37:2:28403186:28403879:1</a><br></td></tr><tr style="vertical-align: top; "><th style="font-size: 1em; text-align: left; border: 0px; color: rgb(51, 51, 51); ">homo_sapiens:9 > </th><td style="font-size: 1em; text-align: left; border: 0px; color: rgb(51, 51, 51); "><a href="http://may2012.archive.ensembl.org/Homo_sapiens/Location/View?r=9:100149814-100149843" style="color: rgb(0, 0, 102); ">chromosome:GRCh37:9:100149814:100149843:-1</a><br><a href="http://may2012.archive.ensembl.org/Homo_sapiens/Location/View?r=GL000220.1:11378-11383" style="color: rgb(0, 0, 102); ">supercontig:GRCh37:GL000220.1:11378:11383:-1</a><br><a href="http://may2012.archive.ensembl.org/Homo_sapiens/Location/View?r=9:135978315-135979072" style="color: rgb(0, 0, 102); ">chromosome:GRCh37:9:135978315:135979072:-1</a><br><br></td></tr></tbody></table><br></div><div><br></div><div>But when I use the API, I obtain more than 55 fragments (attached as a zip file) :</div><div><br></div><div></div></div><span><alignment.3012.17691580863.txt.zip></span><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div></div><div><br></div><div>The code for extracting the data is the following :</div><div><br></div><div>getAlignMent(2,28403186,28403879);</div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>sub getAlignMent{</div><div><span class="Apple-tab-span" style="white-space:pre">            </span>my ($source_org_chr,$source_org_start,$source_org_end)=@_;</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">          </span>#Auto-configure the registry</div><div><span class="Apple-tab-span" style="white-space:pre">         </span>Bio::EnsEMBL::Registry->load_registry_from_db(</div><div><span class="Apple-tab-span" style="white-space:pre">                    </span>-host=>"<a href="http://ensembldb.cnio.es/">ensembldb.cnio.es</a>",</div><div><span class="Apple-tab-span" style="white-space:pre">                       </span>-user=>"ensembl");</div><div><br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">            </span># Get the Compara Adaptor for MethodLinkSpeciesSets</div><div><span class="Apple-tab-span" style="white-space:pre">          </span>my $method_link_species_set_adaptor =</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>    Bio::EnsEMBL::Registry->get_adaptor(</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>      "Multi", "compara", "MethodLinkSpeciesSet");</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">             </span># Get the MethodLinkSpecieSet for source_org-mouse lastz-net alignments</div><div><span class="Apple-tab-span" style="white-space:pre">              </span>my $methodLinkSpeciesSet = $method_link_species_set_adaptor-></div><div><span class="Apple-tab-span" style="white-space:pre">                     </span>fetch_by_method_link_type_registry_aliases("BLASTZ_NET", ["mouse", "human"]);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">         </span># Define the start and end positions for the alignment</div><div><span class="Apple-tab-span" style="white-space:pre">               </span># Get the source_org *core* Adaptor for Slices</div><div><span class="Apple-tab-span" style="white-space:pre">               </span>my $source_org_slice_adaptor =</div><div><span class="Apple-tab-span" style="white-space:pre">               </span>    Bio::EnsEMBL::Registry->get_adaptor(</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>      "mouse", "core", "Slice");</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">               </span># Get the slice corresponding to the region of interest</div><div><span class="Apple-tab-span" style="white-space:pre">              </span>my $source_org_slice = $source_org_slice_adaptor->fetch_by_region(</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>    "chromosome", $source_org_chr, $source_org_start, $source_org_end);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">         </span># Get the Compara Adaptor for GenomicAlignBlocks</div><div><span class="Apple-tab-span" style="white-space:pre">             </span>my $genomic_align_block_adaptor =</div><div><span class="Apple-tab-span" style="white-space:pre">            </span>    Bio::EnsEMBL::Registry->get_adaptor(</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>      "Multi", "compara", "GenomicAlignBlock");</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span># The fetch_all_by_MethodLinkSpeciesSet_Slice() returns a ref.</div><div><span class="Apple-tab-span" style="white-space:pre">               </span># to an array of GenomicAlingBlock objects (source_org is the reference species) </div><div><span class="Apple-tab-span" style="white-space:pre">               </span>my $all_genomic_align_blocks = $genomic_align_block_adaptor-></div><div><span class="Apple-tab-span" style="white-space:pre">             </span>    fetch_all_by_MethodLinkSpeciesSet_Slice(</div><div><span class="Apple-tab-span" style="white-space:pre">               </span>        $methodLinkSpeciesSet, $source_org_slice, undef, undef, "restrict");</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">          </span># set up an AlignIO to format SimpleAlign output</div><div><span class="Apple-tab-span" style="white-space:pre">             </span>my $outputAl="alignment." . rand(10000) . ".txt";</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>open(OUT,">$outputAl") || die "3 $!\n";</div><div><span class="Apple-tab-span" style="white-space:pre">               </span>my $alignIO = Bio::AlignIO->newFh(-interleaved => 0,</div><div><span class="Apple-tab-span" style="white-space:pre">           </span>                                  -fh => \*OUT,</div><div><span class="Apple-tab-span" style="white-space:pre">              </span>                                  -format => 'pfam',</div><div><span class="Apple-tab-span" style="white-space:pre">         </span>                                  -idlength => 20);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">         </span># print the restricted alignments</div><div><span class="Apple-tab-span" style="white-space:pre">            </span>if (scalar(@{$all_genomic_align_blocks})==0){</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>open(NMR,">>chr$source_org_chr\_No_mapping_regions.txt") || die "$!\n";</div><div><span class="Apple-tab-span" style="white-space:pre">                    </span>print NMR "$source_org_chr\t$source_org_start\t$source_org_end\n";</div><div><span class="Apple-tab-span" style="white-space:pre">                 </span>close NMR;</div><div><span class="Apple-tab-span" style="white-space:pre">                   </span>return();</div><div><span class="Apple-tab-span" style="white-space:pre">            </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">            </span>else{</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>foreach my $genomic_align_block ( @{ $all_genomic_align_blocks } ) {</div><div><span class="Apple-tab-span" style="white-space:pre">                         </span>print $alignIO $genomic_align_block->get_SimpleAlign;</div><div><span class="Apple-tab-span" style="white-space:pre">                     </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">                    </span>close OUT;</div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">    </span>}</div></div><div><br></div><div>This same happens with other segments, but not all of them.</div><div><br></div><div>So, can anybody tell me how to extract the same records the web shows ?</div><div><br></div><div>Regards and thanks in advance !</div><div><br></div><div><br></div><div><br></div><div><br></div></div>_______________________________________________<br>Dev mailing list    <a href="mailto:Dev@ensembl.org">Dev@ensembl.org</a><br>Posting guidelines and subscribe/unsubscribe info: <a href="http://lists.ensembl.org/mailman/listinfo/dev">http://lists.ensembl.org/mailman/listinfo/dev</a><br>Ensembl Blog: <a href="http://www.ensembl.info/">http://www.ensembl.info/</a><br></blockquote></div><br></div>_______________________________________________<br>Dev mailing list    <a href="mailto:Dev@ensembl.org">Dev@ensembl.org</a><br>Posting guidelines and subscribe/unsubscribe info: <a href="http://lists.ensembl.org/mailman/listinfo/dev">http://lists.ensembl.org/mailman/listinfo/dev</a><br>Ensembl Blog: <a href="http://www.ensembl.info/">http://www.ensembl.info/</a><br></blockquote></div><br><div apple-content-edited="true">
<div style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="font-size: 12px; ">===================================================<br>Eduardo Andrés León<br>Tlfn: (+34) 91 732 80 00 / 91 224 69 00 (ext 5054/3063)<br>e-mail: <a href="mailto:eandres@cnio.es">eandres@cnio.es</a>        Fax: (+34) 91 224 69 76<br>Unidad de Bioinformática       Bioinformatics Unit<br>Centro Nacional de Investigaciones Oncológicas<br>C.P.: 28029                Zip Code: 28029<br>C/. Melchor Fernández Almagro, 3    Madrid (Spain)</div><div style="font-size: 12px; "><a href="http://bioinfo.cnio.es/">http://bioinfo.cnio.es</a><span class="Apple-tab-span" style="white-space: pre; ">   </span><a href="http://bioinfo.cnio.es/people/eandres">http://bioinfo.cnio.es/people/eandres</a><br>===================================================</div></div>
</div>
<br></div></div>_______________________________________________<br>Dev mailing list    <a href="mailto:Dev@ensembl.org">Dev@ensembl.org</a><br>Posting guidelines and subscribe/unsubscribe info: <a href="http://lists.ensembl.org/mailman/listinfo/dev">http://lists.ensembl.org/mailman/listinfo/dev</a><br>Ensembl Blog: <a href="http://www.ensembl.info/">http://www.ensembl.info/</a><br></blockquote></div><br></div>_______________________________________________<br>Dev mailing list    <a href="mailto:Dev@ensembl.org">Dev@ensembl.org</a><br>Posting guidelines and subscribe/unsubscribe info: <a href="http://lists.ensembl.org/mailman/listinfo/dev">http://lists.ensembl.org/mailman/listinfo/dev</a><br>Ensembl Blog: <a href="http://www.ensembl.info/">http://www.ensembl.info/</a><br></blockquote></div><br><div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="font-size: 12px; ">===================================================<br>Eduardo Andrés León<br>Tlfn: (+34) 91 732 80 00 / 91 224 69 00 (ext 5054/3063)<br>e-mail: <a href="mailto:eandres@cnio.es">eandres@cnio.es</a>        Fax: (+34) 91 224 69 76<br>Unidad de Bioinformática       Bioinformatics Unit<br>Centro Nacional de Investigaciones Oncológicas<br>C.P.: 28029                Zip Code: 28029<br>C/. Melchor Fernández Almagro, 3    Madrid (Spain)</div><div style="font-size: 12px; "><a href="http://bioinfo.cnio.es">http://bioinfo.cnio.es</a><span class="Apple-tab-span" style="white-space: pre; ">       </span>http://bioinfo.cnio.es/people/eandres<br>===================================================</div></div>
</div>
<br></div></body></html>