Calculate some statistics for a DNA alignment with Perl
...{ $_->display_id } $alnobj->each_seq; my $results = $stats->calc_KaKs_pair($alnobj, $seq1id, $seq2id);...,$_ , $results->[0]{$_}); } my $results2 = $stats->calc_all_KaKs_pairs($alnobj); for my $an (@$...2650 days ago
Genetic Algorithms demonstration with word DNA in Perl
...qs{$entry}; } return $fitness; } # end of fitness() } # Function to sample from an array of weighted elements # originally written by Abigail # Documentation for the al...2373 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"2355 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, '2339 days ago
Reformat the file names with Perl
...sps}"."_$pName[0]"."_$hash{$pName[0]}{code}"."_$pName[1]"."."."scf"; if ( -f "$files[$_].scf" ) { copy("$files[$_].scf", $newName) or die "Copy failed: $!"; } } sub read...2337 days ago
Create genome scaffolding with Perl
...max number of overlapping bases outside match region }; GetOptions($projOpts, 'query=s', 'pid=i', 'trimlimit=i', 'prefix=s'); # process remaining command line arguments (h...2309 days ago
Perl script to remove fasta sequences in multifasta file with certain length threshold
#!/usr/bin/perl use strict; use warnings; my $minlen = shift or die "Error: `minlen` parameter not provided\n"; { local $/=">"; while() { ch...2252 days ago
Plot custom gene density with R
library(karyoploteR) pp2251 days ago
Perl script to find palindromic regions in DNA sequences
use strict; use warnings; my $pp = qr/(?: (\w) (?1) \g{-1} | \w? )/ix; my $filename = $ARGV[0]; open(my $fh, '2155 days ago
Perl script to extract the uniq Ids
#!/usr/bin/perl -w use strict; use warnings; use List::Uniq ':all'; open(my $val, "2240 days ago