Questions tagged [python]
python is a programming language, widely used in bioinformatics
597
questions
1
vote
3
answers
501
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
1
answer
241
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
1
answer
58
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
1
answer
952
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
1
answer
196
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?
2
votes
1
answer
2k
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
1
answer
200
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
1
answer
54
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
0
answers
29
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
0
answers
425
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
0
answers
82
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
1
answer
63
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
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:
...
5
votes
2
answers
315
views
Why does it require 4 vectors to calculate a torsion angle?
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
1
answer
963
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
1
answer
53
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
0
answers
44
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
2
answers
591
views
Unable to execute DSSP algorithm from BioPython
I have the following settings in PyCharm:
BioPython is properly installed:
dssp_test.py
...
2
votes
2
answers
804
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
1
answer
44
views
creating a dictonary in Python
From the FASTA header I get the following information:
...
1
vote
1
answer
97
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
1
answer
279
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
3
answers
986
views
Subset GTF file for specific genes
I have a GTF file (in 'test.gtf' file):
...
1
vote
1
answer
202
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 ...
1
vote
0
answers
653
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
1
answer
839
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
0
answers
325
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
1
answer
215
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
1
answer
756
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
2
answers
758
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:
...
3
votes
1
answer
2k
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 ...
1
vote
1
answer
598
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
1
answer
224
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 ...
1
vote
0
answers
823
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
Surface ...
2
votes
1
answer
167
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
1
answer
135
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.
...
1
vote
3
answers
3k
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:
...
1
vote
0
answers
85
views
3d model of a protein via nucleotide sequence
I really appreciate @Matteo Ferla's detailed answer to my previous question.
I've already tested several tools to know if a mutation can cause a modification in the function of protein or not. There ...
3
votes
2
answers
352
views
How to make 3d model of a protein that not exist in PDB?
I'm working on nsSNPs(Non-synonymous single nucleotide polymorphisms) of protein AKAP13 whose PDB not available.
I did one mutation in this protein and I want to show the effect by 3d modeling without ...
1
vote
1
answer
41
views
querying gdc metadata issues with resulting fields
I have been trying to access metadata from the Genomic Data Commons; however, not all of the information I want is showing up in the resulting tsv file. How do I get sample type and analyte type to ...
3
votes
1
answer
631
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....
1
vote
1
answer
120
views
Querying metadata (GDC) using a filter
I have been trying to access the GDC metadata with python through the filter below. However, this code I have been using always yields a blank tsv file. Any help on fixing the code is appreciated!
<...
1
vote
1
answer
58
views
querying metadata (GDC Data Portal) in python3
I am trying to query metadata from the Genomic Data Commons (GDC) Data Portal and used the sample code from its website:
...
2
votes
3
answers
1k
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:
...
2
votes
1
answer
43
views
Automatize classical debugging in a bash script? (normal debugging by hand)
And thanks in advance. I am debugging a text file which is the one the two inputs on the program RGmatch https://bitbucket.org/pfurio/rgmatch/src/master/.
The code works. Is that some records give ...
2
votes
1
answer
475
views
Entrez (Biopython) esearch and efetch not returning sequence as expected
I'm trying to use Entrez (through Biopython) to download the sequence of a TMV replicase gene.
I have the following code:
...
4
votes
1
answer
153
views
How do you convert Raw Alignment Score to Bit Score?
I'm coding a pipeline where I make a lot of pairwise alignments, and I end up with raw alignment scores. But, I really need to look at my results in terms of bit scores.
I know that the formula is:
$𝑆...
0
votes
1
answer
175
views
How to index residues by icode in biopython?
I am indexing a structure by the code below:
...
4
votes
0
answers
50
views
How can I use statistics to compare microbial phenotypes?
Note: this question has also been asked on Biostars
I am currently trying to create a theoretical argument that a microbe's phenotype can affect gene expression in their host. I have 5 species of ...
1
vote
1
answer
154
views
10bp sliding window quality score
I am having trouble creating a 10 basepair sliding window that goes through seq and trim them all 10 basepairs that have an average quality score (...