Genetic Algorithms demonstration with word DNA in Perl
...r survival my $generation_count = 100000; # run for...ully"; } } sub select_parents { my $population = shift @...p_size; # increase the parenting slots for this population...-ing it with two random # integers between 0 and 2^$dna_len...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
Extract fasta sequence with Ids with Bash script
#!/bin/bash while IFS='' read -r line || [[ -n "$line" ]]; do echo "Text read from file: $line" samtools faidx ONT.fasta $line > $line.faa done < "$1"2382 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 %hash; my @files = glob "*.scf"; if (!$ARGV[0]){ print "Table file needed\n USAGE: $0 ta...2363 days ago
Clump Finding Problem Solved with Perl
...umps in a string. #Given: A string Genome, and integers k, L, and t. #Return: A...for (my $aa=0; $aa $max) { $max = $km;} #print "$km\t$myStr\n"; $myHash...values foreach my $name (keys %myHash){ print "$name " if $myHash{$name} ==...2361 days ago
Loop over with all files in a directory in bash
...na" ]; then echo "Processing $f file..." ff=$(basename "${f%.*}") echo $ff # take action on each file. $f store current file name mkdir $ff $path/SatsumaSynteny -q $ref -t $f -o $ff #c...2359 days ago
Fill up the form and blast with perl
...=> 'myForm', fields => { 'Algorithm' => 'blastx', 'BlastTargetSet' => 'ATH1_pep', 'QueryText' => $sequence, }, ); print $mech->content;...2353 days ago
Insert the sequence at desire location in multi-fasta file with Perl
#!/usr/bin/perl use warnings; use strict; use Bio::SeqIO; use Bio::Seq; use File::Copy; #ARGV[0] should be in following format --- Keep the coordinate sorte...2341 days ago
Create genome scaffolding with Perl
...{ ## equal bases, or absent bases, so consensus is easy...= { "query" => 0, # contig file for query sequences...-verbose => 0}); } print(STDERR "Loading query sequenc...; if(!exists($replacementSeqs{$sName}{score}) ||...2336 days ago