Questions tagged [python]
python is a programming language, widely used in bioinformatics
597
questions
1
vote
1
answer
155
views
finding matching motifs in a sequence and their position
I am trying to find some matching motifs on a sequence, as well as the position that the motif is located in and then output that into a fasta file. The code below shows that the motif ...
0
votes
0
answers
37
views
Conversion FASTA to BED fails
I want to use conform-gt to get rid of some REF prefix differences see here. Conform-gt needs the reference FASTA file split by chromosome and in .vcf.gz format. How can I do this?
I already tried <...
3
votes
1
answer
151
views
Compare and Reorganize Fasta Headers Python
I want to compare the headers from the fasta file to file1, and if there's a match, reorganize the header and put the match first. If there's no match between fasta file and file1, look at file2 and ...
1
vote
3
answers
82
views
eQTL data extraction from database JSON file
I have a long list of JSON data, with repeats of contents similar to followings.
Due to the original JSON file is too long, I will just shared the hyperlinks here. This is a result generated from a ...
0
votes
2
answers
158
views
How to find restriction enzyme frequency in whole genome and count the distance between them?
I am having possibly a simple question which is proving difficult.
My objective is to take the reference FASTA file and flat file database with 1500 restriction enzymes with its cutting sites (mostly ...
1
vote
2
answers
116
views
How can I align two novel sequences to a reference genome and build a phylogenetic tree?
I have two new amino acid gene sequences that I want to align to a reference genome. Is it a good idea to have a combined phylogenetic tree? what will this type phylogenetic analysis called?
2
votes
1
answer
162
views
Add file name to FASTA file header using SeqIO
I have several fasta files that represent the proteins from different orthogroups. However, the orthogroup that each of the proteins belongs to is not indicated within the files. I am leveraging ...
1
vote
1
answer
57
views
Snakemake MissingRuleException
I'm trying to run a snakefile for the first time with limited coding experience using salmon to index a reference genome. I'm not too sure what I'm doing wrong based on this error message.
...
1
vote
1
answer
494
views
Comparison of fastq files reads
My goal is to compare reads from two different fastq files on a Linux machine.
The following are the comparisons to perform:
How many common reads are between the two fastq files?
How many reads are ...
0
votes
1
answer
219
views
Correct way of merging scRNAseq datasets of healthy and tumor cell?
While merging datasets from similar biological conditions, but different experimental conditions is a well-studied topic, and there are many batch correction techniques available. What I want to ...
1
vote
1
answer
161
views
Running a Python Script from a bash script on multiple input files across different directory paths
I am in the process of writing up a bash script that runs three bioinformatics tools and then executes a python script. This python script compiles some of the data from the informatics tools output ...
1
vote
1
answer
32
views
How to add N bases to PyRange object (i.e., shifting PyRanges coordinates)
I would like to add n (e.g., 1k) bases to a PyRange object (i.e., shifting PyRanges coordinates).
How can I do that?
Input:
...
1
vote
1
answer
396
views
Warning message related to tensorflow package when trying to run deepbgc bioinformatics tool
I have come across some related issues pertaining to this tensorflow warning but none related specifically to deepbgc
I have created a conda environment and have installed onto it the bioinformatics ...
2
votes
1
answer
619
views
pip installation within conda env: Error downgrading scikit-learn - WARNING: No metadata
I am trying to get the bioinformatics tool deepbgc up and running. Now I have created a conda environment and have currently ...
1
vote
1
answer
77
views
Filtering reads greater than 5 from HT-seq count files
I have some raw counts from HTSeq after aligning with hg38 human reference genome. I want to do filtering in a way that the filtered count files should have the same number of lines. The reason behind ...
2
votes
0
answers
151
views
Writing to .cif from BioPandas
My question is twofold. First, I've run into an issue working with .cif files and pandas dataframes. With BioPandas, I can read a .pdb file into a dataframe and then go the opposite direction, writing ...
1
vote
1
answer
61
views
KEGG retrieve hierarchy for organism in biopython
I want to obtain a direct graph from KEGG as well as the genes present in a single term. While it is pretty easy to get list of genes/compounds that are part of a specific category, I am kinda stucked ...
1
vote
1
answer
289
views
Visualize RNA co-folded secondary structure with Python
I would like to visualize the secondary structure of co-folded RNA strands in Python, preferably in a Jupyter notebook.
What are the recommended tools? Can anyone provide an example?
2
votes
2
answers
440
views
Parsing a genbank file and outputting specific feature information to a csv using BioPython
So I am trying to parse through a genbank file, extract particular feature information and output that information to a csv file. The example genbank file looks like this:
SBxxxxxx.LargeContigs.gbk
<...
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:
...
1
vote
1
answer
112
views
How to chop fasta / bed /peak file genomic segments into smaller fixed or custom genomic intervals
I am trying to split my .bed/.fa file genomic segments into arbitrary smaller overlapping intervals:
Consider a typical line/row in my *.bed file as follows:
chrom. $\ \ \ \ \ $ start $\ \ \ \ \ \ \ \...
1
vote
0
answers
29
views
I want to map TFBS on to the sequences from dataset containing 8448 (210 base) sequences. its not giving all the hits I need
I want to map TFBS (transcription factor binding sites) on to the sequences from dataset containing 8448 (210 base) sequences, but it is not giving all the hits I need
...
2
votes
0
answers
75
views
Naming conventions for kegg nodes with multiple genes
So I'm downloading XML files from Kegg using BioConductor and and I'm running into a problem. If we look at HIF-1 signaling pathway we see the node growth factor (GF) on the left hand side, we can ...
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 ...
1
vote
1
answer
57
views
CLI access to genomes/proteomes by BioSample ID [duplicate]
This question was also asked on Biostars
I'd like to download multiple genome assemblies or proteomes using a set of BioSample IDs from NCBI.
I'm able to find the assemblies belonging to the BioSample ...
1
vote
1
answer
93
views
How can I measure the distance between each pair of carbon alphas in overlayed protein structures?
I am trying to make a figure in which the protein structures are colored by the distance between the calphas in the overlayed structures.
I am comparing our cryoEM structure to that of a previous ...
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, ...
3
votes
0
answers
37
views
How are BLAST record scores calculated in biopython
Can someone explain how the score is calculated for Bio.Blast.Record.Description? For example, if Record.Description.num_alignments is >1, is ...
1
vote
1
answer
79
views
Refactoring a script mapping ID to sequence
I wrote simple Python script which has an excessive run time, notably when using large data sets. For example a data set of 1 000 000 sequences.
I am seeking assistance refactoring the code and would ...
1
vote
2
answers
69
views
Tool for cross referencing a newly found MOTIF to database of known MOTIFS
I need a tool or a function I can use in my code (R, or Python) that I can cross reference a MOTIF against known MOTIFS, a function that will take as input a MOTIF (a probability weight matrix, PWM ...
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. ...
1
vote
1
answer
259
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 ...
0
votes
2
answers
877
views
RNA strings and amino acid string
Which of the following RNA strings could translate into the amino acid string PRTEIN? (Select all that apply.)
I am not sure if the following mass of amino acid is relevant to the question.
...
3
votes
1
answer
331
views
How To display bar graph with error bars?
I am using the below code to get the bar plot. I want to get the bar plot with error bars displayed.
...
3
votes
0
answers
62
views
How to use hgvs to project a variant list on a given protein sequence string?
I have the following protein structural variance list:
...
2
votes
2
answers
628
views
2
votes
2
answers
375
views
PWM (4xM matrices) to Sequence Logo Visualizations in MATLAB or Python
Is there a MATLAB, or else Python (not R) tool for visualizing sequence Logos from probability weight matrices (PWMs)?
This seems like a basic and simple tool to implement, yet just above the ...
1
vote
1
answer
208
views
Extract single frame with MDAnalysis
How can I do to extract a single frame as a pdb file from a trajectory traj.xtc file, by using MDAnalysis?
I've got a universe
u=mda.Universe('confout.gro','traj.xtc')
Then I selected a residue by ...
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 ...
2
votes
1
answer
171
views
Snakemake scatter-gather with wildcard AmbiguousRuleException
My problem is when using Snakemake scatter-gather feature the documentation is basic and i modified my code according to mentioned in this link
...
1
vote
2
answers
68
views
How to extract DNA sequence from browser track input files (BigWig, bed etc.) files
A BigWig file for something like Chip-seq, or ATAC data has the following format for each line i:
chrom_i - start_i - end_i - value_i
I need to convert for each line the (start_i -> end_i) ...
1
vote
1
answer
60
views
Converting Chip-seq fastq format ({$x_k$} list of seq segments) to genome browser {sequence $x_i$, count-number $y_i$} format
Very new to bioinformatics. I am trying to figure out the steps required to convert a chip-seq fastq file into a genome browser track, with the end goal of being able to access the sequence (x) vs. ...
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:
...
4
votes
2
answers
103
views
Downloading genomic protein files from accessions in Python
I am trying to download the _protein.faa.gz files for genomes given their accession numbers through Python. Ideally, I would like to do this without third party ...
2
votes
1
answer
141
views
Caching and parallelization
Currently algorithmically developing a calculation for "co-dependent" mutation (quotation appropriate). The algorithm uses chunked biopython alignment objects which are parallelized.
Aim
One ...
1
vote
2
answers
302
views
Converting .bw files to .fq (fastq)
I am able to convert .bw files to .fq(fastq) manually in Shell, but I would like to automate the process coz I have hundreds of .bw file that I need to convert. Till now, I could think of following ...
2
votes
1
answer
2k
views
How to normalise the histogram height in matplotlib
I am trying to create a histogram plot with matplotlib. I am using bmi column from four different data frames (d1, d2, d2, d4).
...
2
votes
1
answer
507
views
Extracting base sequences from ABI/AB1 sanger sequencing chromatogram
I am trying to understand the sanger sequencing ABI/AB1 file format better, and extract base calls from given signal intensities over time.
As I understand, reading in a raw AB1/ABI file into python, ...
3
votes
1
answer
166
views
What is the function of the heteroatoms
I am trying to make a prediction application using the sequence of proteins.
If we think about the 6COU protein, I'm running the code below
...
3
votes
1
answer
165
views
Identification of unique chains in proteins by sequence similarity
I'm trying to find unique chains or proteins within their PDB files. Many proteins have multiple chains, but very often they are identical (say, the PDB file consists of 4 homodimers, for example, so ...