[ensembl-dev] perl api question

Andy Yates ayates at ebi.ac.uk
Mon Apr 15 23:11:26 BST 2013


Hi Gary,

I think the problem comes from an extra bit of whitespace at the end of your IDs. I wrote a little one liner with your file as input (I had to pass it through dos2unix due to windows line termination issues):

head -n 10 ~/Downloads/id.txt | dos2unix | perl -l -ne 'chomp $_; print "^${_}^";'

This outputted:

^DDB_G0273945 ^
^DDB_G0283581 ^
^DDB_G0281895 ^
^DDB_G0268118 ^
^DDB_G0280775 ^
^DDB_G0292574 ^
^DDB_G0287059 ^
^DDB_G0274891 ^
^DDB_G0286559 ^
^DDB_G0272574 ^

I think rather than just chomping the lines you'd be better off doing a regex replace for all whitespace e.g.

while(my $stable_id = <$fh>){
	$stable_id =~ s/\s+//g;
	my $gene = $gene_adaptor->fetch_by_stable_id($stable_id);
}

As for your connection to Ensembl Genomes this is fine since you're after Dicty data.

Hope this helps,

Andy

On 15 Apr 2013, at 17:46, Gary Duncan <gryduncan at gmail.com> wrote:

> the login info is bogus off at old not longer functioning server so no big deal
> thanks will look in to it
> 
> 
> On Mon, Apr 15, 2013 at 11:18 AM, Kieron Taylor <ktaylor at ebi.ac.uk> wrote:
> Hi Gary,
> 
> The IDs you are quizzing Ensembl with are unknown to me. I can only find them in "dictyBase", which we do not refer to. They may be stable IDs of a sort, but not of Ensembl origin, therefore using fetch_by_stable_id will return nothing.
> 
> The code itself looks ok.
> 
> If you have the information readily available, you should try using the gene names instead ( ->fetch_by_display_name ), or find other identifiers that you can feed into our Xref system. ( ->fetch_by_external_name )
> 
> There is a password for you local database in the script you sent to the mailing list. If this is a security concern, you should change it immediately.
> 
> Regards,
> 
> -- 
> Kieron Taylor PhD.
> Ensembl Core team
> EBI
> 
> 
> On 15/04/2013 16:43, Gary Duncan wrote:
> the Perl scrip list all databases but doesn't download the files I
> have attached the Perl script and the data file with ids.  Please help
> and thanks for your help in this matter.
> 
> 
> _______________________________________________
> Dev mailing list    Dev at ensembl.org
> Posting guidelines and subscribe/unsubscribe info: http://lists.ensembl.org/mailman/listinfo/dev
> Ensembl Blog: http://www.ensembl.info/
> 
> 
> 
> 
> 
> _______________________________________________
> Dev mailing list    Dev at ensembl.org
> Posting guidelines and subscribe/unsubscribe info: http://lists.ensembl.org/mailman/listinfo/dev
> Ensembl Blog: http://www.ensembl.info/
> 
> _______________________________________________
> Dev mailing list    Dev at ensembl.org
> Posting guidelines and subscribe/unsubscribe info: http://lists.ensembl.org/mailman/listinfo/dev
> Ensembl Blog: http://www.ensembl.info/





More information about the Dev mailing list