Questions tagged [bioinformatics]

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

Filter by
Sorted by
Tagged with
4 votes
1 answer
1k views

Genomic Range Query in Python

Recently, I worked on one of the Codility Training - Genomic Range Query (please refer to one of the evaluation report for the detail of the task. The solution in Python is based on prefix sum, and ...
sivan shani's user avatar
3 votes
2 answers
75 views

Molecule and ligation finding program

I wrote this code so I could figure out the number of molecules within a plasmid and an insert of DNA. I then get the amount of insert DNA I would need to use (in uL) for a ligation with the DNA at ...
APowers's user avatar
  • 31
3 votes
2 answers
99 views

Python CLI for download/updating large UniProt protein databases

Background This script is can be used as a command line interface (CLI) or a sub-module in another program to download the latest UniProt proteome for a given taxon. Files are downloaded to the same ...
James Draper's user avatar
4 votes
2 answers
2k views

Finding a Protein Motif

I've solved the meaty bits of this bioinformatics problem, albeit a bit clumsily I think. In particular I've messed around with manipulating the fasta info into a form ...
Sank Finatra's user avatar
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
0 votes
1 answer
138 views

PCR analysis on data imported from Excel

I'm writing a program that is going to analyse some data imported from an Excel spreadsheet. It is currently running quite slow (couple seconds on an average machine) and I was wondering whether it ...
FatMan's user avatar
  • 101
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
4 votes
1 answer
78 views

Extraction of mutational data from large files in R

I previously published an article on a new method for analysing RNA-seq data as part of my PhD studies, and I'm now working on making this into an R package. I don't come from a programming background,...
erikfas's user avatar
  • 269
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
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
5 votes
1 answer
2k views

Multiple sequence alignment in Java

(The entire project lives here.) Problem definition Suppose we are given three genomic strings drawn from the alphabet of 20 amino acids: ACGH CFG EAC In ...
coderodde's user avatar
  • 27k
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
3 votes
1 answer
97 views

Python command-line program to convert genomic data file

Background: I have written this code to transforme a .csv file exported from a software called Geneious containing SNPs and concatenate them into a DNA sequence. So basically take fields from .csv ...
PmmA's user avatar
  • 33
2 votes
1 answer
57 views

Check value existence in two lists and gather the result in a csv

I have two lists of protein sequences, I have to check every entry's existence in the two lists, say like ...
Bobby's user avatar
  • 201
3 votes
1 answer
434 views

Implementing multiprocessing to compare large number of entries in a python dictionary

I am a beginner in python programming, and I am trying to implement multiprocessing to the code I use daily for my data treatment. Essentially, the input file has around 10 - 30 millions of reads ...
Yinzhou Zhu'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
1 vote
0 answers
4k views

Traceback in sequence alignment with affine gap penalty (Needleman-Wunsch)

I am working on an implementation of the Needleman-Wunsch sequence alignment algorithm in python, and I've already implemented the one that uses a linear gap penalty equation for scoring, but now I'm ...
Iocust's user avatar
  • 21
5 votes
4 answers
901 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
3 votes
1 answer
134 views

Analyzing pair by pair DNA sequences with for loops in Python

Here is a code I would need to make far faster: it is made to analyse more than 3000 DNA sequences of more than 100 000 characters each. The matter is I have to compare it by pair, so that would be ...
Natha's user avatar
  • 347
5 votes
1 answer
783 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 ...
Jose Lopez's user avatar
3 votes
1 answer
302 views

Unique nucleotide permutations, Python itertools product

I'm searching for all the unique possible permutations of nucleotide given a defined length. By unique, I mean the reverse complement would not be counted. ACGT For example, permutations of length ...
Kako's user avatar
  • 127
3 votes
1 answer
2k views

Python script which translates a DNA sequence

For my Biology class, I made a Python script which takes a DNA sequence as input, translates it into an mRNA sequence, and then again into a tRNA sequence. It then matches each mRNA codon with an ...
vkumar's user avatar
  • 307
5 votes
3 answers
1k views

Loading a Protein Data Bank file into a numpy matrix

Here is my code: ...
Annabelle's user avatar
3 votes
1 answer
517 views

Parsing GTF file using command-line

I am extracting exons details from a GTF file using command line in Unix like cut, awk, grep or sed. input file.gtf: ...
Zingo's user avatar
  • 131
3 votes
0 answers
599 views

Edit distance (Optimal Alignment) - follow up

This is a follow up of this question Optimal substructure of ED: Here is the reasoning behind my solution: let \$x = (\alpha _{1},\alpha _{2},\alpha _{3},...,\alpha _{m})\$ and \$y = (\beta_{1},\...
MAG's user avatar
  • 2,954
5 votes
1 answer
96 views

Calculating how similar two objects are according to a database

I want to calculate how similar two objects are according to a database. However the code is very slow; it takes around 2 minutes to analyze just 3 objects. How can I speed it up? I have tried to ...
llrs's user avatar
  • 273
1 vote
0 answers
745 views

Needleman–Wunsch algorithm in Rust

The Needleman–Wunsch algorithm is an algorithm used in bioinformatics to align protein or nucleotide sequences. Here is an implementation in Rust: ...
qed's user avatar
  • 1,429
2 votes
1 answer
175 views

Returning substrings (motifs) and original strings (sequences) from a file of strings (sequences)

I would like to get some help/tips on writing better and more pythonic code, as well as variable naming. Code info: .backtranscribe() is just a method to convert ...
Kevin Chen'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
2 votes
2 answers
185 views

Reading genetic data in VCF and Tabix formats using an asynchronous library

I'm working with an open-source library for processing and parsing genetic data in VCF and Tabix formats. It contains functions and classes that make it easy to read an index file (a Tabix) and load ...
5813's user avatar
  • 131
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
5 votes
3 answers
179 views

Nucleotide count in Scala

This is my second day in learning Scala and I still need to develop a taste of functional programming, I often find myself doing imperative coding. Below is the result of my TDD practice. Code ...
CodeYogi's user avatar
  • 5,087
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
2 votes
2 answers
113 views

A sequence of mistakes

This question is part of a series solving the Rosalind challenges. For the previous question in this series, see The Genetic Code. The repository with all my up-to-date solutions so far can be found ...
Mast's user avatar
  • 13.1k
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
2 votes
0 answers
288 views

Needleman Wunsch algorithm in Scala

The Needleman–Wunsch algorithm is an algorithm used in bioinformatics to align protein or nucleotide sequences. Here is an implementation in Scala: ...
qed's user avatar
  • 1,429
2 votes
0 answers
54 views

Adding information to a compressed file and compressing the output

I wrote this script for adding information to a compressed file and compressing the output: ...
tommy.carstensen's user avatar
2 votes
1 answer
77 views

Compare sequence & maps headers in fasta file

This is the perl code which compares the sequence in fasta file & maps the header. Though the code is working well, I still would like to make it more efficient. Since the files I compare has >...
Arun's user avatar
  • 201
1 vote
1 answer
496 views

Calculate and plot statistics on an R matrix

My goal is to iterate over a datamatrix, calculate mean, standard error of the mean, and then have a bar plot representing the 2 groups of my data matrix in R. My code below works as a for loop. ...
BioProgram's user avatar
2 votes
0 answers
65 views

Determining if a genetic sequence is palindromic

Adding another level to my previous question on 'normal' palindrome identification, in this one I'm interested in identifying genetic palindromes. Here's my attempt: ...
Daniel's user avatar
  • 825
1 vote
1 answer
67 views

Collating creature descriptors spread across multiple stanzas

I have been using Python for only a few days, so I am trying to learn about some best practices. An explanation of what this code is supposed to do is at the bottom of this post. It is an exercise to ...
bio_inf_dreamer's user avatar
5 votes
1 answer
171 views

VCF parser for eventual genomic data visualization

I've just started out writing an app that will visualize genomic data for anybody to understand. When you get your genome sequenced the raw data usually comes in the form of a VCF file. I started out ...
Korley Labs's user avatar
4 votes
1 answer
1k views

Rosalind problem "Consensus and Profile"

Source: Rosalind("Consensus and Profile") Brief summary ...
Sergii K's user avatar
  • 666
19 votes
2 answers
543 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
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
3 votes
1 answer
87 views

V Snare T Snare Model

In the beginning, everything is defined to be of value 10, but I have to change them to suit them for different possible values, hence those are changing. I'm a (Im)mature C coder, hence there might ...
user2754673's user avatar
2 votes
1 answer
72 views

Compare a sequence with the reference frequency of hexamers

I have written this function (and others similar to that one) But I am not sure I am using references on their full power. My currently concerns is if I make a huge use of memory. The subroutine ...
llrs's user avatar
  • 273
4 votes
2 answers
1k views

DNA base pair match counter

So my code is done it outputs exactly what it needs to I'm just wondering if it is possible to make this code a lot more simple using objects. If so could someone tell me what I would need member-wise ...
Motorscooter's user avatar
2 votes
2 answers
199 views

Rosalind string algorithm problems

I've been starting to learn Rust by going through some of the Rosalind String Algorithm problems. If anyone would like to point out possible improvements, or anything else, that would be great. There ...
user673679's user avatar
  • 11.6k
7 votes
3 answers
510 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