Perl script to reverse complement a DNA sequence !
#!/usr/bin/perl -w $DNA = 'ACGGGAGGACGGGAAAATTACTACGG...print "Here is the starting DNA:\n\n"; print "$DNA\n\n"; $revcom = reverse $DNA; $revcom =~ s/A/T/g; $rev...ere is the reverse complement DNA: WRONG:\n\n"; print "$revc...ere is the reverse complement DNA:\n\n"; print "$revcom\n";...2036 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;1377 days ago
1333 days ago
Commandline for paired end reads simulation with BBMap !
...ed.fa, out=reads_BBMAP250.fq, paired, interleaved, reads=100k, length=250, mininsert=400, maxinsert=600, gaussian] Writing reference. Executing dna.FastaToChromArrays2 [mixed.fa...983 days ago
Raku script to find palindrome in genomes !
...r eq $str.flip; } sub find-palindromes(Str $dna, Int $min-length, Int $max-le...gth..$max-length -> $length { for 0..^$dna.chars - $length -> $pos {...} } } } # Example usage my $dna = "GGATCCATGGCCTAGG"; # examp...418 days ago
Raku script to calculate GC content !
...$sequence.chars; return $gc-count / $total-bases * 100; } my $dna_sequence = "ATGCGCTAAAGCGCGCGCCTTACGCGCGCGCGC"; my $gc_content = calculate-gc-content($dna_sequence); say "DNA Sequen...105 days ago
88 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...88 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...88 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 ($...88 days ago