Calculate Dinucleotide Frequency with Perl
#!/usr/bin/perl -w use strict; my ($genome, $head, $tail); my (%mono_nt, %di_nt); $/ = ">"; open my $fasta, '2397 days ago
Reformat the file names with Perl
...rint "Table file needed\n USAGE: $0 table\n"; exit;} my $ifh = read_fh($ARGV[.... == 1; my ($lichenName, $name, $code) = split /\s+/, $line; next unl...{ $files[$_] =~ s/\.scf$//; my @pName = split /\_/, $files[$_]; next if...2394 days ago
Clump Finding Problem Solved with Perl
...sh){ print "$name " if $myHash{$name} == $clump; } kmerMatch ($string, $subStr, $kmer); sub kmerMatch { #Check the exact matching kmers with sliding window my ($string,...2392 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-genomes-2017-11-13/GCA_000196735.1_ASM19673v1_genomic.fna...2390 days ago
Convert fastq to fasta in Perl
...fastq'); my $out=Bio::SeqIO->new(-file=>'>seq.fasta', -format=>'fasta'); while (my $seq=$in->next_seq) { $out->write_seq($seq) }2389 days ago
Fill up the form and blast with perl
...my $sequence = 'GCCCGCGGTCTCAGAGATCTCGATATATTATA'; $mech->get('http://www.arabidopsis.org/Blast/'); $mech->submit_form( form_name => 'myForm', fields => { 'Algorithm' => 'blastx', 'BlastTa...2384 days ago
Insert the sequence at desire location in multi-fasta file with Perl
...Keep the coordinate sorted by name+location #GenomechrName locationStart AlienGene AlienLength # The coordinate should not overlaps --- next postition shold be bigger than first...2372 days ago
Create genome scaffolding with Perl
..."T", ); # if "simple" ambiguity can be found, return that, o...# percent ID threshold "trimlimit" => 50, # max number of overl...rget * 4)]; my @sBlStarts = split(/,/, $fields[19 + $shortTarge..."Rejecting match '%s' vs '%s': identity (%f) too low\n", #...2367 days ago
Plot the clock using Lastz -gerenal outfile
...%pHash; while() { chomp; next if /^$/; #next if empty my @arr = split("\t", $_); if ($arr[7] eq "...{ my $len=$arr[5]-$arr[4]; #next if $len < $mSize; my @chr = split '\_', $arr[1]; $chr[0] =~...2357 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 apple2351 days ago