<div dir="ltr"><div>Dear Devs.</div><div><br></div><div>In a discussion some time ago here in the forum ( <span style="color:rgb(0,0,0)"><a href="http://lists.ensembl.org/pipermail/dev/2016-July/012031.html">http://lists.ensembl.org/pipermail/dev/2016-July/012031.html</a> </span>) regarding how I could make use of Ensembl logical canonical programming to modify a refseq gene to remove XM_ transcripts and for the selection of canonical transcripts of only NM_ transcripts,  Andy suggested that I could use something like this:</div><div><br></div><div><pre style="color:rgb(0,0,0)">my $selector = Bio::EnsEMBL::Utils::TranscriptSelector->new();
# get a gene from somewhere and modify to remove the XMs
my $canonical_transcript = $selector->select_canonical_transcript_for_Gene($gene);</pre><pre style="color:rgb(0,0,0)">I followed his advise and integrated it into my code as follows:</pre><pre style="color:rgb(0,0,0)">my $mod_gene = $gene;<br></pre><pre><font color="#000000">my $selector = Bio::EnsEMBL::Utils::TranscriptSelector->new();
foreach my $transcript (@{$mod_gene->get_all_Transcripts()}){
        if ($options->{query} =~ /refseq/ && $transcript->stable_id() !~ /^NM_/){
                $mod_gene->remove_Transcript($transcript);
        }
}
my $canonical_transcript = $selector->select_canonical_transcript_for_Gene($mod_gene);
$mod_gene->canonical_transcript($canonical_transcript);
        
$gene=$mod_gene;<br></font></pre><pre style="color:rgb(0,0,0)"><br></pre><pre style="color:rgb(0,0,0)">This seems to do the job, however my script keeps issuing warnings </pre><pre style="color:rgb(0,0,0)"><br></pre><pre><font color="#000000">-------------------- WARNING ----------------------
MSG: Running without CCDS DB
FILE: EnsEMBL/Utils/TranscriptSelector.pm LINE: 80
CALLED BY: getFeatures.pl  LINE: 985
Date (localtime)    = Fri Jul  7 17:32:54 2017
Ensembl API version = 83</font><font face="arial, sans-serif"><span style="white-space:normal">
</span></font></pre><div>---------------------------------------------------<br></div><div><br></div><div>I believe the problem is that I am not providing a CCDS DB on the line </div><div><pre><font color="#000000">my $selector = Bio::EnsEMBL::Utils::TranscriptSelector->new();</font></pre></div><div>I read the documentation and that seems to be an optional parameter.</div><div><br></div><div>Can you tell me if this is a problem and if it is how I can set the CCDS DB and if not how I can stop these warnings being issued?</div><div><br></div><div>Many thanks</div><div><br></div></div><div>Duarte</div></div>