Questions tagged [python]

python is a programming language, widely used in bioinformatics

Filter by
Sorted by
Tagged with
3
votes
2answers
77 views

How to find common sequences among 6 multi-fasta files

I have 6 multi-fasta files, every of them contains ca 1500 sequences like that: ...
2
votes
0answers
36 views

Number of reactions per metabolic pathway

What is the quickest way to calculate the number of chemical reactions present in each pathway for a given organism and which online database (kegg, metacyc,reactome..) is more helpful/reliable for ...
1
vote
2answers
68 views

Biopython Failure to break out of loop

After qblast, I wanted to print only details from the first 3 BLAST output. Yet, the code below printed the details of every BLAST output. Why can't I break out of the loop to achieve my desired ...
3
votes
1answer
34 views

Access workdir defined on command line from within Snakefile

Snakemake provides access to a workflow object within a Snakefile. This allows one to, for example, have dynamic programmatic access to the directory containing the ...
1
vote
1answer
37 views

How to efficiently get human gene names from NCBI based on a large list of SNPs

I found a good answer related to my question here: How to get a list of genes corresponding to the list of SNPs (rs ids)? But it says about small number of SNPs. I want to get gene names based on ...
1
vote
1answer
20 views

semantic similarity measurement for cell line ontologies

I have a set of cell line pairs and I want to know to what extent the pairs are similar based on their ontologies. The problem I have is that I have found a Python library called Fastsemsim, but it ...
2
votes
1answer
48 views

Is there a way to use BioLemmatizer from Python?

Lemmatization is one of the most important tasks for text normalization in NLP. One of the good lemmatizers I found for biomedical domain is BioLemmatizer. However, it is developed in Java and is ...
3
votes
2answers
91 views

How to do `bedtools intersection` using pandas alone?

I have two pandas Dataframes, using python3.x: ...
3
votes
1answer
27 views

How to select only RNA with Hetero atoms from pdb file with python?

I'm trying to separate RNA from protein in a complex protein/RNA PDB file and I want all RNA info with the hetero atoms in between the bases BUT without H20 etc. In short I want RNA part of pdb file ...
0
votes
1answer
46 views

Pandas automatically rounds GWAS P-value

I am working with a specific GWAS. If I were to run this on the command line grep <rs_id_of_interest> GWAS.txt I would see the GWAS p-value to be on the ...
1
vote
1answer
89 views

Raw Data frame manipulation in python

Using python 3 I need to process qPCR sequencing raw data outputs by searching for the first occurrence of a user defined string and then making a new data frame using all lines after that string. I ...
0
votes
0answers
32 views

How to compare multiple genetic profiles in Python?

I have hundreds of vcf file where each vcf file contains genome profile for a tissue. A portion of the vcf file is as follows: [ I can read each vcf file into a dataframe. So it would be hundreds of ...
1
vote
3answers
139 views

Deep learning RNA sequences

Currently I'm working on a project, which combines deep learning with RNA sequences. I'll try to predict pseudotorsion angles [1] from raw rna sequence. The ideas is to train a neural network with raw ...
2
votes
3answers
132 views

How to reverse complement the DNA sequences for given inverse/reverse coordinates?

I have the series of coordinates in id.txt file, whose coordinates sequences are in genome.fasta file. The coordinates of id.txt ...
1
vote
0answers
19 views

the positions computed by ms

I am doing simulations using a program 'ms': https://snoweye.github.io/phyclust/document/msdoc.pdf If you look at page 3 of this pdf, it explains the output produced by ms. The line which starts ...
3
votes
1answer
97 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 ...
1
vote
3answers
100 views

Calculate the occurrence of motif in sequences (including overlaps) using Python

I need to calculate the occurrences of a motif (including overlaps) in sequences (motif is passed in the first line of standard input and FASTA sequences in subsequent lines). The sequence name starts ...
1
vote
1answer
35 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 ...
1
vote
1answer
44 views

How to get Uniprot and swissprot cross references using Biopython

I am struggling to use biopython to gather cross references such as GO annotation from Uniprot/swissprot text files ("DR" in the .txt files) using biopython. From ...
0
votes
1answer
81 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
267 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
29 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
29 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
51 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
98 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
165 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
354 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. ...
8
votes
3answers
570 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
166 views

Python string editing in Snakemake

I'm running a custom perl script using Snakemake. I use this rule: ...
4
votes
2answers
136 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 ...
1
vote
0answers
96 views

Calculate molecular mass from chemical formula C9H15N4O8P (e.g.) with rdkit?

Can I calculate the molecular mass from a formula like this C9H15N4O8P in rdkit? I think ...
2
votes
1answer
65 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
62 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
125 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
220 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
100 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
195 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
38 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
19 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
97 views
1
vote
1answer
119 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
339 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
57 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
28 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
55 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
330 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
62 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. ...
5
votes
2answers
101 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. Thus I want to identify the most parsimonious hypothesis for which node and branch a given "mutation" or "...
1
vote
1answer
69 views

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

I am using rpy2 to run normalization using scran package. After calling computeSumFactors I ...