Questions tagged [bioinformatics]

Bioinformatics is the use of software tools to analyse biological data.

Filter by
Sorted by
Tagged with
19 votes
2 answers
542 views

Count the occurence of nucleobases in DNA string

Inspired by this meta question I decided to take a look at Rosalind. Their first challenge seemed easy enough: An example of a length 21 DNA string (whose alphabet contains the symbols 'A', 'C', 'G', ...
Mast's user avatar
  • 13.1k
14 votes
2 answers
778 views

Translate nucleic acid sequence into its corresponding amino acid sequence

Goal of the program The goal of the program is to translate a nucleic acid sequence into its corresponding amino acid sequence. The nucleic sequences have to be formatted in a specific format called <...
felix's user avatar
  • 588
13 votes
2 answers
766 views

A classy DNA nucleobase counter

This question is part of a series solving the Rosalind challenges. For the previous question in this series, see Counting nucleobases in a nucleotide c. The repository with all my up-to-date solutions ...
Mast's user avatar
  • 13.1k
13 votes
1 answer
5k views

Simple DNA sequence finder w/ mismatch tolerance

The goal with this function is to find one DNA sequence within another sequence, with a specified amount of mismatch tolerance. For example: ...
Sean's user avatar
  • 131
11 votes
5 answers
2k views

Counting relevant entries in a large bioinformatics file

I have a working example of a piece of code which opens up a file, gathers information about the contents, and outputs a map which contains the information. The file The file type is an in-house ...
Sam's user avatar
  • 332
11 votes
3 answers
4k views

Counting DNA nucleotides in C

I have written code to solve the following Rosalind problem. This is my first time writing in C and I would like a review of my code, particularly in regard to correctness and performance. ...
jma1991's user avatar
  • 113
11 votes
3 answers
645 views

FASTA-to-tsv conversion script

I worked on a script that takes as input a multi-sequence .fasta file and outputs the number of each aminoacid/sequence in a .tsv...
sachikox's user avatar
  • 113
11 votes
2 answers
9k views

Calculating the joint probability of n events from a sample sequence of occurrences

I'm writing an algorithm to take in a sample list of sequences of events, calculate 1-step transitional probabilities from the sequences, forward or in reverse, then calculate the joint probability of ...
Matt-Heun Hong's user avatar
11 votes
2 answers
1k views

Finding roughly matching genome sequences in Python dictionary

The purpose of my code here is to play a part in genome sequencing analysis, and while functional it takes days to run, so I am looking for any way I can improve speed. The input is up to 500 million ...
The Nightman's user avatar
11 votes
1 answer
126 views

Python genetic sequence visualizer

I'm a beginner at python, and this is my first major project. Inspired by this reddit post, I wrote a program that accepts a DNA sequence (in a FASTA file format) and generates a graphical ...
logwet's user avatar
  • 175
10 votes
3 answers
2k views

A simple C++ class for packing DNA strings

Introduction I have this small C++ program that packs a DNA string over alphabet ACGT into a bit vector, two bits per character. Code dnapack.hpp ...
coderodde's user avatar
  • 27k
9 votes
6 answers
3k views

Implementing a DNA codon table in C

I decided to redo the first program I wrote (after the hello world thing). So, what it does is to convert a DNA sequence string to an array of strings that represent the amino acids that are made in a ...
Darius Duesentrieb's user avatar
9 votes
6 answers
383 views

Analyzing genetic tags

I've gone back and forth a few times recently on my Perl coding style when it comes to module subroutines. If you have an object and you want to call the method bar ...
Daniel Standage's user avatar
9 votes
3 answers
916 views

Simple program to split DNA sequences based on ambiguous content

The problem I have a program that takes a file of DNA sequences as input and writes each entry to one of two output files: one file for sequences containing only canonical characters (...
Daniel Standage's user avatar
8 votes
3 answers
1k views

Filter out ambiguous bases from a DNA sequence

I have this function: ...
Paulo Sergio Schlogl's user avatar
8 votes
3 answers
571 views

Statistical calculations with sets of genes

The following piece of code executes 20 million times each time the program is called, so I need a way to make this code as optimized as possible. ...
Pranjal's user avatar
  • 191
8 votes
1 answer
100 views

Highly nested bioinformatics processing

I have a script for parsing BAM files. The script's input thus is lines like ...
Randoms's user avatar
  • 183
8 votes
2 answers
9k views

Longest common substring

I wrote a program to find the longest common subsequence among several strings. I used a naive algorithm and implementation. The motivation was solving the Rosalind problem at http://rosalind.info/...
Superbest's user avatar
  • 413
8 votes
1 answer
531 views

Calculating protein mass

This question is part of a series solving the Rosalind challenges. For the previous question in this series, see A sequence of mistakes. The repository with all my up-to-date solutions so far can be ...
Mast's user avatar
  • 13.1k
8 votes
1 answer
5k views

Genetic Algorithm in Python

I'm a new programmer, so any help is welcome. Preferably to make it faster, avoid heavy memory usage, and so on. ...
f.rodrigues's user avatar
8 votes
1 answer
1k views

Ramachandran plot (plotting the torsion angles of protein backbone)

I would like to have some insights on the code I created. It would be really insightful for me to get some feedback about the code, what I should do differently, if there is an easier, more elegant ...
Gábor Erdős's user avatar
7 votes
4 answers
4k views

Viterbi algorithm implementation in C

This is an implementation of the viterbi algorithm in C, following from Durbin et. al.'s book Biological Sequence Analysis (2002). There's more info in the heading about usage and what exactle the ...
Davigor's user avatar
  • 173
7 votes
4 answers
7k views

Genome string clump finding problem

I am trying to solve a bioinformatics problems from a Stepic course. The problem posed: find clumps of the same pattern within a longer genome. Motivation: Identifying 3 occurrences of the same ...
richnis's user avatar
  • 173
7 votes
1 answer
310 views

Statistics about gaps in DNA sequences

Noobie to Numba here, I'm trying to get faster code from existing function but the result is not faster. 10 times faster would be heaven, but I know nothing about optimization. This is code about ...
Julien Cochennec's user avatar
7 votes
2 answers
132 views

Foreach-loop for and print commands

How can I make the following code shorter or efficient (maybe with other loops or other nice ideas), and keep the current functionality? ...
user3075044's user avatar
7 votes
3 answers
509 views

Prefix Sum in Ruby, Genomic Range Query from Codility

I'm currently going through some lessons on Codility. I've just spent a couple of hours with GenomicRangeQuery, which is intended to demonstrate the use of prefix sums. The task description is here. ...
Dae's user avatar
  • 171
7 votes
2 answers
875 views

Calculate Hamming distance between DNA sequences in Ruby

I am requesting a review for my solution to this problem from exercism.io. I'm posting it here since there is not always input on solution submitted through exercism. The problem is as stated: ...
user9503053's user avatar
7 votes
1 answer
2k views

Counting K-mers (words) in a sequence string

I recently found out how to use joblib for parallelization. I want to iterate through this string seq in steps of 1 and count ...
O.rka's user avatar
  • 181
6 votes
4 answers
1k views

Generating DNA sequences and looking for correlations

I've written a script to generate DNA sequences and then count the appearance of each step to see if there is any long range correlation. My program runs really slow for a length 100000 sequence 100 ...
user avatar
6 votes
3 answers
1k views

The Genetic Code

This question is part of a series solving the Rosalind challenges. For the previous question in this series, see Wascally wabbits. The repository with all my up-to-date solutions so far can be found ...
Mast's user avatar
  • 13.1k
6 votes
3 answers
110 views

Building a report of DNA sites and chunks

Here is the slow part of my code: ...
Remi.b's user avatar
  • 617
6 votes
2 answers
265 views

Comparing 2 lists of peptide to spectrum rankings generated by 2 different algorithms

I'm seeking a general review, but I'm particularly interested in style. This program gets 2 lists of peptide to spectrum matches, so every spectrum title is linked to a list of 1 or 10 possible ...
user3700660's user avatar
6 votes
1 answer
3k views

Counting the occurrences of certain amino-acids in a file

I wrote this code to count the number of amino acids that appear in a proteome. However, I was recently told by someone I could improve it quite a lot to make it more readable and efficient by using ...
Biomage's user avatar
  • 249
6 votes
2 answers
1k views

Genomic Range Query

Recently I worked on one of the Codility Training - Genomic Range Query (please refer to one of the evaluation report for the detail of this training). The proper approach for this question is using ...
Ming-Chen's user avatar
6 votes
2 answers
228 views

Genetic Sequence Visualizer - Generating large images

Inspired by this reddit post, I have written a program that accepts a DNA sequence (in a FASTA file format) and generates a graphical representation. HIV virus and Ebola virus My program works like ...
logwet's user avatar
  • 175
6 votes
2 answers
258 views

Finding the most common DNA patterns of some given length

I'm working on an algorithm to search through 100,000+ lines of dna sequencing, with the fastest time possible. Here is my current code, I was wondering if there's any ways to make this run faster: <...
Jacob's user avatar
  • 93
6 votes
2 answers
165 views

Finding database matches and storing them in a glycopeptide structure

I am relatively new to C and would like some feedback on a function that I have written, if it adheres to C standards or if there are some other things which I could have done better/differently. <...
Bas Jansen's user avatar
6 votes
3 answers
2k views

Optimization for SQLite result set parsing

I am retrieving information from an SQLite database that gives me back around 20 million rows that I need to process. This information is then transformed into a dict of lists which I need to use. I ...
adwaraki's user avatar
  • 215
6 votes
1 answer
454 views

GenBank to FASTA format using regular expressions without Biopython

This is a Biopython alternative with pretty straightforward code. How can I make this more concise? ...
Ethan Hetrick's user avatar
6 votes
1 answer
181 views

Mapping DNA nucleotides into two-dimensional coordinates

I am the author of this package that turns DNA sequences into two dimensional visualizations. DNA, for the unaware, consists of four letters (A, T, G, and C). To convert the sequence, I am using this ...
Benjamin Lee's user avatar
6 votes
3 answers
196 views

Categorizing gene sequences read from a CSV file

I am relatively new to programming and would love to get some feedback on the following section of my code. ...
koreebay's user avatar
6 votes
1 answer
3k views

High performance parsing for large, well-formatted text files

I am looking to optimize the performance of a big data parsing problem I have using Python. The example data I show are segments of whole genome DNA sequence alignments for six primate species. Each ...
isosceleswheel's user avatar
6 votes
1 answer
4k views

Calculate query coverage from BLAST output

I have a BLAST output file and want to calculate query coverage, appending the query lengths as an additional column to the output. Let's say I have 2 7 15 <...
user3224522's user avatar
6 votes
1 answer
70 views

Optimizing __getitem__ for a bioinformatics script in Python

I'm writing a script for a bioinformatics application in Python that iterates through several sequences looking for amino acids in specific positions to calculate their frequency in relation to a ...
Eduardo Menotti's user avatar
6 votes
1 answer
841 views

Reading an Excel file and comparing the amino acid sequence of each data pair

Since I am fairly new to Python I was wondering whether anyone can help me by making the code more efficient. I know the output stinks; I will be using Pandas to make this a little nicer. ...
Timo's user avatar
  • 61
6 votes
1 answer
5k views

Needleman-Wunsch Grid Generation in Python

The Needleman-Wunsch algorithm is a way to align sequences in a way that optimizes "similarity". Usually, a grid is generated and then you follow a path down the grid (based off the largest value) to ...
Dair's user avatar
  • 5,824
5 votes
4 answers
900 views

Counting nucleobases in a nucleotide

This question is part of a series solving the Rosalind challenges. For the previous question in this series, see Calculating protein mass ruby. The repository with all my up-to-date solutions so far ...
Mast's user avatar
  • 13.1k
5 votes
3 answers
1k views

DNA reverse complement as fast as possible

This code is meant to compute the reverse complement for a given sequence of bases. The code is tested versus some test cases and seems to work so far. The primary goal is that it should be as fast ...
DrSvanHay's user avatar
  • 153
5 votes
3 answers
1k views

Loading a Protein Data Bank file into a numpy matrix

Here is my code: ...
Annabelle's user avatar
5 votes
3 answers
79 views

Counting GUAG introns in chromosomes

I have this code that is working fine but it's taking pretty much 100% of my cpu to run and it takes around 25min. I'd really like to optimize it but don't know what parts I could improve. The main ...
Tomb's user avatar
  • 61