Algorithms
How to read fasta sequences from a file using PHP?

Here is a simple function in PHP to read fasta sequences from a file.
Your multifasta input file is “input.fasta”.
function read_fastas($filename){ $fh = fopen($filename, 'r'); $i= 0 ; $sequences = array(); while($line = fgets($fh)){ $i++; if($i%2==1){ $sequence['header'] = $line; } else{ $sequence['sequence'] = $line; array_push($sequences, $sequence); } } return $sequences; }
The rest of the script would go like this:
<?php $filename = "input.fasta"; //Define function function read_fastas($filename){ $fh = fopen($filename, 'r'); if (filesize($x) == 0) { //check if file is empty or not echo "Input file is empty!"; } else{ $i= 0 ; $sequences = array(); while($line = fgets($fh)){ $i++; if($i%2==1){ $sequence['header'] = $line; } else{ $sequence['sequence'] = $line; array_push($sequences, $sequence); } } return $sequences; } } //Call the function read_fastas(); //do something with your fasta ?>
Algorithms
MOCCA- A New Suite to Model cis- regulatory Elements for Motif Occurrence Combinatorics

cis-regulatory elements are DNA sequence segments that regulate gene expression. cis-regulatory elements consist of some regions such as promoters, enhancers, and so on. These regions consist of specific sequence motifs. (more…)
Algorithms
vs_Analysis.py: A Python Script to Analyze Virtual Screening Results of Autodock Vina

The output files obtained as a result of virtual screening (VS) using Autodock Vina may be large in number. It is difficult or quite impossible to analyze them manually. Therefore, we are providing a Python script to fetch top results (i.e., compounds showing low binding affinities). (more…)
Algorithms
How to search motif pattern in FASTA sequences using Perl hash?

Here is a simple Perl script to search for motif patterns in a large FASTA file with multiple sequences.
You must be logged in to post a comment Login