Perl script to calculate GC content !
#!/usr/bin/perl sub calculate_gc_content { my ($sequence) = @_; $sequence = uc($sequence); # Convert the sequence to uppercase my $gc_count = () = $sequence =~ /[GC]/g; my $total_ba..._content; } # Example usage: my $dna_sequence...116 days ago
Python script to convert Multi-line Fasta to Single-line Fasta
def multi_to_single_line_fasta(input_filename, output_filename):...tput_file: current_sequence = "" for lin...f a header line, write the previous sequence and then the new header...') current_sequence...115 days ago
Perl script to convert Multi-line Fasta to Single-line Fasta !
#!/usr/bin/perl use strict; use warnings; sub multi_to_single_..._filename': $!"; my $current_sequence = ""; while (my $line...f a header line, write the previous sequence and then the new header p...rent sequence $current_sequence...115 days ago
114 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 genom...114 days ago
Perl script for six frame translation !
#!/usr/bin/perl use strict; use warnings; use Bio::SeqIO;...Path to your input nucleotide sequence file in FASTA format my $inp...ta, -format => 'fasta'); my $sequence = $seqio->next_seq; # Step...slated_seq = translate_frame($sequence, $frame); my $frame_type...114 days ago
Python script for six frame translation of sequences !
from Bio import SeqIO from Bio.Seq import Seq def translate_frame(sequence, frame): if frame > 0: translated_seq = sequence[frame-1:].translate() else:...ord in records: print(f"Sequence ID: {record.id}") fo...s(frame)} Translation:\n{protein_sequence}...114 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 + 1) -> $i { my $substring = $sequence.substr($i, $min-repeat-length...peats; } # Example usage my $genome-sequence...114 days ago
Python script to find repeats in the DNA sequence !
def find_repeats(sequence, min_repeat_length=3): re...for i in range(len(sequence) - min_repeat_length + 1): substring = sequence[i:i+min_repeat_length]...sequence.count(substring) > 1 and substring not in repeats:...ats # Example usage genome_sequence...114 days ago
Raku script to find microsatellites in DNA fragments !
sub find-microsatellites($sequence, $min-repeat-length = 2, $max-repeat-len...max-repeat-length) { for ^($sequence.chars - $repeat-length * $min...> $i { my $substring = $sequence.substr($i, $repeat-length);...esult = find-microsatellites($genome-sequence)...114 days ago