Count the frequency of base G in a given DNA sequence
...trict; use warnings; my $DNA = "GATTACACAT"; #initialize $countG and $currentPos my $countG = 0; my $currentPos = 0;...in the sequence check if it is the base G #if 'yes' increment $countG while($currentPos < $DNAlen...2909 days ago
Perl script to count the number of Adenine, Thymine, Guanine and Cytosine in your DNA Sequence
...ile is:\n $DNA \n"; $DNA =~ s/\s//g; @DNA = split( '', $DNA ); $count_of_A = 0; $count_of_C = 0; $count_of_G = 0;...rs; } } print "Adenine = $count_of_A\n"; print "Cytosine = $count_of_C\n"; print "Guanine = $c...2908 days ago
Retrieve NCBI GenBank records with a range of accession numbers
...$esearch_result =~ m/(\d+).*(\d+).*(\S+)/s; my $count = $1; my $query_key...nv = $3; if ( defined( $param{maxRecords} ) ) { if ( $count > $param{maxRecords} ) {...2908 days ago
Extract a random sequence from a file
...txt'; open my $in_fh, '', $outputfile; my $size = 21; my $count = 10; while (my $line...ts = shuffle(0 .. $len_genome-$size); next unless @start_points >= $count; print substr($genome, $_...2907 days ago
Blast result parser with Perl and Bioperl
...OUT "\tNo hits found\n"; } else { my $count = 0; # pro...= $result->next_hit) { print OUT "\t" if ($count > 0);...$hspcount++; } $count++;...2906 days ago
Count GC Content in nucleotide sequence with Perl
...---------------------------------- print OUT "ID\t% GCContent\tTotal Count\tG Count\tC Count\tA Count\tT Count\n"...print OUT "$gccontent\t$totalcount\t$gcount\t$ccount\t$acount\t$tcount\n"; $seq = ""; }...2897 days ago
2864 days ago
2696 days ago
Count the number of N in fasta file with Perl
#!/usr/bin/perl my ($h, $n, $l); open(I,$ARGV[0]) or die($!); while(){ chomp; if(/^>/){ $h=substr($_,1); }else{ $n=($_=~tr/nN/nN/); $l=length($_); print $h,"\t",$l,"\t",$n,"\t",$n/($l-$n),"\n"; } } close(I);2458 days ago
Genetic Algorithms demonstration with word DNA in Perl
...tness for survival my $generation_count = 100000; # run for...neration = 0; # generation counter my $pop_ref = [];...t @_ or return undef; # internal counting variables my ($count, $s...while ($generation++ < $generation_count); # run until we are out of...2364 days ago