2929 days ago
Count the frequency of base G in a given DNA sequence
...se warnings; my $DNA = "GATTACACAT"; #initialize $countG and $currentPos my $countG = 0; my $currentPos = 0; #calculate the length of $DNA my $DNAlength = length($DNA); #for each...2929 days ago
Parse a genbank file using regular expressions
...$2\n"; } elsif (/(ORGANISM\s*)(.*)/) { print "Organism: $2\n"; } elsif(/(gene)(\s*)(\d*)(\.\.)(\d*)/) { print "Gene length: $5\n"; } elsif (/(CD...2929 days ago
Perl script to Mutate a DNA Sequence
...substr($dna,$position,1,$newbase); return $dna; } sub randomposition { my($string) = @_; return int rand length $string; } sub randomelem...2928 days ago
Extract a random sequence from a file
...= 21; my $count = 10; while (my $line = ) { next unless $line =~ /^([ATGCN]+)/; my $genome = $1; my $len_genome = length $genome; my @start_poin...2927 days ago
Blast result parser with Perl and Bioperl
...wing results are reported: # accesion number, length, description, E value, bit sc...iminated columns print OUT "query_name\tquery_length\taccession_number\tlength\tde...T $result->query_name . "\t"; # the length of the query sequence p...2926 days ago
Generating a random string with Perl
...on generates random strings of a given length sub generate_random_string { my $length_of_randomstring=shift;# the l...); my $random_string; foreach (1..$length_of_randomstring) { # ra...string: ".$random_string."\n"; print "Length: ".length($random_string)."\n...2919 days ago
Needleman-Wunsch Algorithm in Perl
#!/usr/bin/perl # USAGE: perl nw.pl HEAGAWGHEE PAWHEAE BLOSUM50.txt -8 # See: "Biological sequence anaysis" Durbin et al. ed. CUP 1998, Pg. 19 # Needleman-...2917 days ago
Count GC Content in nucleotide sequence with Perl
...ontent\tTotal Count\tG Count\tC Count\tA Count\tT Count\n"; $seq = ""; while () { chomp; if (/^>/) { #finish up previous line. if (length($seq) > 0) { &process_i...2917 days ago
Implementation of biological random mutation with Perl
#!/usr/bin/perl -w use strict; use warnings; #sequence for a better recognition my $DNA="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA \ n";...2913 days ago