Genetic Algorithms demonstration with word DNA in Perl
...foreach my $slot (1..$pop_size) { my $index = sample(\@weights); # we...ights array here # do sanity checking on $index die "Undefined index retur...iduals if rand() returns more than mut_rate next if rand > $mut_rate; # mu...2386 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"2369 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, '2353 days ago
Reformat the file names with Perl
...print "Table file needed\n USAGE: $0 table\n"; exit;} my $ifh = read_fh($ARGV[0]); while (my $line = ) { next if $line =~ /^#/; #next...$//; my @pName = split /\_/, $files[$_]; next if ! $hash{$pName[0]}{sps} o...2351 days ago
Clump Finding Problem Solved with Perl
...GAAGACTGAGTGAAGAGAAGAGGAAACACGACACGACATTGCGACATAATGTACGAATGTAATGTGCCTATGGC"; my $subStr="?"; my $clump=4; my $kmer=5; for (my $aa=0; $aa $max) { $max = $km;} #print "$km\t$my...2349 days ago
Convert fastq to fasta in Perl
...-format=>'fastq'); my $out=Bio::SeqIO->new(-file=>'>seq.fasta', -format=>'fasta'); while (my $seq=$in->next_seq) { $out->write_se...2345 days ago
Fill up the form and blast with perl
...p://www.arabidopsis.org/Blast/'); $mech->submit_form( form_name => 'myForm', fields => { 'Algorithm' => 'blastx', 'BlastTargetSet' => 'ATH1_pep', 'QueryText' => $sequence, }, );...2340 days ago
Insert the sequence at desire location in multi-fasta file with Perl
...at --- Keep the coordinate sorted by name+location #GenomechrName locationStart AlienGene AlienLength # The coordinate should not overlaps --- next postition shold be bigger th...2329 days ago
Create genome scaffolding with Perl
...n( ($a < $b) ? $a : $b); } sub max { ($a, $b) = @_; return...) = @_; $seq =~ tr/ACGTUYRSWMKDVHBXN-/TGCAARYSWKMHBDVXN-/; # w...g file for query sequences "prefix" => "psl_scaffold_", # prefix...0, $postTrim); my $preLen = max(length($sPre), length($lPre))...2323 days ago
Plot the clock using Lastz -gerenal outfile
...$mSize=$ARGV[1]; open (my $fh2, $fileN) or die "Could not open file $fileN $!"; my (@allKeys, @allFreq); my %pHash; while() { chomp; next if /^$/; #next if empty my @arr = split("...2314 days ago