Questions tagged [python]

python is a programming language, widely used in bioinformatics

Filter by
Sorted by
Tagged with
0
votes
0answers
7 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 ...
0
votes
0answers
17 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 ...
0
votes
1answer
24 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 ...
1
vote
1answer
60 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. ...
0
votes
1answer
39 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 ...
1
vote
2answers
51 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: ...
0
votes
1answer
43 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". ...
0
votes
1answer
23 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 ...
2
votes
2answers
49 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 ...
0
votes
1answer
90 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. ...
1
vote
2answers
97 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: ...
0
votes
0answers
8 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. ...
1
vote
1answer
19 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: ...
0
votes
1answer
21 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 ...
0
votes
1answer
64 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?
0
votes
1answer
34 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?
0
votes
1answer
34 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. ...
0
votes
1answer
12 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 ...
1
vote
0answers
18 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 ...
0
votes
0answers
29 views

pysam "Exec format" error

I am a beginner and trying to read a bam file in Python. The lines below throw the error ...
0
votes
0answers
23 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 ...
1
vote
1answer
31 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 ...
0
votes
0answers
16 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: ...
1
vote
1answer
101 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 ...
3
votes
1answer
49 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 ...
1
vote
0answers
27 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: ...
0
votes
1answer
43 views

Unable to execute DSSP algorithm from BioPython

I have the following settings in PyCharm: BioPython is properly installed: dssp_test.py ...
1
vote
1answer
80 views

snakemake multiple parameters for multiple input and single output in snakemake. ConbineGVCFs gatk problem

I have written a rule for CombineGVCFs in gatk4. The rule is as follow ...
0
votes
1answer
41 views

creating a dictonary in Python

From the FASTA header I get the following information: ...
1
vote
1answer
34 views

How to plot the gap distribution of contigs wrt to reference genome

I have a contigs file that I generated using Minia and then I have used Minimap2 to map these contigs again to the reference genome. Now I want to plot the gap distribution i.e. gap distance of the ...
0
votes
1answer
56 views

Help to understand the code for dipeptide composition calculation (in python)

Dipeptide composition of a protein sequence is the number of times a particular dipeptide (e.g. Arginine-Histidine) occurs in a sequence divided by the total number of dipeptides in the sequence (...
3
votes
3answers
105 views

Subset GTF file for specific genes

I have a GTF file (in 'test.gtf' file): ...
1
vote
1answer
52 views

Translate all reads in a .fastq into protein sequence from deep mutational scanning experiment

I'm working with paired-end NGS reads from an Illumina platform. The sequences I have are all of the same gene, but have one or more substitution mutations each. Here is a rough workflow for ...
0
votes
0answers
48 views

How to get a consensus sequence from a nanopore fastq files?

I am new in bioinformatic field. I would like to know a way to generate a consensus sequence from nanopore fastq files (fastq files demultiplexed). I usually generate a consensus sequence with "...
1
vote
1answer
39 views

How can I calculate the distances between two specific residues of a protein from a PDB file?

Suppose, we have a protein (16PK). We are considering a 5-residue segment/window. If we assume ASN10 to be the ...
0
votes
0answers
67 views

BWA-MEM2 alignment-Snakemake

I have started using snakemake 6.5.2 to align fastq files with reference file. I have pasted the error below in this question. How to allocate memory in the snakefile and read the header from samfile, ...
0
votes
1answer
43 views

How to Read SCF file in Python?

Is there any way that I can read SCF file in python like in R using sangerseqR, I have tried with Biopython, it seems it does not support this format.
0
votes
0answers
16 views

Retrieve gene symbols of genes from GO term with Python

Is there a way to retrieve the gene symbols belonging to a GO term with Python ? For example, the GO:0006096 (glycolytic process) contains 96 genes: ...
0
votes
1answer
111 views

PyMol: Output Polar Contacts Between Chains to Text File

I am new to PyMOL but have a very specific task that I need to do. I have a PDB structure file of protein homo-oligomer, and I want to use PyMol to determine polar contacts between chain A and all ...
-1
votes
2answers
156 views

How to read and edit a FASTA file with python using regular expression?

I have a file containing protein sequence information of 100 odd proteins. Each sequence starts with a header that looks like this: ...
4
votes
1answer
322 views

R limma alternatives in Python

The R package limma is ideal to perform differential expression analysis. Is there any limma alternative in Python? I'm trying ...
0
votes
1answer
33 views

Python script to simultaneously generate multiple pdbqt files for AutoDockTools?

I have a folder of pdb ligand structures that I'd like to test in some docking experiments with a certain protein using AutoDock Vina. I am not familiar with Python so I've always been using the ...
0
votes
1answer
25 views

calculating kmer nucleotide frequency per column

I have a list of sequences: CAGGTAGCC CCGGTCAGA AGGGTTTGA TTGGTGAGG CAAGTATGA ACTGTATGC CTGGTAACC Each sequence is nine nucleotides long. I want to calculate ...
0
votes
0answers
120 views

Python script to calculate properties of amino acids and storing them in matrix

I want to make a python script that can get as input sequence of N amino acids, and the output is a matrix of Nx6 containing 6 features. The features are: Computed volume Hydrophobicity Polarity ...
2
votes
1answer
46 views

ensembldb equivalent in python

Is there a python equivalent to ensembldb? I want to get genome coordinates for a transcript (like the function transcriptToGenome) but need to do it in python. I ...
0
votes
1answer
41 views

Time complexity of the Neighbors function

I implemented the following find_neighbors_with_expected_hamming_distance function that generates all k-mers of Hamming distance at most d from the given Pattern. ...
0
votes
3answers
182 views

Count of each sequence length from a fasta file with header using len function of python

I have a fasta file with 18 sequences inside. I want to extract the length of each sequence with header using the len function. My file looks like: ...
3
votes
1answer
101 views

Programmatically adding hydrogen and remove water to multiple PDB files

I'm trying to dock a ligand to several hundred PDB files (receptors). I thus need to prepare the those PDB files like removing water and adding hydrogen. I can do that manually using Autodock or Pymol....
2
votes
3answers
278 views

How to extract subset of protein structure (PDB format) file based on a subsequence of that protein

I looking at a particular protein structure called 2LY4 accessible from RSCB PDB website. The corresponding fasta sequence for that structure is this: ...

1
2 3 4 5
7