2493 days ago
Collision free write with Perl
...te into outfile -- collision free because of multicore usesage sub collision_free_write { my($outFile, $msg) = @_; open my $ofh, ">>", $outFile or die "$0 [$$]: open: $!"; flock $ofh, LOCK_EX...2488 days ago
Genetic Algorithms demonstration with word DNA in Perl
#!/usr/bin/perl -w # GA demonstration with...s) use strict; use Data::Dumper; # individuals in the popul...o individuals survived, dying peacefully"; } } sub select_...t2->{dna}; # note we do operations on BYTES, not BITS. T...x_entry_length letters, and uppercase them @dictionary = g...2399 days ago
Convert newline formated sequence into fasta format with perl
use strict; use warnings; my $filename = $ARGV[0]; open(my $fh, '2397 days ago
Perl script for calculate Levenshtein distance
sub levenshtein_dist { my ($str1, $str2) = @_; my ($len1, $len2) = (length $str1, length $str2); if ($len1 == 0) { return $len2; } if ($len2 == 0) { return $len1; } my %mat; for (my $i = 0; $i2367 days ago
Calculate Dinucleotide Frequency with Perl
#!/usr/bin/perl -w use strict; my ($genome, $head, $tail); my (%mono_nt, %di_nt); $/ = ">"; open my $fasta, '2365 days ago
Reformat the file names with Perl
#!/usr/bin/perl use strict; use warnings; use File::Copy qw(copy);; $| = 1; my %ha...sub read_fh { my $filename = shift @_; my $filehandle; open $filehandle, "...2363 days ago
Clump Finding Problem Solved with Perl
#Find patterns forming clumps in a string. #Given: A string Genome, and integers k, L, and t. #Return: All distinct k-mers forming (L, t)-clumps in Genome. use s...2361 days ago
Convert fastq to fasta in Perl
use Bio::SeqIO; #convert .fastq.gz to .fasta open my $zcat, 'zcat seq.fastq.gz |' or die $!; my $in=Bio::SeqIO->new(-fh=>$zcat, -format=>'fastq'); my $...2357 days ago
Fill up the form and blast with perl
...arabidopsis.org/Blast/'); $mech->submit_form( form_name => 'myForm', fields => { 'Algorithm' => 'blastx', 'BlastTargetSet' => 'ATH1_pep', 'QueryText' => $seque...2352 days ago