363 days ago
Raku script to calculate GC content !
sub calculate-gc-content(Str $sequence) { my $gc-count = $sequence.comb(//).elems; my $total-...ses = $sequence.chars; return $gc-count / $total-bases * 100; } m...GCGCGCGC"; my $gc_content = calculate-gc-content($dna_sequence); say "DN...175 days ago
Raku script to find SSRs in fastq file !
...while $fh.readline -> $header { $line-number++; my $sequence = $fh.readline.chomp; # Skipping the next two lines (comment and quality lines) $...175 days ago
Perl script to calculate GC content !
.../usr/bin/perl sub calculate_gc_content { my ($sequence) = @_;...equence to uppercase my $gc_count = () = $sequence =~ /[GC]/g;...= length($sequence); my $gc_content = ($gc_count / $total_base...ntent($dna_sequence); printf "GC content: %.2f%%\n", $gc_content;160 days ago
Python script to convert Multi-line Fasta to Single-line Fasta
...name, 'w') as output_file: current_sequence = ""...the new header if current_sequence:...# If a sequence line, concatenate to the current sequence...159 days ago
Perl script to convert Multi-line Fasta to Single-line Fasta !
...en file '$output_filename': $!"; my $current_sequence = ""; while (...sequence and then the new header print $output_file $current_sequenc...} # Write the last sequence print $output_file $current_sequenc...159 days ago
Bash script to convert Multi-line Fasta to Single-line Fasta !
#!/bin/bash input_filename="multi_line.fasta" output_filename="single_line.fasta" awk '/^>/ {printf("\n%s\n", $0);next; } { printf("%s", $0);} END {printf("\n");}' "$input_filename" > "$out...159 days ago
158 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...158 days ago
Perl script for six frame translation !
...frame); my $frame_type = $frame > 0 ? "Forward" : "Reverse"; print "Frame $frame_type $frame Tra...->seq; } else { # If frame is negative, reverse and complement the sequence before translati...158 days ago