Raku script to find palindrome in genomes !
sub is-palindrome(Str $str) returns Bool { $str.=uc; # convert to uppercase $str.=subst:g/\s+//; # remove any spaces return $str eq $str.flip; } sub find-palindrome...425 days ago
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...96 days ago
Python script to convert Multi-line Fasta to Single-line Fasta
...st sequence if current_sequence: output_file.write(current_sequence + '\n') print(f"Successfully converted {input_filename} to {output...96 days ago
Perl script to convert Multi-line Fasta to Single-line Fasta !
...print $output_file $current_sequence . "\n" if $current_sequence; close $input_file; close $output_file; print "Successfully converted $input_filename to $output_...96 days ago
Bash script to convert Multi-line Fasta to Single-line Fasta !
...awk '/^>/ {printf("\n%s\n", $0);next; } { printf("%s", $0);} END {printf("\n");}' "$input_filename" > "$output_filename" echo "Successfully converted $input_filename to $output_...96 days ago
Python script to convert fastq to fasta
def fastq_to_fasta(fastq_file, fasta_file): with open(fastq_file, 'r') as fq: with open(fasta_file, 'w') as fa: while True:...39 days ago