Questions tagged [python]

python is a programming language, widely used in bioinformatics

Filter by
Sorted by
Tagged with
2 votes
1 answer
134 views

working with cutadapt

I'm working with ion torrent data where I apply the program cutadapt. I'm analyzing ITS seq data, as well as Matk. When I'm using cutadapt, I search the information for this genes, and built new ...
1 vote
1 answer
63 views

AttributeError [in fastStructure's chooseK.py]: module 'vars' has no attribute 'insum'

I've been working with the fastStructure program and am on the step of analyzing model complexity using the provided chooseK.py script. I have been running into the following error: ...
1 vote
1 answer
93 views

bcbio run not running samples in parallel

Sorry for the cross post but I'm not getting a response on bcbio github: I'm trying to run bcbio on 20 samples and it's only running one at a time as it steps through the yaml seemingly. I'm using ...
1 vote
1 answer
421 views

Is there a way to use BioLemmatizer from Python?

Lemmatization is one of the most important tasks for text normalization in natural language processing (NLP), i.e. using deep learning to understand text data. One of the good lemmatizers I found for ...
-1 votes
0 answers
25 views

How can I convert ecat(.v) file to nifti(.nii) file in python?

I want to convert ecat file to nifiti file or ecat file to dicom so I can change it to .nii later. I would like it in python if possible. Do you have any library suggestion? Thank you
2 votes
0 answers
35 views

How to perform liftover from 38 to 37 in R?

I have some gwas summary statistics in GRCh38 that I want to lift to GRCh37. I am trying to liftover in R using this code: ...
6 votes
2 answers
227 views

BioPython internal_coords module returns different dihedral angles for the (seemingly) same protein structure

I am using the internal_coords module from BioPython in order to compare dihedral angles of two different conformations of the same protein. The conformations are ...
3 votes
1 answer
74 views

How to extract and visualize sequence logos from CNN kernels?

I created a basic CNN architecture using Tensorflow to classify transcription factor binding sites. My aim is to somehow extract and visualize sequence logos from the convolutional kernels. The model ...
2 votes
1 answer
27 views

retrieving past BLAST requests in bioPython

is there any way to retrieve a BLAST request made using the Biopython library using the request's query_id? Alternatively is it possible to retrieve a query_id before the blast result is complete, and ...
1 vote
0 answers
30 views

Need help with binding DB API

...
0 votes
0 answers
19 views

PyRanges: drop specific record from an object

Given a specific PyRanges object, such as ...
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 ...
1 vote
0 answers
25 views

What are some good miRNA databases?

I am writing a project proposal for my boss and it is on codon usage bias in the dystrophin protein and the spectrin-like repeats found in a hmmscan file using the longest dystrophin isoform protein ...
-1 votes
1 answer
19 views

New to DNABERT confused about kmers input

I'm trying to use DNABERT to predict promoter regions. Right now, I have a df with 500k rows, 1st column is the DNA sequence (all different lengths), 2nd column says "promoter" vs. "non-...
1 vote
0 answers
18 views

Adding step size to cross validation in Python package lifelines

I'm using the Python package lifelines to build a CoxPH model where I reduce the step size to 0.1, like so: ...
2 votes
2 answers
240 views

motif searching in a multi-fasta file

I am having trouble trying to search for motifs in a multi fasta file. I have used two techniques one gives me the name of the sequence where the motif is found but doesn't give me the the motif and ...
2 votes
3 answers
547 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 ...
2 votes
1 answer
22 views

BioPython SeqIO fails with Invalid Alphabet found

I am trying to store a GenBank file that could be read by Geneious later. I found an example how to create the GenBank file here But now I run into Alphabet issues. ...
0 votes
0 answers
31 views

Error in snakemake when running conda envs in container

I am facing an issue when running snakemake with a container and conda. Let me explain better. I am developing a workflow (locally) in snakemake, where some rules use a conda env (defined in /envs/env....
1 vote
1 answer
646 views

tensorflow nn_model for DNA sequences: Matrix size-incompatible: In[0]: [2,1], In[1]: [784,300]

Hope anyone can help a beginner here. I'm building a proof-of concept tensorflow classifier for DNA sequences. However, the NN model does not let through train and test vectors saying the matrix size ...
3 votes
1 answer
558 views

GWAS in python?

A question similar to this has also been asked on Biostars I understand GWAS is done with R, but are any written in Python? I'm used to python and java, acclimating to R will take a bit of time and my ...
1 vote
3 answers
496 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: ...
1 vote
0 answers
58 views

SNP How to detect regions of erratic pairwise alignment?

I have clusters of DNA sequences that contain some mutations. All the sequences in a cluster should contain the same mutations. As the mutations aren't known, those clusters of sequences were pairwise-...
2 votes
3 answers
103 views

How to merge multiple list into a single dataframe replacing common values with 1 -python

I have multiple lists on python: ...
3 votes
1 answer
101 views

Generating CIGAR strings for MSA with reference

I have a list containing the results of a MSA: ...
6 votes
5 answers
6k views

How to create Phylogenetic Trees from fasta files in Python or R?

I have around a hundred Fasta files (and will collect several thousand) with DNA sequences and +50x coverage. What is a recommended method to construct a phylogenetic tree? Solutions in Python or R ...
2 votes
1 answer
555 views

Python scripting with ete3 to query NCBI's Taxonomy: "sqlite3 Warning (can only execute one statement at a time)"

I am using this script: ...
2 votes
2 answers
35 views

Compare files with similar names using placeholders/wildcards in Snakemake

In Snakemake I want to use two input files for comparison. The one file has a sample name (e.g. 526846), with an experimental id (e.g. EF_S13' and 'MF_S5'). The file I want to compare it to has the ...
1 vote
2 answers
220 views

ValueError: count not convert string to float

I'm trying to use a Python script to plot with a rolling window using pandas and seaborn. This code worked for the longest time but now it's giving me an error that I don't know how to fix. Here is ...
1 vote
1 answer
70 views

Advise on building an effect ML model for predicting important proteins for drug response

I want to create a model to predict proteins which could be associated with drug response in cancer cell lines. I have cell line proteomics data, with compound screening data they have gained for a ...
2 votes
1 answer
62 views

How can I develop a snakemake rule for all files in multiple directories?

I am a beginner in snakemake and I'm trying to develop a working flow. Imagine I have multiple folders and in each folder I have a tumour and normal sample files: ...
-1 votes
1 answer
87 views

For loop in Python goes wrong

I have mutation status (0,1) for ten genes in ten cancer 3D models I have also gene expression in these 3D models, like ...
0 votes
1 answer
141 views

How to pack up a Python script in the form a Dockerfile

I have a simple Python script with this header ...
0 votes
1 answer
259 views

Looping over a list of cell models in Python

I have two data sets Mutations in 10 genes Gene expression in 18 cancer 3D models For every (mutation, gene) and gene expression pair we run an ANOVA test This is my data ...
2 votes
1 answer
50 views

How to map list items which are in groups in the dictionary values and return keys corrosponding it?

...
2 votes
1 answer
244 views

ETE4 manual or improved code description

ETE3 * (Environment for Tree Exploration) is a major package and in particular Python package to navigate phylogenetic trees. It is the premier coding library/package for tree manipulation. ETE4.0.0 ...
2 votes
2 answers
208 views

Blastp MSA to the same length

To generate aligned protein sequence truncate to the same length, I use blastp in biopython for MSA. I have multiple queries and one subject sequence. However, the alignment never returns the same ...
1 vote
1 answer
55 views

different results of RMSD for the same trajectory file

I want to analyze the RMSD of my trajectory files using MdTraj. I used two different codes for this purpose: the first code: ...
0 votes
1 answer
77 views

Model the effect of treatment on mutation burden

I am struggling a bit to model the following problem. Basically, I would like to model tumor mutation burden (mutations per megabase, a continuous) as a function of treatment (categorical). The ...
1 vote
1 answer
309 views

Reading a Fast5-file with Python

I am trying to extract data from fast5-file with python 3.9.13 in Ubuntu. I have found a library "fast5_research"(This package comprises an API to HDF containers used by the research groups ...
1 vote
1 answer
30 views

How to access yeast-cyc in a programmatic way to extract the GO terms?

I am a newbie in Bioinformatics, I want to extract the GO terms from yeast-cyc, which is items in the Go terms tab of this page https://yeast.biocyc.org/gene?orgid=YEAST&id=G3O-29622#tab=GO , not ...
2 votes
1 answer
59 views

Snakemake and github actions

I am working on a snake-make workflow that follows the guidelines of formatting and linting so that it can be published on the official Snake-make repository. Whenever I push my code on GitHub, the ...
2 votes
2 answers
772 views

Biopython - extracting query coverage from XML Blast output

I need to extract (or to calculate precisely) the query coverage from Blast output. I am using NCBIWWW.qblast to query Blast in XML format. Is it possible to know the query coverage parsing the XML ...
4 votes
1 answer
73 views

Can not launch bcftools using python's subprocess module, as it only accepts first command of commands list

I am trying to remove samples from a chromosome vcf file. I wrote a function that takes chromosome number and a list of samples to remove. When I try to run bcftools using subprocess module it only ...
1 vote
1 answer
101 views

BioPython - Retrieve sequence records from pubmed database

I've been assigned a task to fetch sequence records from "pubmed" database: fetch 30 record of type "fasta" from (pubmed database, with term hemoglobin AND alpha) as a sequence ...
-1 votes
1 answer
79 views

Can I perform Expression Analysis on this 10x dataset?

10x Genomics: 20k Human PBMCs is the dataset. Description of the dataset: Inputs/Libraries Human peripheral blood mononuclear cells (PBMCs) of a healthy male donor aged 30-35 were obtained by 10x ...
-1 votes
1 answer
37 views

Feature-selection microbiome data to build a model to predict cancer

I want to build a machine learning model to predict colorectal cancer based on 16S rRNA microbiome data (stool samples). I have filtered the data using filtering approach by Duvallet(removing samples ...
7 votes
2 answers
531 views

Is there any function in Biopython to convert a DNA sequence from ambiguous to unambiguous?

I have a project to write in Python that requires to write a function that given degenerate DNA sequence (for example: KKGTACACCAG) sequence and a molecular weight interval, returns a list of all ...
1 vote
2 answers
244 views

Permutations of 4 amino acid sequence oligopeptide

I have an assignment for a project to build a tetrapeptides library to screen against some target enzymes in silicon. I am looking for a script to construct about 160000 tetrapeptide from the 20Amino ...
2 votes
1 answer
59 views

Is there a way to extract spike sequence from a Sars-CoV-2 complete genome (preferably in Python)?

I have a complete genome sequence of a Sars-CoV-2 variant, but I am only interested in the Spike sequence? I should note that I am not a biologist (nor bioinformatics). The complete genome looks like ...

1
2 3 4 5
12