Questions tagged [bioinformatics]

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

Filter by
Sorted by
Tagged with
18
votes
2answers
465 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', ...
14
votes
2answers
669 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 <...
13
votes
2answers
563 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 ...
12
votes
1answer
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: ...
11
votes
5answers
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 ...
11
votes
3answers
3k 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. ...
11
votes
3answers
353 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...
11
votes
2answers
8k 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 ...
11
votes
1answer
106 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 ...
10
votes
3answers
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 ...
10
votes
2answers
830 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 ...
9
votes
6answers
2k 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 ...
9
votes
6answers
368 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 ...
9
votes
3answers
525 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 (...
8
votes
3answers
564 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. ...
8
votes
1answer
84 views

Highly nested bioinformatics processing

I have a script for parsing BAM files. The script's input thus is lines like ...
8
votes
1answer
260 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 ...
8
votes
1answer
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. ...
8
votes
1answer
871 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 ...
7
votes
4answers
2k 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 ...
7
votes
4answers
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 ...
7
votes
1answer
199 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 ...
7
votes
3answers
417 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. ...
7
votes
2answers
519 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: ...
7
votes
1answer
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 ...
6
votes
4answers
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 ...
6
votes
3answers
774 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 ...
6
votes
3answers
104 views

Building a report of DNA sites and chunks

Here is the slow part of my code: ...
6
votes
2answers
259 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 ...
6
votes
1answer
2k 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 ...
6
votes
2answers
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 ...
6
votes
2answers
153 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 ...
6
votes
2answers
223 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: <...
6
votes
3answers
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 ...
6
votes
1answer
66 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? ...
6
votes
1answer
126 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 ...
6
votes
3answers
161 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. ...
6
votes
1answer
2k 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 ...
6
votes
1answer
3k 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 <...
6
votes
2answers
110 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? ...
6
votes
1answer
820 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. ...
6
votes
1answer
3k 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 ...
5
votes
3answers
779 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 ...
5
votes
3answers
71 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 ...
5
votes
2answers
420 views

Reflecting emotion classification based on the Lövheim cube

Background I created a simple class to reflect emotion classification based on the Lövheim cube. The code is not scientific at all, and I just did it for fun, but I want all code I write to be as ...
5
votes
3answers
796 views

FASTA file processing using Python to invoke external filters

I am very new to programming and this is my first functional code. It works fine but I'm sure that I could use a lot of optimization. If you see any blunders or would be able to help condense the ...
5
votes
2answers
189 views

Fast comparison of molecular structures and deleting duplicates

I have a program that reads in two xyz-files (molecular structures) and compares them by an intramolecular distance measure (dRMSD, Fig. 22). A friend told me that my program structure is bad, and as ...
5
votes
2answers
89 views

Converting domain-specific regular-expressions to a list of all matching instances

There seem to be several questions floating around Stackexchange regarding how to take a python regular expression list the matching instances. This problem is a bit different because 1) I'm need to ...
5
votes
1answer
509 views

Reading string from a text file and returning the number of occurrences of each substring of length k

This program takes a simple nucleotide sequence and finds the most common "k-mers" in the sequence, as determined by the supplied dataset (see below). The goal of the program is to find the origin of ...
5
votes
2answers
154 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. <...