Questions tagged [python]
python is a programming language, widely used in bioinformatics
581
questions
-2
votes
1
answer
70
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
90
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
243
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
...
1
vote
0
answers
33
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
vote
1
answer
29
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
49
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 ...
4
votes
1
answer
64
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
votes
1
answer
32
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 ...
3
votes
0
answers
25
views
Issue creating CNV plot from WES data
I received Whole Exome Sequencing data from an NGS company (CARIS, specifically). I received R1 and R2 FASTQ files, a BAM file aligned to hg38, and a VCF file.
I used CNVPytor to create a CNV plot (...
0
votes
1
answer
18
views
Invalid tag name: "1KG" and Invalid character '/' in 'SA' FORMAT field at chr1:6197766
I have a VCF file that is of the following format:
...
0
votes
2
answers
37
views
Filtering cohorts in PySpark returns Py4JJavaError
I'm working with UK Biobank data. I made a cohort with the Cohort Browser and tried to extract the data with this code ...
1
vote
1
answer
23
views
Sql query slow on Chembl postgres database
Doing complex sql query on Chembl database and it takes 40 minutes on the machine from lab.
I was thinking using dask, extract each table and export to parquet, when do the data processing .
Is this a ...
1
vote
2
answers
107
views
selenium webdriver is stuck after downloading and saving a pdf file from pubmed central website
I'm trying to download pdf from pubmed central using selenium webdriver in python. The code is provided below which downloads the pdf fine but, it does not quit automatically. i.e. it is sort of stuck ...
0
votes
0
answers
13
views
Compare in Python / PyRanges two genomic intervals to determine whether they're separate, partially overlapping, or contained
As part of a larger analysis, I need to evaluate pairs of genomic regions (regionsA and regionsB) and perform different ...
1
vote
2
answers
32
views
Getting rid of duplicates in a dictionary
I have a tsv file that lists the reads and read lengths from a FASTA file but some reads are duplicated - that's just from the analysis I did previously - but I want to only take one instance of the ...
0
votes
0
answers
43
views
Gene Ontology (GO) analysis and classification of bacterial whole genome annotations
I am new to Gene Ontology (GO) analysis and would like to classify and visualize the annotations. Here is the background and the steps I have taken so far:
I annotated the bacterial whole genome ...
1
vote
3
answers
233
views
How to join multiple large .tsv (> 20 GB, bed file) files by two identifier?
This question has also been asked on Biostars
I wonder how can I join multiple large .tsv files (over 20 GB each) by using two identifiers (columns) which I used to do using the ...
1
vote
1
answer
46
views
0
votes
1
answer
28
views
Variant Filtering Using AnthonyOzerov/variant-filtering Github Repository And Python Errors
I am using the following Github repository that I cloned. One apparent issue is that it is using an old/defunct link for the phenotype_to_genes.txt that is no longer active and after several tries I ...
0
votes
1
answer
66
views
How to calculate the variant allelic fraction (VAF) from VEP output?
This question was also asked on Biostars
How can I calculate the variant allelic fraction from the VEP file for multiple human samples?
I used the ensembl-vep and it is human data.
0
votes
1
answer
120
views
Refactoring pandas using an iterator via chunksize
This question was also asked on Stack Overflow
Bioinformatics rationale eggNOG files can be very big and sump all available RAM for regular to medium sized desktops.
I am looking for advice on using ...
2
votes
1
answer
52
views
Assign score to PyRanges from another PyRanges object
I have two PyRanges objects. PR1 is a set of regions of interest across a chromosome, PR2 tiles the genome and has a score associated with each range.
I need a way to get for each range in PR1 its ...
2
votes
1
answer
171
views
Error while running computeMatrix command in Deeptools
I am trying to get computeMatrix for bigwig file in specific genomic region using deeptools.
Below is the code I am using
...
1
vote
1
answer
42
views
Generating 3D cartesian coordinates of a peptide and computing van der Waal interactions (1-4 atoms) for a given set of dihedral angles?
I wanted to generate 3D Cartesian coordinates of a peptide sequence for fixed bond lengths and bond angles for a given set of backbone dihedral angles and side dihedral angles. I also wanted to ...
1
vote
1
answer
40
views
Tidying MEGAN Taxonomy for Python/R Analysis
I am analysing some WGS data in MEGAN and would like to do some additional analysis in Python/R
I am having trouble Tidying the Taxonomic data in a format which would be conducive to this. Originally ...
1
vote
0
answers
65
views
How to use hashsolo for demultiplexing hashtags?
I am trying to use hashsolo and I want to make sure that I have done things correctly.
I did the below:
...
0
votes
0
answers
6
views
Is there available REGA or COMET versions for downloading & using on a local machine?
I am currently working on verifying the subgenotyping of our sequences and a subsample from the Los Alamos NL database. My supervisor has recommended using REGA & COMET for this purpose. While our ...
1
vote
0
answers
24
views
GDC API: Obtain the Objective Power (or Magnification) of a WSI file
I've been trying to find out a way to retrieve the Objective Power (or Magnification) of a Whole Slide Image file without downloading it first.
I've seen that some WSI's Objective power might be 40x ...
-2
votes
1
answer
236
views
How to calculate Allele frequency from vcf file
Organism under investigation is Plasmodium falciparum. How to calculate the allele frequency for each row?
I tried with this code:
...
1
vote
1
answer
23
views
How to get enriched pathways in the data using continous statistic measure?
I was doing pathway enrichment analysis using the below code
...
2
votes
4
answers
498
views
Parallelize or qsub a bash script
I have a bash script that I would like to parellelize to run on multiple nodes. My goal is to run my python sample_script.py script on pairwise comparisons of samples to see if their variants are a ...
1
vote
1
answer
62
views
Analysing the Effect of a Drug on the Morphological Changes of a Cell Type
We came across a project in our lab that no one exactly knows how to approach. Since, I know a little bit of Python programming, this project was assigned to me.
There is a data from a randomised ...
-3
votes
1
answer
91
views
Histogram plot using R/python with two variables[BC and Control] and their corresponding gene names
How do we plot histogram in R\Python with two variables[BC and Control] and their corresponding gene names examples is below:
Thank you,
3
votes
1
answer
110
views
Download all pubmed central article ids that have a keyword appearing in their titles/abstracts and also falling between two dates
I am using the following code to download all pubmed central article ids that have a keyword appearing in their titles/abstracts and also falling between two dates. The code seems to work when I ...
2
votes
0
answers
90
views
Extracting positions from PAF files in order to extract sequences from a Fastq file with Python
I have used Minimap2 to create a paf file by aligning a Fastq file against itself. Now from this Paf file I can see where the reads overlap, and I want to take these positions, and use them to extract ...
1
vote
1
answer
41
views
Given a FASTA file with a set of genes, how do I determine that set's conservation among a genetic order?
Given a set of genes in a FASTA-formatted file, for example: exFasta.fa, what is the best way to determine how well conserved the genes in that file are among an ...
1
vote
0
answers
57
views
From SMILE get Amber force in Python
I have a list of SMILES of small molecules and I want to be able to simulate these molecules with an Amber force field in Python. Currently, I use RDkit to convert the smile into a PDB file:
...
2
votes
1
answer
50
views
How to tackle an Index Error in my code for finding ORFs
I have created a python code that prints out all lengths of ORFs in a DNA sequence (start codon - "ATG", stop codons - "TAG", "TAA" and "TGA". It seems to give ...
3
votes
1
answer
158
views
Plot phylogenetic tree from list of edges
I have a dataset that I wish to convert to tree or phylo format like in the ape package, in order to plot the phylogenetic tree. It is formatted like a list of ...
1
vote
1
answer
30
views
How to calculate frequency of a category with respect to the value in another column?
I was trying to calculate the frequency of disease_present (yes) when smoking status is y (yes) for each group (A, B, C, D)
<...
3
votes
3
answers
636
views
How to run python request for list of url's with multiple page numbers?
Hi I am trying to get the cancer ontologies (obo_id and label) from EBI-OLS. Earlier I have used the below code to get the obo_id terms and ...
4
votes
1
answer
84
views
calculating mutation frequencies for every gene
I have a dataset for mutation data and I want to calculate mutation frequencies across all genes
df (This is only the small subset of data)
...
2
votes
1
answer
100
views
Math on Pandas Columns
I have a pandas dataframe that reads in a PAF file from minimap2. What I would like to do is take the first 5 columns of the data from to create a BED file.
I used this to extract the first 5 columns:
...
2
votes
1
answer
57
views
2
votes
1
answer
86
views
Python list comprehension to calculate the set of categories for each row
My data = data
...
1
vote
0
answers
218
views
How to plot average gene expression in scanpy?
I would like to make a UMAP where the cells are colored by the average expression of the bulk signature genes but I am not confident that I did it correctly. I would like to use scanpy for it.
I did ...
1
vote
1
answer
160
views
Primer trimming-fasta files
My goal:
I want to trim off the primers (Forward : CGAGAAGACCCTRTGRAGCT, Reverse : GTTGGGGYGACCNYGG) from a fasta file with a lot of dna sequences allowing for some (e.g. 3) mismatches (identity).
...
2
votes
0
answers
141
views
How to make a UMAP for single cell data and color cells by average expression of a list of genes in scanpy?
I would like to make a UMAP where the cells are colored by the average expression of the bulk signature genes but I am not confident that I did it correctly. I would like to use scanpy for it.
I did ...
2
votes
1
answer
216
views
calculate the backchain RMSD between two pdb files by pymol in Python
i have two protein pdb files and want to calculate the backchain RMSD between them. As far as I know the GUI of Pymol can use align to calculate the RMSD (but I don't know if it is the backchain RMSD)....
2
votes
1
answer
73
views
how to do manual search on NCBI with biopython and add link to publication
I'm trying to reproduce a complex manual search on NCBI using BioPython, but obviously something is not right. My command line is not working, but I'd especially like a way to have an accurate search ...