Questions tagged [python]
python is a programming language, widely used in bioinformatics
597
questions
1
vote
1
answer
325
views
Filtering out all seqs with mutations of list2 from list1
I have 2 lists, list1 and list2, of protein sequences of the same given gene in different strains. In ...
1
vote
4
answers
566
views
Convert population allele count into population allele frequency by using Perl or Python (translate available Bash into Perl or Python)
I already know the Bash AWK solution and also R code for the question that I am asking. But, my file is so big and with R it takes very long time and I am afraid of AWK's mistake for this computation, ...
1
vote
1
answer
55
views
Using pythoncyc to get ec-code of a reaction
I am trying to collect the ec-code (and gene) of a reaction. I have tried the following:
...
0
votes
1
answer
95
views
Biopython code refactoring
I want to make function get_abstract, but i don't know what this can look like if the function must return idlist.
...
2
votes
0
answers
485
views
How to prevent sklearn Imputer(missing_values="NaN", strategy="mean", axis=0).fit_transform(data) from removing columns with only NA in them [closed]
I am trying to test a preexisting python machine learning script with a subset of my genetic data. One of the feature columns I am using happens to only have NA values in it. I lose this column when ...
4
votes
1
answer
357
views
Adding entries to bigwig file
I generate bigwig files using a shell script based on bedtools genomecov (to generate a bedgraph from a bam file) bedmap (to ...
0
votes
2
answers
593
views
Mutations in sequences relative to reference (histogram)
I have a reference sequence of amino acids that I compare other sequences to using Bio.pairwise2.align.globalmx of Biopython package (one to many compare - one by ...
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 ...
3
votes
2
answers
1k
views
How do I export my biom object to a file in biom format?
I'm using the python API for the biom-format package. I read in two files in biom format and merged them, like so:
...
2
votes
1
answer
1k
views
Counting number of possible alignments between two DNA sequences using python
I was looking BioPython to calculate the number of possible alignments between two sequences. Let's say there are two input sequences with the length of m and n. The program will count the possible ...
3
votes
1
answer
1k
views
Find Patterns in Cluster
I have a heatmap and I would like to find some rectangles.
I have already used clustermap. But here, I can not calculate these rectangles.
The order of the data should not be changed.
This Code is ...
4
votes
1
answer
1k
views
How to obtain clusters of hierarchical heatmap when using Python?
Is there a good way of obtaining the labels (e.g. genes) within individual clusters that haven been clustered hierarchically in Python (preferentially, but not necessarily, by seaborn)?
I found these ...
3
votes
2
answers
310
views
help with CRCmapper
I'm using CRCmapper on my data. There are several modules in the tool. I've used exactly instructed in the usage.
Commands used:
...
6
votes
3
answers
2k
views
How can I extract gene names for a metabolic pathway from KEGG?
Note: this question has also been asked on Biostars
I need the get the list of gene names involved in glycolysis (to put an example). Not manually, I need to do this in a script. Ideally with Python. ...
3
votes
2
answers
435
views
pvalue calculation of protein-protein network with permutation test
Note: this question has also been asked on Biostars
I have performed a network recreation analysis based on the interactions of proteins from String db.
I wanted to know if the interactions have ...
5
votes
3
answers
2k
views
Way to get genomic sequences at given coordinates without downloading fasta files of whole chromosomes/genomes first?
So I have a list of start and stop positions along chromosomes in different species, and I'd like to get the corresponding DNA sequence for each set of coordinates. In the past, I've just download the ...
5
votes
2
answers
707
views
Is it possible to do alignment within Python? Check variants against reference?
I'm currently adding a few SNPs randomly into a FASTA within python using BioPython. In the following example from BioPython, I add an SNV at location "5"
http://biopython.org/DIST/docs/api/Bio.Seq....
4
votes
2
answers
580
views
Transform traditional blast output to `--outfmt 6`
I have run a blastx of metagenomic databases (raw illumina reads) using the nr database. Unfortunately, I forgot to add the --outfmt 6 argument to the code and got ...
2
votes
0
answers
277
views
How to measure euclidean distance between points with vtkDelaunay3D package?
I'm working with python vtkDelaunay3D (scipy.spatial.Delaunay) package for a special purpose. Normally the package is used for triangulation/tetrahedralisation.
How do I measure euclidean distance ...
2
votes
2
answers
928
views
How to interconvert InChI and InChIKey?
I would like to retrieve IDs from several databases using InChI as an input, e.g.
...
5
votes
1
answer
731
views
Read and write FASTA files with more information than id and sequence
I am trying to read a fasta file, manipulate is in Python (using BioPython) and then write it back.
The format of my sequences is like:
...
3
votes
1
answer
534
views
How to retrieve InChI key for KEGG compound?
I would like to retrieve the InChI representation for a given KEGG compound but I fail to find a direct solution for this (preferably doing it via bioservices).
One could do it via ChEBI like this:
...
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 ...
4
votes
1
answer
88
views
Cannot install chromosomer
I am trying to install chromosomer but I fail. Can anybody help me, please?
...
6
votes
2
answers
908
views
How can I edit a specific FASTQ read in place, given the read ID?
I am introducing SNVs into specific samples in order to estimate false negative rates for a variant calling pipeline. I know reads can be simulated but I would actually prefer to use the real data so ...
4
votes
1
answer
190
views
Biopython: resseq doesn't match pdb file
I have a PDB file, and I need to extract its residue sequence numbers (resSeq's). Based on manual inspection of the first few lines of the PDB file (pasted below), I would think that resSeq's should ...
8
votes
2
answers
3k
views
Subset FASTA file by species name
I have a problem: I've managed to download a massive fasta file of 1500 sequences, but now I want to split them into separate fasta files based on the genus.
EDIT
The fasta file looks like this:
...
4
votes
2
answers
9k
views
RNAseq: Z score, Intensity, and Resources
I'm very new to bioinformatics in general, and I'm trying to understand some basic concepts.
I have RNAseq data, and bioinformatics people tell me that intensities cannot be compared across patients. ...
8
votes
1
answer
1k
views
How GFF3 attributes (9th column) varies from one gene prediction algorithm to another
GFF3 files are in tabular format with 9 fields per line, separated by tabs. The first 8 fields share almost same data structure, but the 9th field varies a lot depending on feature type and gene ...
7
votes
1
answer
615
views
Reject reads with low quality bases from a Bam file through pysam
I have a code below:
...
7
votes
1
answer
862
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 ...
8
votes
1
answer
459
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:
...
6
votes
0
answers
977
views
changing blast parameters using NCBIWWW module
I have found a blog post with a script that I would like to use for my current research project: link
The script is incredibly fast and produces a smooth conservation plot. In the blog post, the ...
13
votes
3
answers
2k
views
How can I do an overlapping sequence count in Biopython?
Biopython's .count() methods, like Python's str.count(), perform a non-overlapping count, how can I do an overlapping one?
For ...
4
votes
1
answer
66
views
Software to produce a table of post-translational modifications from a peptide list
Does anyone know if there is a program/library/script in R or Python that takes as input a list of proteins/peptides and a list of post-translational modifications (PTMs; like oxidation of methionine ...
4
votes
5
answers
3k
views
using python to write bioinformatics pipelines tutorial
I was wondering if there is a tutorial or a small code snippet to understand how to write bioinformatics pipeline using python, for example
use a aligner (say hisat)
get the output and process it ...
6
votes
2
answers
371
views
Is there any way of using biopython to write Swissprot files?
I have the following mwe for filtering a Swissprot file based on a certain feature, in this case, transmembrane regions.
...
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 ...
14
votes
3
answers
6k
views
How do you write a .gz fastq file with Biopython?
How do you write a .gz (or .bgz) fastq file using ...
6
votes
1
answer
1k
views
How to maximize fastq parsing with FastqGeneralIterator (Bio.SeqIO.QualityIO)
I'm contributing to a python-based project that uses Biopython to analyze fastq files. It currently uses SeqIO.parse, which ...
5
votes
4
answers
2k
views
Range overlap python error with genomic regions
I have two files
s3.txt :
1 10 20
1 5 20
2 20 30
2 25 30
1 10 50
2 20 60
1 14 17
s4.txt:
1 10 20
2 20 30
I am trying to match col0 ...
4
votes
2
answers
272
views
After artificially creating events in a FASTA file, how do I keep track of the old coordinates?
I'm beginning with the reference genome in FASTA format, hg19. I am reading the sequence into a Python dictionary with BioPython:
...
3
votes
1
answer
195
views
Why do BLASTn and prokka not seem to be searching the whole fasta file?
When I use blastn and prokka (I will detail exactly how I did so below) on a 2.8 million bp fasta file I get output start/end numbers that do not seem to cover the entire genome.
Starting with a ....
4
votes
1
answer
198
views
Preparing binary matrix data for Scikit classification algorithms
I made this post in regular stack overflow but I was told about this awesome feature by @nbryans.
I am a researcher (my programming knowledge is small) conducting analysis on a set of antibiotic (...
1
vote
4
answers
1k
views
For what bioinformatics tasks is Biopython more adapted than Bioperl?
Are there any advantages to learning Biopython instead of learning Bioperl?
Ideally, we would learn both, but someone starting out in bioinformatics may have to choose what to learn first depending ...
7
votes
2
answers
245
views
What methods should I use from PythonCyc API to query metabolites in BioCyc database?
I am using PythonCyc API in order to write a query for metabolites in BioCyc. The purpose of this API is to communicate with the database software of BioCyc- Pathway Tools. Pathway Tools is in lisp ...
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 ...