Plot the clock using Lastz -gerenal outfile
use strict; use warnings; use Statistics::R ; use List::Util qw(sum); #Usage perl clockPlot.pl Palindrome.palfc 1500 my $R = Statistics::R->new() ; $R->start...2326 days ago
Remove duplicate lines with perl
#! perl -sw use strict; my %lines; #open DATA, $ARGV[0] or die "Couldn't open $ARGV[0]: $!\n"; while () { print if not $lines{$_}++; } __DATA__ apple apple plum vinegar apple banana banana banana apple2320 days ago
Remove the duplicated line present only next to each other with Perl
...$_ = ; my $next_line; while( $next_line = ) { #print "current line: $_ -- next line: $next_...$_ ne $next_line; } continue { $_ = $next_line; } print $_ if eof; } __DATA__ appl...2320 days ago
Extract the values between to user defined string with Perl
...record() if /^\s*START/; } sub process_record { my $line; while (defined ($line = ) and $line !~ /^\s*END/) { print "$line" } print "\n"; #a printout spacer for...2320 days ago
Plot the density of genes in R
#column1 = chromosome name and column2 = start position of the gene # check if ggplot2 is installed, if so, load it, # if not, install and load it if("ggplot2"...2312 days ago
2292 days ago
Download genomes in batch from NCBI
curl 'ftp://ftp.ncbi.nlm.nih.gov/genomes/genbank/bacteria/assembly_summary.txt' | awk '{FS="\t"} !/^#/ {print $20}' | sed -r 's|(ftp://ftp.ncbi.nlm.nih.gov/genomes/all/)(GCA/)([0-9]{3}/)([0-9]{3}/)([0-9]{3}/)(GCA_.+)|\1\2\3\4\5\6/\6_genomic.fna.gz|' > genomic_file2290 days ago
2279 days ago
Perl script to remove fasta sequences in multifasta file with certain length threshold
.../; s/>$//gs; my @chunk = split /\n/; my $header = shift @chunk; my $seqlen = length join "", @chunk; print ">$_" if($seqlen >= $minlen);...2279 days ago
Plot custom gene density with R
library(karyoploteR) pp2277 days ago