bioMart Package error: error in function useDataset - biomart

I am trying to use the biomaRt package to access the data from Ensembl, however I got error message when using the useDataset() function. My codes are shown below.
library(httr)
listMarts()
ensembl = useMart("ENSEMBL_MART_ENSEMBL")
listDatasets(ensemble)
ensembl = useDataset("hsapiens_gene_ensembl",mart = ensemble)
When I type useDataset function i got error message like this:
> ensembl = useDataset("hsapiens_gene_ensembl",mart = ensembl)
Ensembl site unresponsive, trying asia mirror
Error in textConnection(text, encoding = "UTF-8") :
invalid 'text' argument
and sometimes another different error message showed as:
> ensembl = useDataset("hsapiens_gene_ensembl",mart = ensembl)
Ensembl site unresponsive, trying asia mirror
Error in textConnection(bmResult) : invalid 'text' argument
it seems like that the mirror automatically change to asia OR useast OR uswest, but the error message still shows up over and over again, and i don't know what to do.
So if anyone could help me with this? I will be very grateful for any help or suggestion.
Kind regards Riley Qiu, Dongguan, China

Related

Error occurred on routing_api __get _route response status code 403

I'd like to compute the travel time between two points. So I use the RoutingApi from herepy library (as reported in the example at https://github.com/abdullahselek/HerePy/blob/master/examples/routing_api.py):
from herepy import (
RoutingApi,
RouteMode,
MatrixRoutingType,
MatrixSummaryAttribute,
RoutingTransportMode,
RoutingMode,
RoutingApiReturnField,
RoutingMetric,
RoutingApiSpanField,
AvoidArea,
AvoidFeature,
Avoid,
Truck,
ShippedHazardousGood,
TunnelCategory,
TruckType,
)
routing_api = RoutingApi(api_key="my_key")
response = routing_api.truck_route(
waypoint_a=[lat_a, lon_a],
waypoint_b=[lat_b, lon_b],
modes=[RouteMode.truck, RouteMode.fastest],
)
print(response.as_dict())
Though, even if my api key is valid and "enabled" on the HERE developer platform, I get the following error message:
HEREError: Error occurred on routing_api __get _route response status code 403
Can anyone explain to me why is this happening and how to solve that? Thank you in advance.
The issue is with coordinates.
Looking at the example at https://github.com/abdullahselek/HerePy/blob/master/examples/routing_api.py
if you try:
response = routing.car_route(waypoint_a=[41.9798, -87.8801], waypoint_b=[41.9043, -87.9216], modes=[herepy.RouteMode.car, herepy.RouteMode.fastest])
print(response.as_dict())
it should work.

Binance API in python APIError(code=-1121): Invalid symbol

I am trying to code a binance Buy function. However the code
from binance.enums import *
order = client.create_order(symbol='DOGEUSDT', side = 'BUY', type = 'MARKET', quantity = 475, timeInForce='GTC')
this code outputs > APIError(code=-1121): Invalid symbol.
Also, for the same symbol,
print(client.get_symbol_info(symbol="DOGEUSDT"))
ouptuts > None
The symbol DOGEUSDT exists is the orderbook. https://api.binance.com/api/v3/ticker/bookTicker
I dont know why the same symbol I get from binance is invalid.
Are you using the testnet? I had the same error, however when I removed testnet=True from the client initialization the error was resolved.
two things can happen
client.API_URL = https://testnet.binance.vision/api
in that case change it to
https://api.binance.com/api
Client(api_key, secret_key, testnet=True)
in that case change testnet=False or delete it

AwesomeWM: Error when initialising a theme

I've currently started using the AwesomeWM and started configuring it. I struggle at theming: whenever I try to change the theme, I get this error message:
https://i.stack.imgur.com/vAbuW.png
It tells me that the error is on the line 553/554, but if I don't adjust any themes, they work without any errors.
Code for theming:
local theme_path = string.format("%s/.config/awesome/themes/%s/theme.lua", os.getenv("HOME"), "powerarrow")
beautiful.init(theme_path)
Lines the error says are wrong (553/554):
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
So, what's the problem?

Python firebase_admin.credentials has no attribute Certificate

I'm currently developing for GCP and had used this code already many many times (this is running on RPI3 python 3.7)
def createClient(projid, dev_name):
base = os.getcwd()
base = base.replace("\\",'/')
keydir = '{}/Devices/{}/firebase.json'.format(base, projid.lower())
print(keydir)
cred = credentials.Certificate(keydir)
firebase_admin.initialize_app(cred, {
'databaseURL': 'https://{}.firebaseio.com/'.format(projid.lower())
}, name= dev_name)
But now the code fails with message:
module 'firebase_admin.credentials' has no attribute 'Certificate'>
Please note this code it's working correctly in other RPI why is this not working?!
the error occurs in this line of code:
cred = credentials.Certificate(keydir)
anyone with a clue would be very very appreciated.
Kind Regards!
Edit: I've tried with:
cred = credentials.RefreshToken(keydir)
still the same result now with the error:
module 'firebase_admin.credentials' has no attribute 'RefreshToken'>
note I'm using a service account json file as a key.
Edit2: I missed to add this info in the original post:
firebase-admin==2.17.0
this is all running in a Raspberry Pi 3 B+ (RPI)

Sprite object is not iterable, Platform Game (Python)

I am creating a platform game. I was trying to do a platform that went constantly up and down like an elevator, when i got this error: TypeError: 'Sprite' object is not iterable.
Here's the code related to the elevator:
IN SET UP:
self.platform_list = arcade.SpriteList()
self.elevator = arcade.Sprite()
for i in range(600,800,32):
self.elevator =
arcade.Sprite("imagenes/platformer/Ground/dirt_grass.png", SCALE_PLATFORMS)
self.elevator.center_x = i
self.elevator.center_y = 420
self.elevator.change_y = 2
self.platform_list.append(self.elevator)
IN UPDATE:
self.platform_list.update()
for plat in self.elevator :
if plat.center_y > 680 :
plat.change_y = - 2
if plat.center_y < 400 :
plat.change_y = 2
if i change the update by replacing plat for self.elevator, and get rid of the for, only one block of the ones that conform the platform goes up and down, the rest goes up without stoping, and gets out of the screen. I have tried also changing the for by "for self.elevator in self.platform_list" and then changing plat for self.elevator, but when i execute it, all platforms move up and down.
¿How can i fix this? Please help me.

Resources