Questions tagged [python]

python is a programming language, widely used in bioinformatics

Filter by
Sorted by
Tagged with
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
1 answer
33 views

Running a list of apis via Python's request module

I am running the following Python code with python requests in my Jupiter notebook to get cancer oncology id's from EBI-EMBL. ...
Megha's user avatar
  • 395
1 vote
1 answer
863 views

How to extract residues from specific chain of interest from multiple pdb files?

I'm new to biopython & I'm trying to extract residues from specific chain of each file from a list of 316 pdb files. Eg: 1d8t has four chains A, B, C & D of which my interest is to extract ...
Husna Riyaz's user avatar
0 votes
1 answer
89 views

Python; Question about the append (modifying lists): why modifying a list with append changes others? [closed]

I have a list named dict_eg1 whose values are lists. ...
Apppii092's user avatar
0 votes
1 answer
80 views

Pipeline for paired end RNA sequence data to proteins

Forgive the basic question here, but I'm super novice at this ... I have a series of paired-end RNA fastq files (e.g. SRR10720226_1.fastq.gz and ...
agf1997's user avatar
  • 101
2 votes
1 answer
73 views

Biopython reads my tree eternally long

I have a nexus tree (1332 taxa) with a lot of additional data. When I tried to read it through tree = Phylo.read(treepath, "nexus"), my kernel got ...
Vovin's user avatar
  • 435
1 vote
1 answer
56 views

different results of RMSD for the same trajectory file

I want to analyze the RMSD of my trajectory files using MdTraj. I used two different codes for this purpose: the first code: ...
amirre's user avatar
  • 11
0 votes
0 answers
163 views

How to do enrichment analysis with scipy.stats.hypergeom.sf function

I want to do pathway enrichment analysis in python using scipy.stats.hypergeom.sf function to select pathways that are significantly enriched in at least one tissue....
Riya's user avatar
  • 307
4 votes
2 answers
11k views

Error in seaborn plot " Horizontal orientation requires numeric `x` variable"

I am trying to plot a box plot with seaborn with the following code ...
Megha's user avatar
  • 395
2 votes
1 answer
271 views

How to create drug synergy plot?

I want to replicate the synergy drug response curve with the Python library given in the following paper. Could you kindly advice on: Suitable graphics libraries for Python Code or pseudo code ...
Riya's user avatar
  • 307
3 votes
1 answer
341 views

Multiple file Python script

I am currently doing an analysis requiring a multiple-input script. I have a directory filled with 900+ samples. Each sample is comprised of two-files in a fastq format. This is an example of a sample:...
pvp's user avatar
  • 67
5 votes
2 answers
209 views

Help using BioPython's IC_Chain functionality for getting protein 3D coordinates from torsion angles

I have been successfully using BioPython's functionality for extracting protein torsion angles using the IC_Chain module. However, I am currently looking to use the ...
CubeHead's user avatar
  • 415
2 votes
1 answer
3k views

How to sort legends alphabetically in plotly dash with category_orders function

I am using Plotly dash for creating a scatter plot. The legends I am getting in the final figure are randomly placed. I want to sort labels alphabetically from A to Z with ...
Riya's user avatar
  • 307
3 votes
1 answer
459 views

Suggestion for python graphics library to plot aligned protein sequences

I'm working towards developing some visualization method for multiple protein sequences and subsequences using PYTHON. I want to show the alignment of many fragment sequences to the original ...
The August's user avatar
3 votes
1 answer
102 views

Missing ',' in line when Biopython reads a nexus tree

I want to edit a tree that I got from BEAST2 treeannotator in nexus-format. Usually I use the module Phylo from Biopython for such work but ...
Vovin's user avatar
  • 435
3 votes
1 answer
373 views

Constructing Two Triangle Heatmaps in One Square

I'm looking to make a two, two range colour scheme heatmap where each range corresponds to a separate triangle in the heatmap square. I am looking for a relevant guide for this heatmap. Any ...
raysteven's user avatar
1 vote
1 answer
37 views

Database to download with information of bacteria?

I am looking for tidy tabular dataset that contains known bacteria and fungi down to the species level. Basically a table that includes genus and species names and other higher-level information. For ...
Soerendip's user avatar
  • 1,295
6 votes
2 answers
228 views

BioPython internal_coords module returns different dihedral angles for the (seemingly) same protein structure

I am using the internal_coords module from BioPython in order to compare dihedral angles of two different conformations of the same protein. The conformations are ...
CubeHead's user avatar
  • 415
5 votes
1 answer
359 views

Identify side chain atoms in BioPandas dataframe

I am currently implementing some metrics I could use for comparing two conformations of the same protein in Python. For example, I know I could use the RMSD of all protein ATOMS in BioPandas using ...
CubeHead's user avatar
  • 415
2 votes
2 answers
300 views

Replacing column 1 in file1 with matching ID's in file 2

I have downloaded two files: File1.csv from: https://depmap.org/portal/download/data_slicer/download?file_path=20220227%2F3c335b7d-c18e-4788-b2e6-512d71f0a339%2Fexport.csv&name=Metabolomics.csv ...
Megha's user avatar
  • 395
4 votes
1 answer
223 views

Programmatic way of accessing the FASTA sequence similarity tool (or similar) in Python

I am looking for a tool that performs a sequence similarity algorithm for proteins. More specifically, I am looking for something that would be usable in Python (or anything else usable in the command ...
CubeHead's user avatar
  • 415
2 votes
1 answer
228 views

Python argparse error

Hi I am trying to use this python script (running with bash script) to do my analysis. I am getting the following error: File "my_python_script.py", line 33 logging.info("Reading input2 ...
Riya's user avatar
  • 307
1 vote
2 answers
123 views

Bio.codonalign.codonseq module (cal_dn_ds) for SARS-COV-2

I have calculated the dN,dS ratio for a SARS-COV-2 data set ('NC_045512.2' (Wuhan strain) and 'LC666924.1'), and results in a zero value (for most of the genes). Is it possible and what is the ...
Alex's user avatar
  • 11
1 vote
1 answer
652 views

tensorflow nn_model for DNA sequences: Matrix size-incompatible: In[0]: [2,1], In[1]: [784,300]

Hope anyone can help a beginner here. I'm building a proof-of concept tensorflow classifier for DNA sequences. However, the NN model does not let through train and test vectors saying the matrix size ...
monade's user avatar
  • 11
0 votes
1 answer
69 views

if, else statment gives back else value

I have a list of protein sequence ids (names). I want to sort the lines of a table, checking if the id is equal to the first column of the table. I split the table on lines and search for the id via ...
MTG's user avatar
  • 147
0 votes
1 answer
33 views

connect same ids with values in id rows (result of effectiveELD)

I can't cope with reworking the result. If id is the same I want to stick those items. ...
MTG's user avatar
  • 147
0 votes
1 answer
268 views

Polygenic Risk Scores

I have run a GWAS and used PRSice (https://www.prsice.info/) to calculate polygenic risk scores on the data collected from the GWAS. I need to check whether alcohol dependence can predict gambling ...
Shelby Labuschagne's user avatar
3 votes
1 answer
74 views

How to extract and visualize sequence logos from CNN kernels?

I created a basic CNN architecture using Tensorflow to classify transcription factor binding sites. My aim is to somehow extract and visualize sequence logos from the convolutional kernels. The model ...
Károly Pákozdi's user avatar
0 votes
1 answer
296 views

How to process multiple VCF files present in a 2 folders and create afd plots

This question has also been asked on Biostars I have 2 directories that contains multiple VCF files. I want to write code in python that will process all vcf files and create an AFD (allele frequency ...
Anas Jamshed's user avatar
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
7 votes
2 answers
533 views

Is there any function in Biopython to convert a DNA sequence from ambiguous to unambiguous?

I have a project to write in Python that requires to write a function that given degenerate DNA sequence (for example: KKGTACACCAG) sequence and a molecular weight interval, returns a list of all ...
Ke Keiss's user avatar
2 votes
1 answer
39 views

'GCLOUD_SDK_PATH' Error

I have run into the following problem Error: failed to find 'gcloud' binary; set option or environment variable 'GCLOUD_SDK_PATH' when executing this line of R ...
Liz Litkowski's user avatar
1 vote
1 answer
376 views

makeblastdb creating multiple files of unexpectedly large sizes

I have a set of 100 amino acid sequences and I want to perform a BLASTP sesrch against the refseq_protein database. Accordingly I had set up the standalone version ...
accibio's user avatar
  • 145
1 vote
0 answers
39 views

HGVS python package : How to parse complex insertions?

In HGVS package, how to create more complex variants ? I just wonder how can I parse more complex insertions such as those : ...
jossefaz's user avatar
  • 111
1 vote
1 answer
625 views

Pymol python script for selecting a residue's sidechain and calculating its center of mass

I trying to write a pythonic PyMol script that loads a PDB, cmd.iterates through the PDB and stores the residues (three letter code) into an array. I then want to loop through this array and ...
gwot's user avatar
  • 13
4 votes
1 answer
532 views

Updating the GFF3 + Fasta to GeneBank code

I'm trying to convert gff3 and fasta into a gbk file for usage in Mauve. I've found a solution but the code is outdated: ...
raysteven's user avatar
0 votes
1 answer
136 views

How to extract part of protein complex separated with HEADER with two molecules from one PDB file

I have a PDB file which contain two molecules (receptor and ligand). Each molecule will have its own header. All in ONE PDB file. ‌The header of receptor section looks like this (line 1-6 of the PDB ...
littleworth's user avatar
1 vote
1 answer
160 views

How do you replace multiple sequence names with new names using python?

I have into a dictionary some sequences. I would like to replace the sequences name for new names contained into a dataframe. ...
Gerald Vasquez Aleman's user avatar
1 vote
0 answers
68 views

Converting miRNA names to miRBase version IDs

I have a list of miRNAs IDs (2000-2500) that I want to find miRBase IDs for them. For example: hsa-miR-106a ---> hsa-miR-106a-5p hsa-miR-373* --> hsa-miR-373-5p hsa-miR-33 --> hsa-miR-33a-5p ...
Sadaf's user avatar
  • 11
2 votes
1 answer
50 views

How to map list items which are in groups in the dictionary values and return keys corrosponding it?

...
amardeep's user avatar
1 vote
1 answer
136 views

Error while parsing gene bank file using Biopython

I am trying to extract the protein sequence of specific genes from gene bank like format file obtained from antismash part of which looks like this ...
ambika's user avatar
  • 23
1 vote
0 answers
25 views

Download COX1 (COI) gene via biopython using accessions for entire mitochondrial genomes

I have a list of accessions for the the entire mitochondrial genomes for big cats. I need to download the COX1 genes for each of these accessions. Here is one accession and here is a link to its COX1 ...
Glubbdrubb's user avatar
1 vote
2 answers
385 views

SyntaxError after end of Snakefile code?

I am trying to run Fastqc on multiple files using Snakemake but am receiving an ambiguous SyntaxError past the last line of code in the Snakefile. Snakefile: ...
Swietenia's user avatar
0 votes
1 answer
345 views

Snakemake Fastqc: "Multiple run or shell keywords in rule run_fastqc."

I am trying to check the quality of RNA-Seq data from Illumina using fastqc in snakemake in a conda environment. I get the error "Multiple run or shell keywords in rule run_fastqc". ...
Swietenia's user avatar
0 votes
1 answer
80 views

list comprehension and codon translation

I'm trying to create a python program that follows the codon translation and turn mRNA sequence into amino acids (see the dictionary). The system has to return an error of the string is not a ...
xin hwa's user avatar
0 votes
2 answers
78 views

Use biopython to align SeqRecords stored in dict

I'd like to perform multiple alignments, where a gene from each sample was read in from fasta files. The fasta file represented one sample and had multiple genes. I have read in each sample fasta file ...
Glubbdrubb's user avatar
3 votes
3 answers
172 views

Can I traverse/enumerate PDB one at a time using a Python script without downloading all of them to my local disk?

What would be the total size of all PDB files in RCSB? Can I traverse/enumerate them one at a time using a Python script without downloading all of them to my local disk? If YES, what would be the ...
user366312's user avatar
0 votes
1 answer
1k views

How to extract the protein sequences of a genbank file using R or biopython

sorry for the question, I'm trying to extract the proteins sequences from a genbank file. ...
abraham's user avatar
  • 115
1 vote
2 answers
249 views

Permutations of 4 amino acid sequence oligopeptide

I have an assignment for a project to build a tetrapeptides library to screen against some target enzymes in silicon. I am looking for a script to construct about 160000 tetrapeptide from the 20Amino ...
Ruthy's user avatar
  • 11
4 votes
1 answer
101 views

Counting hexamers in fasta sequence and identify its structure (and interruptions)

I have a lot of fasta files, each one with thousand of reads containing the hexameric motif "CCCTCT". The hexameric motif is highly continuous in most cases but interruptions may occur. I ...
Amaru's user avatar
  • 41

1 2 3
4
5
12