2930 days ago
Count the frequency of base G in a given DNA sequence
#!/usr/bin/perl use strict; use warnings; my $DNA = "GATTACACAT"; #initialize $countG and $currentPos my $countG = 0; my $currentPos = 0; #calculate the length of $DNA my $DNAlength = length($DNA);...2930 days ago
2930 days ago
Read lines from input file – print lines that match a regular expression
#!/usr/bin/perl use strict; use warnings; my $line; #read the line-by-line for each line ask if it matches the regex print it if it matches while($line = ){ chom...2930 days ago
2929 days ago
Perl script to Mutate a DNA Sequence
...print "Cannot open file \"$dnafilename\"\n\n"; goto h; } my $DNA = ; close DNAFILE; my $i; my $mutant; $mutant = m...return int rand length $string; } sub randomelement { my(@array) = @_; return $ar...2929 days ago
Retrieve NCBI GenBank records with a range of accession numbers
...ent; use HTTP::Request::Common; my %param = ( query =>...ch(%param); sub _doSearch { my %param = @_; my $esear...=~ m/(\d+).*(\d+).*(\S+)/s; my $count = $1; my $que...ile: $!"); } sub message { my $verbose = shift; my $me...2929 days ago
A multilayer perceptron (MLP) neural network in Perl
...data #and set to 1 ################ User settings ######### my $numEpochs = 500; my $numHidden = 4; my $LR_IH =...# load in the data initData(); # train the network for(my $j = 0;$j...2929 days ago
Extract a random sequence from a file
...e warnings; use autodie; use List::Util qw/ shuffle /; my $outputfile = 'randomoutput.txt'; open my $in_fh, '', $outputfile;...(my $line = ) { next unless $line =~ /^([ATGCN]+)/; my $genome = $1; my $len...2928 days ago
2923 days ago