Tag: KeyError

h5ad cellxgene to R

I am trying to bring this small dataset (1496 cells, 43MB) from cellxgene. 1 R SeuratDisk h5ad to h5seurat and then to seurat. library(SeuratDisk) SeuratDisk::Convert(“local.h5ad”, dest = “local.h5seurat”, overwrite=TRUE) g <- SeuratDisk::LoadH5Seurat(“local.h5seurat”, meta.data=FALSE, misc=FALSE) Validating h5Seurat file Initializing RNA with data Adding counts for RNA Adding feature-level metadata for RNA…

Continue Reading h5ad cellxgene to R

Named Server and unique Workdirectories – JupyterHub

Is there somehow possible to define individual working directories for each named server?(e.g. /home/jupyter-USERNAME/Servername/) The background is that I would like to use a named server for each project I am working on and only have access to the data for this project. Currently, all Named Servers use the same…

Continue Reading Named Server and unique Workdirectories – JupyterHub

pytorch geometric dgcnn

package manager since it installs all dependencies. (defualt: 5), num_electrodes (int) The number of electrodes. I plugged the DGCNN model into my semantic segmentation framework in which I use other models like PointNet or PointNet++ without problems. This commit does not belong to any branch on this repository, and may…

Continue Reading pytorch geometric dgcnn

‘validation/main/loss’ in pytorch when use multiple gpu in training

hi, I use aishell recipe and running asr_train.py. When I use single GPU, it work well. However, when I use 2GPU, it finish training at the end of first epoch and throw the error: KeyError: ‘validation/main/loss’ error. [J/home/lcf/anaconda3/envs/python36/lib/python3.6/site-packages/torch/nn/parallel/_functions.py:61: UserWarning: Was asked to gather along dimension 0, but all input tensors…

Continue Reading ‘validation/main/loss’ in pytorch when use multiple gpu in training

Failed to start service – nbgrader with jupyterhub – JupyterHub

csee May 16, 2023, 12:39pm 1 I try to get nbgrader to run with a jupyterhub 2.3 but get an error (Failed to start service)It seems to be because a user is not found as it says:jupyterhub | File “/usr/local/lib/python3.8/dist-packages/jupyterhub/spawner.py”, line 1487, in user_envjupyterhub | home = pwd.getpwnam(self.user.name).pw_dirjupyterhub | KeyError:…

Continue Reading Failed to start service – nbgrader with jupyterhub – JupyterHub

pytorch – I’m having trouble applying mmdetection

I made the custom format dataset follow the MS coco format. Then, I placed the jpg image where the json file is. The train dataset file structure is as follows. mmdetection/data/coco/train/annotation_data/, mmdetection/data/coco/train/image_data test dataset follows.. mmdetection/data/coco/test/image_data, no annotaion data! val dataset follows.. mmdetection/data/coco/val/annotation_data, mmdetection/data/coco/val/image_data The annotaion json file is organized…

Continue Reading pytorch – I’m having trouble applying mmdetection

Jupyerhub spawner failing with an exception: “Initial list of events failed” – Zero to JupyterHub on Kubernetes

I am installing jupyterhub on k8s cluster using the following instructions z2jh.jupyter.org Installing JupyterHub With a Kubernetes cluster cluster available and Helm installed, we can install JupyterHub in the Kubernetes cluster using the JupyterHub Helm chart. Initialize a Helm chart configuration file: Helm… Kubectl Client Version: v1.27.1Kubectl Server Version: v1.20.12helm…

Continue Reading Jupyerhub spawner failing with an exception: “Initial list of events failed” – Zero to JupyterHub on Kubernetes

How to Auto-Create Users for SimpleLocalProcessSpawner on 3rd Party Login alongside Conda? – JupyterHub

Context:I am trying to setup JupyterHub (on a single EC2 server, HTTPS is provided via a reverse Nginx proxy URL) such that a small number of users authenticate with a 3rd party Solution (KeyCloak) and upon redirect back to the JupyterHub/Lab will automatically have a user created for them locally….

Continue Reading How to Auto-Create Users for SimpleLocalProcessSpawner on 3rd Party Login alongside Conda? – JupyterHub

python – KeyError while printing trace in pymc3

I’m tring to perform the spectral unmixing technique with the MCMC algorithm. But I encountered a problem while I ran it. This is the part of the code I’m running: import pymc3 as pm import theano.tensor as tt import arviz as az “”” Perform the spectral unmixing through a MCMC…

Continue Reading python – KeyError while printing trace in pymc3

Error when running prepDE.py in Stringtie

Error when running prepDE.py in Stringtie 0 Hi, I was trying to execute prepDE.py and Command: prepDE.py -i sample_gene.lst I get the following error: $ prepDE.py -i sample_gene.lst Error: could not locate transcript ENST00000618889 entry for sample CASE2 Traceback (most recent call last): File “/data/leehyobin/Step0_RawFile/stringtie/stringtie/prepDE.py”, line 284, in geneDict.setdefault(geneIDs[i],{}) #gene_id…

Continue Reading Error when running prepDE.py in Stringtie

Biopython to compute the distance between residues

Biopython to compute the distance between residues 1 Hello, I am trying to use Biopython to find the distance between the alpha carbons for a pair of residues in a model: from Bio.PDB.PDBParser import PDBParser parser = PDBParser() structure = parser.get_structure(“4HHB”, “4HHB.pdb”) # Create a list of all the residues…

Continue Reading Biopython to compute the distance between residues

find the mate of a read using pysam

I just came across this problem, and this is the solution I’m using right now. I’m sharing it here as it is one of the first and most recent posts that comes after googling. My use case is as follows: I have a list of positions I need to analyze…

Continue Reading find the mate of a read using pysam

How to include spatial coordinate data into anndata within scanpy

Hello I am working on 10X visium spatial transcriptome data which was processed in seurat pacakge with image data. For my downstream analysis, I am trying to import seurat normalized data into scanpy. For this I converted seurat object to h5ad using these steps. SaveH5Seurat(test_object, overwrite = TRUE, filename =…

Continue Reading How to include spatial coordinate data into anndata within scanpy

python – Error occurred while selecting a specific atom in a PDB file using Biopython

The following is a partial content of my PDB file. I want to set the C2 atom as the coordinate origin, but the code shows an error. HETATM 1 C1 UNL A 1 -2.791 -1.310 0.787 1.00 0.00 C HETATM 2 C2 UNL A 1 -3.711 -0.441 0.007 1.00 0.00…

Continue Reading python – Error occurred while selecting a specific atom in a PDB file using Biopython

Define roles that allow my users to access to custom managed services – Zero to JupyterHub on Kubernetes

Hello, I try to allow my users to access my subservices I definied. The service renders an extra HTML Page on the Screen in Jupyterhub. It works fine as long as I use it as admin, but in production, the users don´t have admin rights and get a permission denied…

Continue Reading Define roles that allow my users to access to custom managed services – Zero to JupyterHub on Kubernetes

KubeSpawner failed to start pod due to key error – Zero to JupyterHub on Kubernetes

Using kubespawner to spawn , but get below error future: <Task finished coro=<KubeSpawner._start_reflector..catch_reflector_start() done, defined at /opt/middleware/anaconda_python/3.7.11/lib/python3.7/site-packages/kubespawner/spawner.py:2418> exception=SystemExit(1)>Traceback (most recent call last):File “/opt/middleware/anaconda_python/3.7.11/lib/python3.7/site-packages/kubespawner/spawner.py”, line 2420, in catch_reflector_startawait fFile “/opt/middleware/anaconda_python/3.7.11/lib/python3.7/site-packages/kubespawner/reflector.py”, line 383, in startawait self._list_and_update()File “/opt/middleware/anaconda_python/3.7.11/lib/python3.7/site-packages/kubespawner/reflector.py”, line 233, in _list_and_updatefor p in initial_resources[“items”]KeyError: ‘items’ Read more here: Source link

Continue Reading KubeSpawner failed to start pod due to key error – Zero to JupyterHub on Kubernetes

machine learning – Python PyTorch RNN chat bot index out of range in self error

I was trying to make RNN chatbot with PyTorch but : return F.embedding( File “/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/torch/nn/functional.py”, line 2043, in embedding return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse) IndexError: index out of range in self Kod bu: import torch import torch.nn as nn import torch.nn.functional as F import requests from bs4 import BeautifulSoup…

Continue Reading machine learning – Python PyTorch RNN chat bot index out of range in self error

Scipy factorial ImportError on Kaggle

I am not able to import statsmodel.api into kaggle kernel … ImportError: cannot import name ‘factorial’. I’ve upgraded the scipy package, and I am still getting the same error. I am new to… Read more > issue with auto.arima import | Data Science and … – Kaggle But after that,…

Continue Reading Scipy factorial ImportError on Kaggle

How to use gseapy after scanpy?

Hello, I analyzed some data using scanpy and now I want to do some pathway analysis. I have done DE analysis between each cluster and the rest and I want to do the pathway analysis for each cluster but I have a few questions. I initially followed the instructions from…

Continue Reading How to use gseapy after scanpy?

pandas – Logistic Regression with scikit-learn giving key error while printing output as : KeyError: ‘Logistic Regression’

plt.figure(figsize = (12,7)) ax = sns.barplot(x = models,y = accuracy_list) plt.xlabel(“Classifiers”,fontsize = 15) plt.ylabel(“Accuracy (%)”, fontsize =15) for p in ax.patches: width = p.get_width() height = p.get_height() x= p.get_x() y = p.get_y() ax.annotate(f”{height} %”,(x + width/2 , y + height*1.01),ha = “center”) plt.show() while i’m runing the above code i…

Continue Reading pandas – Logistic Regression with scikit-learn giving key error while printing output as : KeyError: ‘Logistic Regression’

Substitute variables in an expression in Sagemath

Somewhat similar to this question, I was trying to evaluate a Boolean expression given the right hand side variables in Sage. For simplicity, say, my Boolean expression is, $y=x_0+x_1$. For each of $(x_0,x_1) in {(0,0),(0,1),(1,0),(1,1)}$, I want to evaluate $y$. This is the basic code block to get started. Note…

Continue Reading Substitute variables in an expression in Sagemath

Leaderboard download fails if leaderboard only contains one page

kaggle competitions leaderboard –download lux-ai-2021  ✔  kaggle  Traceback (most recent call last): File “/usr/local/Caskroom/miniforge/base/envs/kaggle/bin/kaggle”, line 11, in <module> sys.exit(main()) File “/usr/local/Caskroom/miniforge/base/envs/kaggle/lib/python3.9/site-packages/kaggle/cli.py”, line 67, in main out = args.func(**command_args) File “/usr/local/Caskroom/miniforge/base/envs/kaggle/lib/python3.9/site-packages/kaggle/api/kaggle_api_extended.py”, line 831, in competition_leaderboard_cli self.competition_leaderboard_download(competition, path, quiet) File “/usr/local/Caskroom/miniforge/base/envs/kaggle/lib/python3.9/site-packages/kaggle/api/kaggle_api_extended.py”, line 784, in competition_leaderboard_download self.download_file(response, outfile, quiet) File…

Continue Reading Leaderboard download fails if leaderboard only contains one page

Get chromosome sizes from fasta file

Get chromosome sizes from fasta file 4 Hello, I’m wondering whether there is a program that could calculate chromosome sizes from any fasta file? The idea is to generate a tab file like the one expected in bedtools genomecov for example. I know there’s the fetchChromSize program from UCSC, but…

Continue Reading Get chromosome sizes from fasta file