2947 days ago
Find and replace ambiguous characters in fasta file with Perl and Bioperl
...Bio::SeqIO->new(-file => $file, -format => $format); while (my $seq = $seqio_obj->next_seq()) { push(@seqArr, $seq); } } #@seqArr = sort { $a->id() cmp $b->id() } @se...2945 days ago
Find the number of each 2 consecutive characters AA, AC,AG,AT,CC,CA... with Perl
...$results{$&}) { $results{$&}++ } else { $results{$&} = 1; } } foreach (sort keys %results) { print "...2940 days ago
Perl script introduces control structures, arrays and hashes.
...=> 'AUGC', 'Number of seqs' => 2 ); print $sequence{'DNA'}, "\n"; # Control Loop: foreach foreach my $key (sort (keys %sequence)) { prin...2893 days ago
2735 days ago
Calculate some statistics for a DNA alignment with Perl
...ring ".$results->[0]{'Seq1'}." and ".$results->[0]{'Seq2'}."\n"; for (sort keys %{$results->[0]} ){...t "comparing ". $an->{'Seq1'}." and ". $an->{'Seq2'}. " \n"; for (sort keys %$an ){ next...2680 days ago
2667 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, '2369 days ago
Genetic Algorithms demonstration with word DNA in Perl
...} } @$pop_ref; printf "generation %d: size %dnleast fit DNA [%s]/%d\n most fit DNA [%s]/%d\n", $generation, scalar @sorted_population, dna_to_words($sorted_population[0]->{dna}),...2402 days ago
Create genome scaffolding with Perl
...'%s': identity (%f) too low\n", # $qName, $tName, $pid); } } printf(STDERR " done\n"); my %displayed = (); foreach my $seqID (sort(keys(%targetSeqs))){ my $f...2339 days ago