Python script to convert Multi-line Fasta to Single-line Fasta
...'w') as output_file: current_sequence = "" for lin...# If a header line, write the previous sequence and then the new header...ip() + '\n') current_sequence = "" els...100 days ago
Perl script to convert Multi-line Fasta to Single-line Fasta !
...e '$output_filename': $!"; my $current_sequence = ""; while (my $line...# If a header line, write the previous sequence and then the new header...to the current sequence $current_sequence .= $line; } }...100 days ago
99 days ago
Perl and BioPerl script to extract protein sequences using GFF file !
#!/usr/bin/perl use strict; use warnings; use Bio::DB::Fasta; use Bio::SeqIO; # Paths to your GFF file and genome FASTA file my $gff_file = 'path/to/your/file.gf...99 days ago
Perl script for six frame translation !
...# Path to your input nucleotide sequence file in FASTA format my $inp...fasta, -format => 'fasta'); my $sequence = $seqio->next_seq; # Step...ranslated_seq = translate_frame($sequence, $frame); my $frame_type...tive, reverse and complement the sequence before translation m...99 days ago
Python script for six frame translation of sequences !
...import Seq def translate_frame(sequence, frame): if frame > 0: translated_seq = sequence[frame-1:].translate() el...ecord in records: print(f"Sequence ID: {record.id}") fo...abs(frame)} Translation:\n{protein_sequence}\n") # Replace 'path/to/yo...99 days ago
Raku script to find repeats in sequences !
sub find-repeats($sequence, $min-repeat-length = 3) { my @repeats; for ^($sequence.chars - $min-repeat-length +...-> $i { my $substring = $sequence.substr($i, $min-repeat-length...} # Example usage my $genome-sequence = "ATCGATCGATCGATCG"; my @re...99 days ago
Python script to find repeats in the DNA sequence !
def find_repeats(sequence, min_repeat_length=3): repeats = [] for i in range(len(sequence) - min_repeat_length + 1): substring = sequence[i:i+min_repeat_length]...rn repeats # Example usage genome_sequence = "ATCGATCGATCGATCG" result...99 days ago
Raku script to find microsatellites in DNA fragments !
sub find-microsatellites($sequence, $min-repeat-length = 2, $max-rep...-repeat-length) { for ^($sequence.chars - $repeat-length * $min...i { my $substring = $sequence.substr($i, $repeat-length);...lt = find-microsatellites($genome-sequence); say "Microsatellites fou...99 days ago
Perl script to calculate the basic stats of the assembled genome !
...=> 'fasta'); # Variables for computing statistics my $total_length = 0; my $num_contigs = 0; my @contig_lengths; # Iterate through each sequence in the assembly while (my $s...99 days ago