Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [python]

python is a programming language, widely used in bioinformatics

0
votes
1answer
46 views

filter secondary alignments using pysam

I am new to python and trying to learn. The below is an attempt to filter out secondary reads in a bam using ...
5
votes
2answers
210 views

What does “fetching by region is not available for SAM files” mean?

I am used to gzip/biopython solutions when dealing with sequencing data, but now I wish to switch to more elegant ...
1
vote
2answers
25 views

Is there a tool to convert a variableStep .wig to fixedStep one?

I have a .wig file in this format: variableStep chrom=chr1 span=20 59965 7 59985 10 60005 10 60025 10 and I would like to format it to something like ...
1
vote
1answer
15 views

Aligned base strand in pysam `pileupcolumn`

Is it possible that on the same pileupcolumn object (i.e a specific aligned base) I find the same base but aligned to different strands? For example, can I find a coverage of 50 'A's that align to ...
0
votes
0answers
17 views

How to retrieve the best-scoring Trinity isoform from blastx results

I'm working on a somewhat unusual transcriptome focused on a killer X chromosome. This chromosome has some new genes, with expression levels quite different from their autosomal paralogs. I've found ...
1
vote
0answers
46 views

extracting gene names from pubmed abstracts

I have been extracted number of abstracts from pubmed. now I am having a bunch of abstracts of pubmed articles now from this abstracts I need to extract gene names which are included in abstracts.
3
votes
2answers
75 views

Getting data from fastq by generator

I have a task in a training that I have to read and filter the 'good' reads of big fastq files. I downsampled, got the code working, saving in a python dictionary. But turns out the original files ...
1
vote
2answers
116 views

Chunk alignment in a name sorted bam for parallel processing

I have a bam file with 1 billion alignment reads of which there are 700 million unique reads. I want to split the alignments into chunks for parallel-processing. Multi-alignments of the same read ...
3
votes
2answers
85 views

Python - Finding a motif - input: a txt file with 10 sequences and 10 motifs

When I run my BruteForce function with only one input it works and the result is correct. ...
6
votes
3answers
170 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 ...
2
votes
1answer
90 views

Python string editing in Snakemake

I'm running a custom perl script using Snakemake. I use this rule: ...
4
votes
2answers
72 views

Plotting coverage of annotation over collection of region

I'm trying to plot "meta" coverage of annotation: i.e. features (eg. gene class) over certain regions. It is similar to read coverage plots over gene body, except my input is two bed files (both in ...
2
votes
1answer
60 views

Drug with as many targets as possible through a system biology graph?

I have 4 pandas data frames containing the following data: affinity_score1: affinity between each couple (Drug-Target) measured using tool1 affinity_score2: affinity between each couple (Drug-Target)...
2
votes
0answers
46 views

How to get bootstrap support of phylogenetic tree?

I have used multiple sequences aligned file of protein data to generate a maximum parsimony tree, then I used the "bootstrap_trees(msa, times, tree_constructor)" ...
3
votes
1answer
109 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 ...
1
vote
0answers
119 views

How to plot a 2D RNA structure in python using dot-bracket input?

I need some help with forgi library for visualisation of RNA secondary structure. I have an RNA sequence and dot-bracket notation of the secondary structure and I would like to plot 2D graph like ...
5
votes
1answer
96 views

How to find all variable-length seqs with an exact 5' and 3' match in a FASTA file

Context I am interested in finding all of the promotors specific to a particular sigma factor. I have identified the -35 and -10 sites from the literature, bold denotes -10, -35, binding sites: <...
2
votes
1answer
125 views

Snakemake: Cannot find first rule?

Back again with another snakemake query. This time I decided to port my read cleaning and alignment pipeline to snakemake. Repeating the steps from previous question and trying not to make any typo ...
3
votes
1answer
27 views

How to remove frame on RDKit figures?

RDKit can plot molecules, thought the structures are surrounded by an ugly frame with ticks. How can I turn that off and plot the molecules without that frame? Note, the ...
1
vote
1answer
15 views

Rdkit.Chem.Draw.savefig() creates empty figures

I can draw a molecule in a jupyter notebook with RDKit. Though, when I use the savefig() method only a white canvas is saved. No molecule is saved. ...
1
vote
1answer
84 views

How to separate a microbial strain of MTB resistant and susceptible drugwise?

Im trying to classify my list into three type: XDR - A strain must be resistant to: ...
0
votes
1answer
167 views

How to get PSSM of protein by protein sequence with python? [closed]

I didn't find way that convert protein sequences in FASTA to PSSM by python, and how to write program in python to find PSSM for our data set ? Maybe better to question how to find PSSM from NCBI ...
4
votes
2answers
53 views

Group genes by functional categories suming expression values

Using the count of rpkm values from genes in a metagenome sample, I want to group these genes into established categories (for example KEGG or COG). For each sample, my goal is to determine which ...
0
votes
0answers
27 views

Python module bamtags

Does anyone know this python module, bamtags? I'm using a pipeline (Dovetail Genomics, HiRise) that imports it, but it seems it doesn't exist. It's impossible to install it and there is no ...
3
votes
1answer
50 views

RSVSim insertions from chr1 to chr2

edit explaining python tag I would still rather have a solution based on the RSVSim package in R, but while waiting for someone who might have an answer I wanted to look at other solutions as well. ...
2
votes
0answers
223 views

Searching for start and stop codons for protein sequencing of contigs

I need to convert contigs into their respective protein sequences given a reference genome (i.e. I need to take a substring, whose position is already known on the string, and I need to locate the ...
2
votes
1answer
54 views

Store contigs and genome substrings based on mismatches

I have a string, a list of substrings, and a list of positions where substrings are found in string. ...
4
votes
0answers
76 views

How to plot character state changes from a presence-absence matrix on to a phylogeny

I am trying to assign character state changes from a presence-absence matrix to a phylogeny. I have tried assigning each character to its leaf node, and then if the leaf node's sister has the same ...
1
vote
1answer
55 views

AttributeError: module 'scater' has no attribute 'normalize'

I am using rpy2 to run normalization using scran package. After calling computeSumFactors I ...
4
votes
1answer
68 views

python package for NNI neighbors

I am working on protein sequence data files for reconstructing phylogenetic tree and I need to generate all NNI-neighbours of the tree (two trees are NNI-neighbours if one can be transformed into ...
3
votes
1answer
147 views

How to iterate protein sequences using amino acids?

I was working on certain program using python and I have been using a protein aligned sequence file in two formats, phylip (.phy) and clustal (.aln). Example clustal file: ...
2
votes
1answer
74 views

Counting the characters in a row using python

I am using python 3 and biopython 1.72. I have been using a protein sequence file in clustal format. ...
3
votes
1answer
276 views

How to automate NCBI genome download

I need to download all the completely assembled cyanobacterial genome's GenBank file(.gbff) from NCBI(RefSeq or INSDC ftp data). For this I think, the steps are: Need to find the completely ...
0
votes
1answer
86 views

Check if a string is ensembl gene id or not in python

I have many scRNAseq datasets saved as hdf5 files, and when I open them keys sometimes are confused, so I need a way of ...
-1
votes
1answer
53 views

Convert TPM-normalized matrices back to UMI in python

I want to process a plenty of scRNAseq datasets in python, and I want to run TMM ...
5
votes
2answers
89 views

Counting letters in phylip alignment columns with Biopython

I have been using python 3.6 and biopython 1.72 to work with protein data files. I am using a protein sequence file (phylip format), for example: ...
4
votes
1answer
131 views

Using pysam with cython: htslib/kstring.h not found

I'm trying to learn to use cython to speed up some code based on pysam. My issue is not strictly speaking about bioinformatics, but rather about building tools using a bioinformatics library. I hope ...
-2
votes
1answer
159 views

Python API for working with ENSEMBL genomes

Dear bioinformaticians, I could find two python APIs to mine ENSEMBL genome databases. There is a pyensembl which is more popular and then there is ...
1
vote
1answer
51 views

How to efficiently extract coordinates from a `pybedtools.Interval`?

I'm using pybedtools to process data, and at some point, I loop over a BedTool object and use unpacking to extract coordinates from the ...
0
votes
1answer
58 views

How to calculate Moreau-Broto autocorrelation, Moran autocorrelation, Geary autocorrelation from protein (amino acid) sequences?

I want to code Moreau-Broto autocorrelation, Moran autocorrelation, Geary autocorrelation in Python 3.6 from the scratch for amino acid sequences without using any package. Unfortunately, I have not ...
2
votes
1answer
94 views

Plotting Ramachandran Plot from more than one PDB file

I want to plot a Ramachandran Plot for around 5000 PDB files in python that is saved in a folder in my system. I am searching for a way to make it without accessing each file by hard-coding each file ...
2
votes
1answer
180 views

pysam pileup: what reads appear in the pileup?

Cross-posted on Biostars (with no answers currently). I hope that's OK. I thought that iff a read matches the reference at a position, it would appear in the pileup column for that position. But ...
2
votes
1answer
74 views

Download proteomes from NCBI based only on binomial names

I'm trying to download around 2000 proteomes from NCBI, but all I have is the genus and species e.g: lophodermium_seditiosum trichoderma_harzianum Does anyone know ...
0
votes
2answers
218 views

Running python script from terminal: umap issue

Some time ago I asked the question: RunUMAP in Seurat not working: module 'umap' has no attribute 'UMAP' It was solved by following the answer in it, however, it is still not ...
3
votes
1answer
83 views

Issues installing Dendropy

I want to perform phylogenetic analysis using Dendropy. I have installed dendropy using command sudo pip install -U dendropy but when I import it in python3.5.1 it ...
6
votes
1answer
76 views

Generating random BED intervals given constraints

Problem is to generate a random BED interval given the following constraints: minimum start maximum end fixed length maximum ...
3
votes
1answer
148 views

How to extract the protein fasta file from a genbank file?

Let's say I have a genbank file, e.g. the one downloaded from here, that contains entries as ...
14
votes
1answer
355 views

Biopython Phylogenetic Tree replace branch tip labels by sequence logos

Having recently constructed a lot of phylogenetic trees with the module TreeConstruction from Phylo package from Biopython, I've been asked to replace the branch tip labels by the corresponding ...
4
votes
1answer
113 views

Finding proteins in a sequence

I have a file with protein sequences, all on a single line, like this: ...