Questions tagged [python]

python is a programming language, widely used in bioinformatics

Filter by
Sorted by
Tagged with
9 votes
3 answers
4k views

Running Snakemake in one single conda env

I have been experimenting a lot lately with Snakemake, I love it. Recently I also switched to using conda (--use-conda) in the way that is advertised. However, I have some issues with it, mostly ...
Freek's user avatar
  • 563
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: ...
user366312's user avatar
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 ...
dachi's user avatar
  • 91
1 vote
2 answers
455 views

How to sort multiple FASTA files based on their content?

I have around 10,000 FASTA files of Influenza A virus. These files contains sequences of each of the 8 segments of the viral genome and I want to separate each genome segment into a different folder ...
Neeleshwar Pandey's user avatar
1 vote
1 answer
162 views

Extract autodocked protein-ligand connections programatically

I have 2 crystal structures, one for my protein and one for my ligand (I have several protein-ligand pairs). I am using AutoDock Vina to simulate docking, which returns another file of the ligand with ...
Zac R.'s user avatar
  • 143
1 vote
2 answers
55 views

Improving list speed: glycosylation example

I discussed a question with @gaspanic Python/Biopython - Replace amino acid residue on MSA with "z" from a list of unaligned positions . The issue emerged was speeding up lists in Python. ...
M__'s user avatar
  • 11.9k
0 votes
1 answer
1k views

Using Entrez.efetch() to retrive .fasta file from any NCBI database?

I tried to use these python codes to retrieve a .fasta file from gene database, but the output were the parameters of the report ...
DurianDan's user avatar
11 votes
1 answer
3k views

Changing the record id in a FASTA file using BioPython

I have the following FASTA file, original.fasta: >foo GCTCACACATAGTTGATGCAGATGTTGAATTCACTATGAGGTGGGAGGATGTAGGGCCA I need ...
BioGeek's user avatar
  • 496
11 votes
3 answers
7k views

Converting a VCF into a FASTA given a reference with Python, R

I am interested in converting a VCF file into a FASTA file given a reference sequence with Python or R. Samtools/BCFtools (Heng Li) provides a Perl script ...
ShanZhengYang's user avatar
9 votes
1 answer
392 views

How to get the count of each kmer past 255 using khmer

I have a Fastq file and I want to get the exact count of each possible kmer from this file. On a previous post called How to use khmer to count k-mers? Daniel Standage proposed a custom script based ...
hilta007's user avatar
  • 173
9 votes
2 answers
2k views

How do you generate read-length vs read-quality plot for long-read sequencing data (e.g., MinION)?

How do you generate read-length vs read-quality plot (heat map with histograms in the margin) for long-read sequencing data from the Oxford Nanopore Technologies (ONT) MinION? The MinKNOW software ...
Mark Ebbert's user avatar
  • 1,304
8 votes
1 answer
460 views

Getting protein FASTA sequence based on keyword with python

I would like to gather proteins FASTA sequence from Entrez with python 2.7. I am looking for any proteins that have the keywords: "terminase" and "large" in their name. So far I got this code: ...
tahunami's user avatar
  • 303
7 votes
2 answers
3k views

Extracting the CIGAR string from a BAM via Python?

Is there a standard method in Python to extract a CIGAR string from the BAM? There are great libraries which parse the CIGAR, e.g. https://pypi.python.org/pypi/cigar/0.1 ...
ShanZhengYang's user avatar
7 votes
3 answers
1k views

Read PDB file, extract dihedral angles, modify dihedral angles, reconstruct Cartesian coordinates, and write PDB file

As the title summarizes, I am trying to: Read a PDB file (for example, 1enh.pdb). Extract the backbone dihedral angles (phi, psi). Modify the dihedral angles (phi, ...
epsilone's user avatar
  • 125
7 votes
1 answer
865 views

Filtering bases based on phred qualities with pysam

Is there a way to filter bases in BAM files based on phred quallities through python's pysam ? I have a code here that Takes the nucleobases per position from a BAM file using pysam's pileup ...
Ammar Sabir Cheema's user avatar
5 votes
3 answers
4k views

How to translate amino acid sequences to Nucleotide sequences

I want to convert a list of fasta ( protein sequences) in a .text file into corresponding nucleotide sequences. A Google search gives me result of DNA to protein conversion but not vice versa. Also, I ...
user3289492's user avatar
5 votes
2 answers
273 views

HDF5 and BioSQL solutions

I'm looking at better database/storage solutions for NCBI virus data, with all attributes particularly year and country of isolation, together with structural data, possible antibody data, T-cell data ...
M__'s user avatar
  • 11.9k
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
5 votes
4 answers
3k views

How to map PDB chains to Uniprot IDs using API services

I have a lot of PDB IDs and I need to get uniprot fasta sequences of these PDB IDs special chains by API services. For example, imagine that I need to get fasta sequence of '1kf6' 'A' chain. The ...
Sara's user avatar
  • 777
4 votes
2 answers
810 views

Finding a single open reading frame with ribosomal binding site, using Biopython

I'm given a Fasta file, containing a large DNA(over 115,000 long) sequence, and I am tasked with finding a single large open reading frame contained within the DNA sequence using Biopython. I'm ...
daenwaels's user avatar
3 votes
2 answers
242 views

Pepsin digest (cleavage) does not work using RE?

Aim is to code the theoretical peptic cleavage of protein sequences in Python. The cleavage (cutting) rule for pepsin is: 1234^567. This is a position, ...
Nadecho Holme Attaveesin's user avatar
3 votes
1 answer
2k views

Downloading SRA Files from AWS

I want to download the original BAM files that the authors had uploaded to SRA. Normally, I would just use sam-dump, but the files are having issues that seem ...
merv's user avatar
  • 631
3 votes
1 answer
3k views

Greedy Motif Search Using Probability Matrices

In my greedy search with pseudocounts algorithm in my bioinformatics course, I did not follow the pseudocode since I wanted to solve the problem in my own way. Unfortunately, although my answer is ...
DrJessop's user avatar
  • 131
3 votes
1 answer
602 views

python does not quit when the input file is too big

I have a script that extracts the set of unique kmer pairs from a kmer dump file (& then using them downstream to guess ploidy). The script seems to work correctly (it's reporting a meaningful ...
Kamil S Jaron's user avatar
2 votes
3 answers
553 views

Retrieve ID ligand from PDB file

I have thousands of PDB files and I need to extract the following information from each of them: an ID or the name of the small molecule (ligand) present in the complex. Is there a way to do that ...
wrong_path's user avatar
2 votes
1 answer
765 views

Remove Redundant Sequences from FASTA file in Python

I'm attempting to remove redundant sequences from a fasta file (from NCBI). When I execute this code, it returns the number of spots, not the number of sequences. (Number of spots: 408,293, Number of ...
User's user avatar
  • 53
2 votes
1 answer
57 views

Automate the def function in pandas for correlation

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

Infer the new (Ban et. al) ribosomal nomenlature (ex. uL53 ) from the ribosomal protein's sequence

I'm trying to programmatically construct a name for each protein subchain in any ribosome from Uniprot in accordance with Ban et. al's 2014 proposal (excerpt given below) using PDB's and Uniprot's ...
rtviii's user avatar
  • 342
2 votes
2 answers
1k views

Get a list of PDB ids from a list of sequence protein number?

I am working on a project about phosphorylation, and I am creating a database of some proteins. I have a list of protein accession ids for which I need to get the corresponding PDB file for each one ...
Protocol313's user avatar
1 vote
1 answer
264 views

reverse translation from amino acid string to DNA strings

what is the opposite of .translate() function calls ? I mean let's say I am given an amino acid string CYCLIC, how do I obtain all the possible combinations of DNA ...
kevin's user avatar
  • 141
1 vote
2 answers
211 views

Python/Biopython - Replace amino acid residue on MSA with "z" from a list of unaligned positions

I'm trying to programmatically replace a set of amino acid residues on an MSA with a "Z" from a list of unaligned positions. Any ideas on how I could do this? Input: a list of unaligned ...
Danny Morales's user avatar
1 vote
2 answers
231 views

Interpreting GWAS results with different settings

I did a bunch of GWAS analysis (linear model without covariates) with applying different quality controls. How to choose the optimal settings when filtering for minor allele frequency (maf), Hardy-...
snowflake's user avatar
  • 147
1 vote
1 answer
59 views

How to allow "half windows" in biopython?

I am using Biopython to examine protein sequences including the Kyte and Doolittle hydrophobicity. However, for short sequences, this returns an empty value; the value is not allowed if the window ...
James's user avatar
  • 409
1 vote
0 answers
197 views

Trying to download a large number of files from ENA programmatically

I am downloading a large number of files from the ENA in Python using Multithreading. As an example, to be more concrete, I tried downloading 12 files simultaneously using 12 threads. I noticed that ...
An Ignorant Wanderer's user avatar
0 votes
1 answer
951 views

How to convert mzXML to mzML format (mass spectrometry files)?

How to convert mzXML to mzML format (mass spectrometry files) preferably under Linux and/or Python?
Soerendip's user avatar
  • 1,295
0 votes
2 answers
56 views

How to obtain desired output?

I am working on a project using the following command within nano: ...
andnowmywatchbegins's user avatar
0 votes
0 answers
198 views

GWAS phenotype data format and preprocessing

I have a set of different phenotypes which I want to use for a GWAS analysis (general linear model). I have a couple of questions and uncertainty about the phenotype data input. I have control and ...
snowflake's user avatar
  • 147
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. ...
user366312's user avatar
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