Questions tagged [python]

python is a programming language, widely used in bioinformatics

Filter by
Sorted by
Tagged with
0 votes
0 answers
3 views

Output amino acid mutations relative to reference sequence

I have a reference peptide sequence and a list of child sequences which contain a range of mutations, insertions and deletions. I would like to compare the child to reference and output the ...
user avatar
-3 votes
0 answers
28 views

How to convert a WDL file to a JSON file? [closed]

I want to convert a WDL file into a JSON using python.
user avatar
0 votes
0 answers
10 views

How to access BOLD timeseries data using atlas-Schaefer2018_desc-400Parcels with Python?

So basically I have this code ...
user avatar
  • 1
0 votes
1 answer
16 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: ...
user avatar
  • 1
0 votes
0 answers
17 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....
user avatar
  • 99
3 votes
2 answers
358 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 ...
user avatar
  • 117
2 votes
1 answer
57 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 ...
user avatar
  • 99
3 votes
1 answer
94 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:...
user avatar
2 votes
1 answer
43 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 ...
user avatar
  • 99
3 votes
1 answer
38 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 ...
user avatar
3 votes
1 answer
47 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 ...
user avatar
  • 121
1 vote
1 answer
23 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 ...
user avatar
  • 1,181
2 votes
2 answers
190 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 ...
user avatar
  • 117
4 votes
1 answer
66 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 ...
user avatar
  • 385
2 votes
1 answer
49 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 ...
user avatar
  • 99
1 vote
1 answer
87 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 ...
user avatar
  • 11
0 votes
1 answer
62 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 ...
user avatar
  • 93
0 votes
1 answer
32 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. ...
user avatar
  • 93
0 votes
1 answer
44 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 ...
user avatar
2 votes
1 answer
33 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 ...
user avatar
1 vote
1 answer
51 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 ...
user avatar
1 vote
1 answer
33 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 ...
user avatar
0 votes
0 answers
16 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 : ...
user avatar
  • 101
1 vote
1 answer
122 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 ...
user avatar
  • 13
0 votes
0 answers
103 views

Convert ICD 9 to ICD 10 in Python

I'd like to convert ICD 9 codes to ICD 10 codes in Python. I looked for tools to do this, and I found this one. However, the ICD gets updated regularly and this tool relies on a static mapping from ...
user avatar
0 votes
1 answer
38 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 ...
user avatar
  • 155
1 vote
1 answer
72 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. ...
user avatar
2 votes
1 answer
40 views

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

...
user avatar
0 votes
1 answer
60 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 ...
user avatar
  • 13
1 vote
2 answers
143 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: ...
user avatar
0 votes
1 answer
136 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". ...
user avatar
0 votes
1 answer
26 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 ...
user avatar
2 votes
2 answers
57 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 ...
user avatar
0 votes
1 answer
146 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. ...
user avatar
  • 115
1 vote
2 answers
145 views

How can I programmatically add a Hydrogen 'Atom' to a 'Residue' object?

I know the algorithm for creating a Hydrogen atom and adding to a residue: ...
user avatar
0 votes
0 answers
20 views

Can you style network visualizations of directed graphs using NETWULF?

I want to draw directed graphs using networkx, followed by manual tuning of the visualization with the use of NETWOLF. Here is the example of a network. ...
user avatar
1 vote
1 answer
27 views

Using python to call Emboss wordcount

Hi guys I would like to run wordcount from Emboss in a bunch of fasta files. I tried this: ...
user avatar
0 votes
1 answer
171 views

In Pygraphviz, How can I assign edge colors according to edge weights?

I am now drawing a weighted directed graph using Pygraphviz. The adjacency matrix A of the weighted directed graph is ...
user avatar
0 votes
1 answer
84 views

How can I identify acceptor and donor atoms using BioPython?

I know how to traverse through structures, models, residues, and atoms in a protein chain using BioPython (which is very easy). How can I identify donor and acceptor atoms in a chain?
user avatar
0 votes
1 answer
223 views

How can I programmatically add Hydrogen to a PDB structure using BioPython?

I need to programmatically add Hydrogen atoms to a PDB file (say, 16PK.pdb) using BioPython. What algorithm should I use for this?
user avatar
0 votes
1 answer
61 views

How can I get a list of neighboring Hydrogen atoms of an alpha-carbon?

Suppose, I want to find the neighboring Hydrogen atoms of a specific C-alpha atom. The following was my effort. However, it produces a bunch of empty lists. ...
user avatar
0 votes
1 answer
19 views

How can I calculate the distance w.r.t. a beta sheet?

Suppose, I have a protein (say, 16PK). and, I want to calculate the distance between one of its alpha-carbons and the nearest beta-sheet. the distance between two strands in a beta-sheet (i, j). How ...
user avatar
1 vote
0 answers
24 views

In CIRIquant output, which column shows the expression level of circular?

I am running CIRIquant on Ubuntu 16.04 LTS following the instruction which indicated on https://ciriquant-cookbook.readthedocs.io/en/latest/de.html. I got .GTF file ...
user avatar
0 votes
0 answers
133 views

pysam "Exec format" error

I am a beginner and trying to read a bam file in Python. The lines below throw the error ...
user avatar
  • 11
0 votes
0 answers
44 views

Error in running CIRIquant package for 2 RNA-seq in Ubuntu 16.04

"CIRIquant" is a Python package for detecting Circular RNA. I ran "CIRIquant" individually and it was run. consequently, I ran CIRIquant through the below command and parameters in ...
user avatar
1 vote
1 answer
39 views

Error to running "CIRIquant" function in CIRIquant package at python Language

"CIRIquant" is a Python package for detecting Circular RNA. I installed "CIRIquant" through the below command in terminal: pip install CIRIquant My Linux distribution is Ubuntu ...
user avatar
0 votes
0 answers
17 views

Why does it require four vectors to calculate a torsion angle? [duplicate]

The BioPython documentation shows the following: 11.6.3 Measuring torsion angles Use the vector representation of the atomic coordinates and the calc dihedral function from the Vector module: ...
user avatar
1 vote
1 answer
330 views

Snakemake: Accept any of a possible set of inputs (any one being sufficient)

I have a little pipeline that I want to execute using Snakemake. One of my rules (let's call it create_somefile) creates a file ...
user avatar
3 votes
1 answer
50 views

How to optimize the number of amplicons ordered for a PCR wet experiment with several genomic ROIs?

Imagine we have an experiment for which we would like to minimize the number of purchased primers. Let's look at the layout of a single primer below: Assume we have a precomputed set of all necessary ...
user avatar
  • 1,347
1 vote
0 answers
29 views

AttributeError: 'FeatureDB' object has no attribute 'strand'

It appers when a gene has a negative strand then I need to reverse the sequence. Unfortunately, I got the following error: ...
user avatar

1
2 3 4 5
8