Perl script to reverse complement a DNA sequence !
#!/usr/bin/perl -w $DNA = 'ACGGGAGGACGGGAAAATTACTACGGCATTAGC';...print "Here is the starting DNA:\n\n"; print "$DNA\n\n"; $revcom = reverse $DNA; $revcom =~ s/A/T/g; $rev..."Here is the reverse complement DNA: WRONG:\n\n"; print "$revc..."Here is the reverse complement DNA:\n\n";...2057 days ago
Perl One-Liner to print only non-uppercase letters
#Go through file and only print words that do not have any uppercase letters. perl -ne 'print unless m/[A-Z]/' dna.fa > dnaOnlyLowercase.fa #To lowercase everything perl -pne 'tr/[A-Z]/[a-z]/' dnaUpperCase.fa >dnawithoutuppercase.fa;1398 days ago
1354 days ago
Commandline for paired end reads simulation with BBMap !
(JitMetaENV) ➜ mixedSample git:(main) ✗ /home/urbe/Tools/bbmap/randomreads.sh ref=mixed.fa out=reads_BBMAP250.f...=250, mininsert=400, maxinsert=600, gaussian] Writing reference. Executing dna.FastaTo...1004 days ago
Raku script to find palindrome in genomes !
sub is-palindrome(Str $str) returns Bool { $str.=uc; # convert to...flip; } sub find-palindromes(Str $dna, Int $min-length, Int $max-le...length -> $length { for 0..^$dna.chars - $length -> $pos {...} } } # Example usage my $dna = "GGAT...439 days ago
Raku script to calculate GC content !
sub calculate-gc-content(Str $sequence) { my $gc-count = $sequence.comb(//).elem...return $gc-count / $total-bases * 100; } my $dna_sequence = "ATGCGCTAAAGCGCGCG...CGCGCGCGC"; my $gc_content = calculate-gc-content($dna_sequenc...126 days ago
108 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.gff...108 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...108 days ago
Raku script to find microsatellites in DNA fragments !
sub find-microsatellites($sequence, $min-repeat-length = 2, $max-repeat-length = 6, $min-repeat-count = 3) { my @microsatellites; for my $repeat-length ($min-...108 days ago