Collision free write with Perl
#Write into outfile -- collision free because of multicore usesage sub collision_free_write { my($outFile, $msg) = @_; open my $ofh, ">>", $outFile or die "$0 [$$]: open:...2493 days ago
Genetic Algorithms demonstration with word DNA in Perl
...{ my $population = shift @_; my $pop_size = scalar @$population; # populat...{ my $population = shift @_; my $pop_size = scalar @$population; # populat...itness() only my @dictionary; my %freqs; # calculate the fitness of the DNA...2404 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; $i2372 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, '2370 days ago
Clump Finding Problem Solved with Perl
...eturn: All distinct k-mers forming (L, t)-clumps in Genome. use strict; use warnings; my %myHash; my $string="CGGACTCGACAGATGTGAAGAAATGTGAAGACTGAGTGAAGAGAAGAGGAAACACGACACGACATTGCGACATAATGTACGAAT...2366 days ago
Loop over with all files in a directory in bash
...mes-2017-11-13/* ref=/media/ComparativeGenomics/ncbi-genomes-2017-11-13/GCA_000196735.1_ASM19673v1_genomi...t file name mkdir $ff $path/SatsumaSynteny -q $ref -t $f -o $ff #cat $f fi done2364 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, -...2363 days ago
Fill up the form and blast with perl
use WWW::Mechanize; use strict; use warnings; my $mech = WWW::Mechanize->new; my $sequence = 'GCCCGCGGTCTCAGAGATCTCGATATATTATA'; $mech->get('http://www.arabidopsis.org/Blas...2357 days ago
Insert the sequence at desire location in multi-fasta file with Perl
...ct; use Bio::SeqIO; use Bio::Seq; use File::Copy; #ARGV[0] should be in following format --- Keep the coordinate sorted by name+location #GenomechrName locationStart AlienGene AlienLengt...2346 days ago
Create genome scaffolding with Perl
...1.00"; =head1 NAME psl_scaffolder.pl - use self-mapped PSL file to scaffold a genome =head1 SYNOP...); # if "simple" ambiguity can be found, return that, other...scalar(@fields)),...$i = 0; $i {"prefix"}, $nextScaffoldID++); if(!exists(...2341 days ago