Questions tagged [pandas]

Python module widely used in data science designed around database commands and calculations

Filter by
Sorted by
Tagged with
1 vote
0 answers
18 views

Trying to plot the results of GSEA in python

I'm having some major chaos with the output table generated and then passing that to my plot function. New to this (1st time), could somebody review this piece of code and suggest some corrections. I ...
aleksk31's user avatar
1 vote
2 answers
559 views

ValueError: count not convert string to float

I'm trying to use a Python script to plot with a rolling window using pandas and seaborn. This code worked for the longest time but now it's giving me an error that I don't know how to fix. Here is ...
rimo's user avatar
  • 963
0 votes
0 answers
21 views

Using PANDA to infer gene regulatory networks without ppi

I'm using this tutorial (https://github.com/netZoo/netZooM/blob/master/tutorials/panda/panda.pdf) to use PANDA to infer gene regulatory networks, but without ppi values (which I've been told can be ...
Feynman's user avatar
  • 71
0 votes
0 answers
23 views

Compare in Python / PyRanges two genomic intervals to determine whether they're separate, partially overlapping, or contained

As part of a larger analysis, I need to evaluate pairs of genomic regions (regionsA and regionsB) and perform different ...
Einar's user avatar
  • 131
1 vote
2 answers
34 views

Getting rid of duplicates in a dictionary

I have a tsv file that lists the reads and read lengths from a FASTA file but some reads are duplicated - that's just from the analysis I did previously - but I want to only take one instance of the ...
rimo's user avatar
  • 963
0 votes
1 answer
284 views

Refactoring pandas using an iterator via chunksize

This question was also asked on Stack Overflow Bioinformatics rationale eggNOG files can be very big and sump all available RAM for regular to medium sized desktops. I am looking for advice on using ...
M__'s user avatar
  • 12.3k
1 vote
1 answer
43 views

Tidying MEGAN Taxonomy for Python/R Analysis

I am analysing some WGS data in MEGAN and would like to do some additional analysis in Python/R I am having trouble Tidying the Taxonomic data in a format which would be conducive to this. Originally ...
dunc4n's user avatar
  • 35
1 vote
1 answer
27 views

How to get enriched pathways in the data using continous statistic measure?

I was doing pathway enrichment analysis using the below code ...
Megha's user avatar
  • 395
1 vote
1 answer
35 views

How to calculate frequency of a category with respect to the value in another column?

I was trying to calculate the frequency of disease_present (yes) when smoking status is y (yes) for each group (A, B, C, D) <...
Tom Morgan's user avatar
3 votes
3 answers
1k views

How to run python request for list of url's with multiple page numbers?

Hi I am trying to get the cancer ontologies (obo_id and label) from EBI-OLS. Earlier I have used the below code to get the obo_id terms and ...
Megha's user avatar
  • 395
4 votes
1 answer
180 views

calculating mutation frequencies for every gene

I have a dataset for mutation data and I want to calculate mutation frequencies across all genes df (This is only the small subset of data) ...
Priya's user avatar
  • 351
2 votes
1 answer
131 views

Math on Pandas Columns

I have a pandas dataframe that reads in a PAF file from minimap2. What I would like to do is take the first 5 columns of the data from to create a BED file. I used this to extract the first 5 columns: ...
rimo's user avatar
  • 963
2 votes
1 answer
58 views

Automate the def function in pandas for correlation

...
Riya's user avatar
  • 307
2 votes
1 answer
89 views

Python list comprehension to calculate the set of categories for each row

My data = data ...
Megha's user avatar
  • 395
2 votes
2 answers
62 views

expansions and contractions from OrthoFinder

The input file looks like this, and the complete file can be found here: ...
user3523406's user avatar
4 votes
1 answer
139 views

How to fix the Error in Kruskal Wallis rank sum test for comparing the guides in python? Also to check whether using the right test for my data?

df ...
Priya's user avatar
  • 351
2 votes
1 answer
479 views

How to get separate histograms plots on the basis of the column value?How to detect which plot has most deviation?

I have a data frame (df) which has correlations calculated for different genes with respect to different ID combinations. I want to get separate histogram plot based on the gene name (separate plot ...
Riya's user avatar
  • 307
3 votes
1 answer
219 views

Merge the dataframes with python iterator

I have 3 experiment files (File1.tsv, File2.tsv, File3.tsv) from three experiments and 1 library file (library_file.tsv). I want ...
Riya's user avatar
  • 307
-2 votes
2 answers
383 views

Merge data frame on either of the 2 columns in R or python

I have two data frames. One data frame with one column and second data frame with two columns. I need to merge first data frame with either column of the second data frame and returns the values. ...
Nithya Chandramohan's user avatar
1 vote
1 answer
124 views

HTTP status code: 400 "Value must be an integer" error uploading JSON schema results to benchling

I am writing a benchling uploader script in python to upload data from a csv file in a JSON formatted schema to the benchling API platform. My function to create the JSON schema in the script looks ...
Joe_G's user avatar
  • 101
2 votes
3 answers
119 views

How to merge multiple list into a single dataframe replacing common values with 1 -python

I have multiple lists on python: ...
Marco's user avatar
  • 161
2 votes
2 answers
74 views

To create a new column with Pandas on the basis of two types of column values

I have a data frame df. The below table only represent top 8 rows of the data frame. There are multiple combination of ...
Priya's user avatar
  • 351
1 vote
3 answers
3k views

Help to create a dataframe in Python from a FASTA file

I want to create a dataframe in Python starting from a FASTA format file. Given the toy FASTA file that I am attaching, I built this program in Python that returns four colums corresponding to id, ...
HelpNeederStudent's user avatar
2 votes
1 answer
75 views

How can I use pandas agg here to avoid iteration?

can anyone help me improve this pandas code? ...
Liam McIntyre's user avatar
1 vote
1 answer
52 views

Adding multiple dataframes to compare against genotypes - DATE/LOCATION - geotemporal incidences of SARS2 genotypes

I'm trying to reuse some code I have previously used to add extra parameters. In the initial code, it was used to give a 1/0 counter if a specific mutation was present (first code below) ...
Theo Jones's user avatar
0 votes
1 answer
318 views

Converting hmmer --tblout to pandas dataframe [closed]

Is there a way to convert a hmmer output to a pandas dataframe? I am also unsure how to load a hmmer tblout table into python via the Bio module. I believe you can call a hmmer format with SeqIO.parse ...
Cody Glickman's user avatar
0 votes
1 answer
105 views

how do i change a variable with iterator under a for loop in python

This question comes up in my bioinfo class. I have a csv file containing gene names and the cluster they belong to. I want to run GESA on each individual cluster. So I would like to extract the list ...
Zeyuan's user avatar
  • 163
2 votes
1 answer
163 views

Possibility to save output blastn table in memory using biopython

Is there a possibility, using biopython to save output table of blastn in memory, not in file on hard drive, for process it using pandas for example and then delete it from memory? I mean, is there a ...
Hood's user avatar
  • 53
3 votes
1 answer
228 views

How to load output from the kegg API in biopython into a pandas dataframe?

Biopython provides a (bit unintuitive) API to access to the Kyoto Encyclopedia of Genes and Genomes (KEGG). I am trying to make use of it, but the output is quite unhandy as a string. What is the best ...
Soerendip's user avatar
  • 1,295
8 votes
4 answers
2k views

How to do `bedtools intersection` using pandas alone?

I have two pandas Dataframes, using python3.x: ...
EB2127's user avatar
  • 1,413