Calculate Dinucleotide Frequency with Perl
#!/usr/bin/perl -w use strict; my ($genome, $head, $tail); my (%mono_nt, %di_nt); $/ = ">"; open my $fasta, '2331 days ago
Reformat the file names with Perl
#!/usr/bin/perl use strict; use warnings; use File::Copy q...my @files = glob "*.scf"; if (!$ARGV[0]){ print "Table file nee...GE: $0 table\n"; exit;} my $ifh = read_fh($ARGV[0]); while (my $...ode}= $code; } #Chec one by one for (0..$#files){ $files[$_] =...2329 days ago
Clump Finding Problem Solved with Perl
#Find patterns forming clumps in a string. #Given: A string Genome, and integers k, L, and t. #Return: All d...t)-clumps in Genome. use strict; use warnings; my %myH...TGTAATGTGCCTATGGC"; my $subStr="?"; my $clump=4; my $kmer=5...g, $subStr, $kmer); sub kmerMatch { #Check the exact match...2327 days ago
Loop over with all files in a directory in bash
#!/bin/bash FILES=/media/ComparativeGenomics/ncbi-genomes-2017-11-13/* ref=/media/ComparativeGenomics/ncbi-genome...735.1_ASM19673v1_genomic.fna path=/home/urbe/Tools/SATSUMA/satsuma-code-...$ff # take action on each file. $f store current file name mkdir $...2325 days ago
Convert fastq to fasta in Perl
use Bio::SeqIO; #convert .fastq.gz to .fasta open my $zcat, 'zcat seq.fastq.gz |' or die $!; my $in=Bio::SeqIO->n...>$zcat, -format=>'fastq'); my $out=Bio::S...$seq=$in->next_seq) { $out->write_seq($seq) }...2324 days ago
Fill up the form and blast with perl
use WWW::Mechanize; use strict; use warnings; my $mech = WWW::Mechanize->new; my $...GATCTCGATATATTATA'; $mech->get('http://www.arabidopsis.org/Blast/'); $mech...orm_name => 'myForm', fields => { 'Algorithm' => 'blastx', 'Blast...2318 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 sorted by name+location...verlaps --- next postition shold be bigger than firstpos+alienLen ope...2307 days ago
Create genome scaffolding with Perl
#!/usr/bin/perl use warnings; use strict; use Engli...} # if different, convert to upper case to simplify lo...# percent ID threshold "trimlimit" => 50, # max number o...$lLen = $fields[10 + ($longTarget * 4)]; my $sStart = $...Seqs))){ my $fullName = $targetSeqs{$seqID}{fullName};...2302 days ago
Plot the clock using Lastz -gerenal outfile
use strict; use warnings; use Statistics::R ; use List::Util qw(sum); #Usage perl clockPlot.pl Palindrome.palf...tatistics::R->new() ; $R->startR ; my $fileN=$ARGV[0]; m...f /^$/; #next if empty my @arr = split("\t", $_); if ($ar...= split '\_', $val; my $score=$pHash{$val}/$sChr[1]; pus...2292 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 apple2286 days ago