Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [bioinformatics]

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

3
votes
1answer
19 views

Ruby command to edit a field in a SAM file

Inspired by a bioinformatics question on Stack Overflow, I wanted to brush up on my Ruby knowledge, since I’ve been meaning to replace my command-line use of Perl by Ruby. Briefly, the problem ...
4
votes
1answer
199 views

Lazy Loading a Bioinformatic SAM record

I'm currently writing an API to work with Bioinformatic SAM records. Here's an example of one: ...
2
votes
1answer
60 views

Locate substrings within a file

Here, I am reading in a newline delimited file that can be millions of repeating lines that looks like this: ...
2
votes
1answer
69 views

Looping through file finding sequences

For an assignment, I had to loop through a text file, and report any positions that a user entered sequence was found. Is there any way I can make this code more efficient, because it seems like I'm ...
1
vote
2answers
46 views

Getting the frequency of letters in each position

I have a text file like this example: ...
6
votes
1answer
507 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 ...
14
votes
2answers
636 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 <...
2
votes
2answers
107 views

Counting average protein length from a proteome fasta file

this code is counting the average protein length (number of amino acids) across the proteome of some microbes. As it stands the code takes a very very long time to run, I think I'm being very ...
6
votes
1answer
112 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 ...
3
votes
1answer
60 views

Counting dinucletotide fractions & j2 index from a genome fasta file

I wrote this code to count the dinucletide fractions that appear in a genome (this is a sequence of two nucleotides, 'A','G','C','T', together). My code also calculates the j2 index (this is a very ...
5
votes
3answers
518 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 ...
6
votes
1answer
1k 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 ...
8
votes
1answer
82 views

Highly nested bioinformatics processing

I have a script for parsing BAM files. The script's input thus is lines like ...
6
votes
2answers
277 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: ...
2
votes
0answers
113 views

Smith-Waterman algorithm for local sequence alignment with affine gap penalties

The following is a summary from the top of my head so please correct me if I'm wrong. See the Wikipedia article for more. This is about determining the (score / edit distance of the) most similar ...
4
votes
1answer
166 views

Find a cyclic peptide with a given non-ideal spectrum

For a course I need to build a peptide from scratch that matches the given spectrum. So I start with the amino acids that are in the given spectrum and filter those out that do not have the right ...
3
votes
1answer
61 views

Determining whether a list of pathways and its genes are all included in another list

I am evaluating if a list of pathways and its genes has pathways included in another pathways. So the way I thought about it is to create a function that does just a single comparison. ...
6
votes
2answers
108 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 ...
11
votes
1answer
92 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 ...
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 ...
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 ...
4
votes
1answer
158 views

Program to process fastq files

My program evaluates fastq files. The fastq file is just a huge text file (about 1,5gb in my case), which looks like this: ...
2
votes
1answer
134 views

Push Down Automaton to detect RNA hairpins

For one of my assignments I am supposed to write a Push Down Automaton. It's supposed to receive a string that has to be checked if it's an RNA Hairpin. For example: gacgcaaguc would be one, since ...
5
votes
0answers
467 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 ...
5
votes
1answer
382 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 ...
4
votes
2answers
68 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 ...
3
votes
2answers
69 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 ...
4
votes
2answers
732 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 ...
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 ...
0
votes
1answer
89 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 ...
13
votes
2answers
426 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 ...
4
votes
1answer
67 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,...
7
votes
4answers
1k 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 ...
9
votes
3answers
411 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 (...
5
votes
1answer
1k 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 ...
6
votes
2answers
194 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: <...
3
votes
1answer
57 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 ...
2
votes
1answer
48 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 ...
3
votes
1answer
216 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 ...
10
votes
2answers
720 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 ...
1
vote
0answers
2k 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 ...
4
votes
4answers
531 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 ...
3
votes
1answer
106 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 ...
5
votes
1answer
363 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 ...
3
votes
1answer
211 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 ...
3
votes
1answer
1k 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 ...
4
votes
3answers
353 views
2
votes
1answer
133 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: ...
3
votes
0answers
341 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},\...
5
votes
1answer
84 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 ...